freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 2b3e0ef: Support symbol visibility features of Sun /


From: suzuki toshiya
Subject: [freetype2] master 2b3e0ef: Support symbol visibility features of Sun / Oracle C compilers.
Date: Fri, 4 May 2018 00:02:15 -0400 (EDT)

branch: master
commit 2b3e0ef6c095cf6ea920e95fc9826dc39694162a
Author: suzuki toshiya <address@hidden>
Commit: suzuki toshiya <address@hidden>

    Support symbol visibility features of Sun / Oracle C compilers.
    Reported by Kiyoshi Kanazawa:
    https://lists.gnu.org/archive/html/freetype-devel/2018-05/msg00008.html
    Thanks to the suggestions by Alexei and Alan Coopersmith.
    
    * builds/unix/configure.raw: Check if "-xldscope=hidden" is
    accepted, and if so, it is added to CFLAGS.  This is the option
    making Sun / Oracle C compilers hide the symbols from global
    scope.
    * include/freetype/config/ftconfig.h: Use "__global" prefix
    for FT_EXPORT() macro, if SunPro C is newer than Sun ONE
    Studio 8 (2003).
    * builds/unix/ftconfig.in: Ditto.
    * builds/vms/ftconfig.h: Ditto.
---
 ChangeLog                          | 17 +++++++++++++++++
 builds/unix/configure.raw          |  8 ++++++++
 builds/unix/ftconfig.in            |  2 ++
 builds/vms/ftconfig.h              |  2 ++
 include/freetype/config/ftconfig.h |  2 ++
 5 files changed, 31 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9fb0711..3401f91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2018-05-04  suzuki toshiya  <address@hidden>
+
+       Support symbol visibility features of Sun / Oracle C compilers.
+       Reported by Kiyoshi Kanazawa:
+       https://lists.gnu.org/archive/html/freetype-devel/2018-05/msg00008.html
+       Thanks to the suggestions by Alexei and Alan Coopersmith.
+
+       * builds/unix/configure.raw: Check if "-xldscope=hidden" is
+       accepted, and if so, it is added to CFLAGS.  This is the option
+       making Sun / Oracle C compilers hide the symbols from global
+       scope.
+       * include/freetype/config/ftconfig.h: Use "__global" prefix
+       for FT_EXPORT() macro, if SunPro C is newer than Sun ONE
+       Studio 8 (2003).
+       * builds/unix/ftconfig.in: Ditto.
+       * builds/vms/ftconfig.h: Ditto.
+
 2018-05-02  Nikolaus Waxweiler  <address@hidden>
 
        Unbreak CMake Windows installation
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index baab79d..8eded34 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 b9c21da..dc4aff7 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 >= 0x550
+#define FT_EXPORT( x )  __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 021e2c6..77bca54 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 >= 0x550
+#define FT_EXPORT( x )  __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 eedebf4..52c5e33 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 >= 0x550
+#define FT_EXPORT( x )  __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]