-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.2_18
-
b02
-
x86
-
linux
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2206754 | 7 | Coleen Phillimore | P4 | Closed | Fixed | b130 |
On compiling the JDK code with the new gcc compiler option "-fvisibility=hidden"quite some speed improvements on all platforms are observed, but for it to work, SAP code which is marked with "JNI_EXPORT" needs to be exported correctly by the compiler. The attached patch fixes this.
The attached "jni_md.h.new" file is a version of the file, how it could look like.
% more jni_md.h.diff
--- jni_md.h 2007-07-19 15:13:07.661299000 +0200
+++ jni_md.h.new 2007-07-19 15:12:02.826109000 +0200
@@ -8,9 +8,16 @@
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
-#define JNIEXPORT
-#define JNIIMPORT
-#define JNICALL
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define JNIEXPORT __attribute__((visibility("default")))
+# define JNIIMPORT __attribute__((visibility("default")))
+# define JNICALL
+#else
+# define JNIEXPORT
+# define JNIIMPORT
+# define JNICALL
+#endif
+
typedef int jint;
#ifdef _LP64 /* 64-bit Solaris */
The attached "jni_md.h.new" file is a version of the file, how it could look like.
% more jni_md.h.diff
--- jni_md.h 2007-07-19 15:13:07.661299000 +0200
+++ jni_md.h.new 2007-07-19 15:12:02.826109000 +0200
@@ -8,9 +8,16 @@
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
-#define JNIEXPORT
-#define JNIIMPORT
-#define JNICALL
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define JNIEXPORT __attribute__((visibility("default")))
+# define JNIIMPORT __attribute__((visibility("default")))
+# define JNICALL
+#else
+# define JNIEXPORT
+# define JNIIMPORT
+# define JNICALL
+#endif
+
typedef int jint;
#ifdef _LP64 /* 64-bit Solaris */
- backported by
-
JDK-2206754 Use -fvisibility=hidden for gcc compiles
-
- Closed
-
- relates to
-
JDK-8008509 6588413 changed JNIEXPORT visibility for GCC on HSX, jdk's jni_md.h needs similar change
-
- Resolved
-
-
JDK-8009729 Refix hotspot jni_<cpu>.h JNIEXPORT and JNIIMPORT definitions to match jdk version
-
- Closed
-
-
JDK-6932270 Allow Java's ELF symtab reader to use separate debuginfo files
-
- Closed
-
-
JDK-6637877 Consider updating to gcc4 for JDK builds
-
- Closed
-