8210705: Stop exporting all symbols on macosx
authorihse
Mon, 24 Sep 2018 20:45:06 +0200
changeset 51855 8bbb5cbac92c
parent 51854 3c6d285c8168
child 51856 11b9d3a6f31c
child 56903 e5d66cabcf19
8210705: Stop exporting all symbols on macosx Reviewed-by: erikj
make/launcher/LauncherCommon.gmk
make/lib/LibCommon.gmk
src/java.desktop/macosx/native/libosxapp/AWT_debug.h
src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h
src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.h
src/java.desktop/macosx/native/libosxapp/ThreadUtilities.h
--- a/make/launcher/LauncherCommon.gmk	Mon Sep 24 10:41:41 2018 -0700
+++ b/make/launcher/LauncherCommon.gmk	Mon Sep 24 20:45:06 2018 +0200
@@ -36,9 +36,7 @@
   LAUNCHER_CFLAGS += -fvisibility=hidden
   LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
 else ifeq ($(TOOLCHAIN_TYPE), clang)
-  ifneq ($(OPENJDK_TARGET_OS), macosx)
-    LAUNCHER_CFLAGS += -fvisibility=hidden
-  endif
+  LAUNCHER_CFLAGS += -fvisibility=hidden
 else ifeq ($(TOOLCHAIN_TYPE), solstudio)
   LAUNCHER_CFLAGS += -xldscope=hidden
 else ifeq ($(TOOLCHAIN_TYPE), xlc)
--- a/make/lib/LibCommon.gmk	Mon Sep 24 10:41:41 2018 -0700
+++ b/make/lib/LibCommon.gmk	Mon Sep 24 20:45:06 2018 +0200
@@ -46,11 +46,9 @@
   LDFLAGS_JDKLIB += -Wl,--exclude-libs,ALL
   EXPORT_ALL_SYMBOLS := -fvisibility=default
 else ifeq ($(TOOLCHAIN_TYPE), clang)
-  ifneq ($(OPENJDK_TARGET_OS), macosx)
-    CFLAGS_JDKLIB += -fvisibility=hidden
-    CXXFLAGS_JDKLIB += -fvisibility=hidden
-    EXPORT_ALL_SYMBOLS := -fvisibility=default
-  endif
+  CFLAGS_JDKLIB += -fvisibility=hidden
+  CXXFLAGS_JDKLIB += -fvisibility=hidden
+  EXPORT_ALL_SYMBOLS := -fvisibility=default
 else ifeq ($(TOOLCHAIN_TYPE), solstudio)
   CFLAGS_JDKLIB += -xldscope=hidden
   CXXFLAGS_JDKLIB += -xldscope=hidden
--- a/src/java.desktop/macosx/native/libosxapp/AWT_debug.h	Mon Sep 24 10:41:41 2018 -0700
+++ b/src/java.desktop/macosx/native/libosxapp/AWT_debug.h	Mon Sep 24 20:45:06 2018 +0200
@@ -26,9 +26,11 @@
 #ifndef macosx_port_awt_debug_h
 #define macosx_port_awt_debug_h
 
+#include "jni.h"
+
 #import <Cocoa/Cocoa.h>
 
-bool ShouldPrintVerboseDebugging();
+JNIEXPORT bool ShouldPrintVerboseDebugging();
 
 #define kInternalError "java/lang/InternalError"
 
--- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h	Mon Sep 24 10:41:41 2018 -0700
+++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h	Mon Sep 24 20:45:06 2018 +0200
@@ -32,7 +32,7 @@
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
-@interface NSApplicationAWT : NSApplication <NSUserNotificationCenterDelegate> {
+JNIEXPORT @interface NSApplicationAWT : NSApplication <NSUserNotificationCenterDelegate> {
     NSString *fApplicationName;
     NSWindow *eventTransparentWindow;
     NSTimeInterval dummyEventTimestamp;
@@ -57,5 +57,5 @@
 
 @end
 
-void OSXAPP_SetApplicationDelegate(id <NSApplicationDelegate> delegate);
+JNIEXPORT void OSXAPP_SetApplicationDelegate(id <NSApplicationDelegate> delegate);
 
--- a/src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.h	Mon Sep 24 10:41:41 2018 -0700
+++ b/src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.h	Mon Sep 24 20:45:06 2018 +0200
@@ -23,11 +23,17 @@
  * questions.
  */
 
+/*
+ * Must include this before JavaNativeFoundation.h to get jni.h from build
+ */
+#include "jni.h"
+#include "jni_util.h"
+
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
 
-@interface PropertiesUtilities : NSObject
+JNIEXPORT @interface PropertiesUtilities : NSObject
 
 + (NSString *) javaSystemPropertyForKey:(NSString *)key withEnv:(JNIEnv *)env;
 
--- a/src/java.desktop/macosx/native/libosxapp/ThreadUtilities.h	Mon Sep 24 10:41:41 2018 -0700
+++ b/src/java.desktop/macosx/native/libosxapp/ThreadUtilities.h	Mon Sep 24 20:45:06 2018 +0200
@@ -26,6 +26,8 @@
 #ifndef __THREADUTILITIES_H
 #define __THREADUTILITIES_H
 
+#include "jni.h"
+
 #import <pthread.h>
 
 #import "AWT_debug.h"
@@ -135,6 +137,6 @@
 + (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait;
 @end
 
-void OSXAPP_SetJavaVM(JavaVM *vm);
+JNIEXPORT void OSXAPP_SetJavaVM(JavaVM *vm);
 
 #endif /* __THREADUTILITIES_H */