From 4570b86da0216eee49231754787b0e5d8aa74886 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 27 Oct 2009 09:16:08 -0600 Subject: [PATCH] add __attribute__ ((externally_visible)) to EXPORT macros to facilitate whole-program optimization using GCC 4.5 --- classpath/jni-util.h | 5 +++-- src/boot.cpp | 8 ++++---- src/common.h | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/classpath/jni-util.h b/classpath/jni-util.h index d144e704db..cbf33feda9 100644 --- a/classpath/jni-util.h +++ b/classpath/jni-util.h @@ -19,11 +19,12 @@ #if (defined __MINGW32__) || (defined _MSC_VER) # define PLATFORM_WINDOWS # define PATH_SEPARATOR ';' -# define JNIEXPORT __declspec(dllexport) +# define JNIEXPORT __declspec(dllexport) __attribute__ ((externally_visible)) #else # define PLATFORM_POSIX # define PATH_SEPARATOR ':' -# define JNIEXPORT __attribute__ ((visibility("default"))) +# define JNIEXPORT __attribute__ ((visibility("default"))) \ + __attribute__ ((externally_visible)) #endif #ifdef _MSC_VER diff --git a/src/boot.cpp b/src/boot.cpp index e313b6c553..c2980dc48e 100644 --- a/src/boot.cpp +++ b/src/boot.cpp @@ -27,10 +27,10 @@ extern "C" void __cxa_pure_virtual(void) { abort(); } #ifdef BOOT_IMAGE #if (defined __MINGW32__) || (defined _MSC_VER) -# define EXPORT __declspec(dllexport) +# define EXPORT __declspec(dllexport) __attribute__ ((externally_visible)) # define SYMBOL(x) binary_bootimage_bin_##x #else -# define EXPORT __attribute__ ((visibility("default"))) +# define EXPORT __attribute__ ((visibility("default"))) __attribute__ ((externally_visible)) # define SYMBOL(x) _binary_bootimage_bin_##x #endif @@ -53,10 +53,10 @@ extern "C" { #ifdef BOOT_CLASSPATH #if (defined __MINGW32__) || (defined _MSC_VER) -# define EXPORT __declspec(dllexport) +# define EXPORT __declspec(dllexport) __attribute__ ((externally_visible)) # define SYMBOL(x) binary_classpath_jar_##x #else -# define EXPORT __attribute__ ((visibility("default"))) +# define EXPORT __attribute__ ((visibility("default"))) __attribute__ ((externally_visible)) # define SYMBOL(x) _binary_classpath_jar_##x #endif diff --git a/src/common.h b/src/common.h index 7c92f85f2c..7b67a14fe5 100644 --- a/src/common.h +++ b/src/common.h @@ -90,10 +90,10 @@ typedef uint64_t uintptr_t; #undef JNIEXPORT #ifdef PLATFORM_WINDOWS -# define JNIEXPORT __declspec(dllexport) +# define JNIEXPORT __declspec(dllexport) __attribute__ ((externally_visible)) # define PATH_SEPARATOR ';' #else -# define JNIEXPORT __attribute__ ((visibility("default"))) +# define JNIEXPORT __attribute__ ((visibility("default"))) __attribute__ ((externally_visible)) # define PATH_SEPARATOR ':' #endif