freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] [freetype-2.9.1] FT_Init_FreeType is missing with cc on S


From: suzuki toshiya
Subject: Re: [ft-devel] [freetype-2.9.1] FT_Init_FreeType is missing with cc on Solaris x64
Date: Thu, 03 May 2018 23:09:09 +0900
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329)

Dear Alexei, Kanazawa-san,

Here is the patch trying to use visibility options on SunPro.
Also patched tarball is uploaded at:

http://gyvern.ipc.hiroshima-u.ac.jp/~mpsuzuki/freetype-2.9.1-sunpro.tar.gz

This is completely untested on SunPro, there might be silly
mistakes, but I hope anybody can try.

Regards,
mpsuzuki

suzuki toshiya wrote:
> Alexei Podtelezhnikov wrote:
>>> Thus, attribute visibility is only enabled for GCC >= 4.
>>>
>>> Comparing with configure.raw, I guess you assumed that
>>> -fvisibility is GCC-specific feature?
>> Solaris compiler would natively need -xldscope=hidden and __global
>> attribute, according to
>> http://www.oracle.com/technetwork/server-storage/solaris/symbol-scope-140496.html
> 
> The values of attribute-visibility would be compatible with
> GNU style, according to
> https://docs.oracle.com/cd/E19205-01/821-2496/bjabi/index.html
> please find 2.9.
> 
>> -fvisibility is GNU so Solaris had better define __GNUC__. Oh well.
> 
> According to configure.log.xz by Kanazawa-san, Oracle cc
> (pretends to as if it) supports -fvisibility.
> Anyway, I have no objection to write Sun style explicitly.
> 
> Regards,
> mpsuzuki
> 
> 
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype-devel
> 
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index baab79dc5..8eded34b4 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -311,6 +311,14 @@ AC_SUBST([XX_ANSIFLAGS])
 # It is recommended that shared libraries hide symbols except those with
 # explicit __attribute__((visibility("default"))).
 #
+AC_MSG_CHECKING([for -xldscope=hidden compiler flag])
+orig_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} -xldscope=hidden"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+                  AC_MSG_RESULT(yes),
+                  CFLAGS="${orig_CFLAGS}"
+                  AC_MSG_RESULT(no))
+
 AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
 orig_CFLAGS="${CFLAGS}"
 CFLAGS="${CFLAGS} -fvisibility=hidden"
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index b9c21da2c..282898d8a 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -493,6 +493,8 @@ FT_BEGIN_HEADER
 #define FT_EXPORT( x )  __declspec( dllexport )  x
 #elif defined( __GNUC__ ) && __GNUC__ >= 4
 #define FT_EXPORT( x )  __attribute__(( visibility( "default" ) ))  x
+#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x500
+#define FT_EXPORT( x )  __attribute__(( visibility( "__global" ) ))  x
 #elif defined( __cplusplus )
 #define FT_EXPORT( x )  extern "C"  x
 #else
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 021e2c651..2a2fe71a1 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -445,6 +445,8 @@ FT_BEGIN_HEADER
 #define FT_EXPORT( x )  __declspec( dllexport )  x
 #elif defined( __GNUC__ ) && __GNUC__ >= 4
 #define FT_EXPORT( x )  __attribute__(( visibility( "default" ) ))  x
+#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x500
+#define FT_EXPORT( x )  __attribute__(( visibility( "__global" ) ))  x
 #elif defined( __cplusplus )
 #define FT_EXPORT( x )  extern "C"  x
 #else
diff --git a/include/freetype/config/ftconfig.h 
b/include/freetype/config/ftconfig.h
index eedebf408..a3905073c 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -461,6 +461,8 @@ FT_BEGIN_HEADER
 #define FT_EXPORT( x )  __declspec( dllexport )  x
 #elif defined( __GNUC__ ) && __GNUC__ >= 4
 #define FT_EXPORT( x )  __attribute__(( visibility( "default" ) ))  x
+#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x500
+#define FT_EXPORT( x )  __attribute__(( visibility( "__global" ) ))  x
 #elif defined( __cplusplus )
 #define FT_EXPORT( x )  extern "C"  x
 #else

reply via email to

[Prev in Thread] Current Thread [Next in Thread]