Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6588413

Use -fvisibility=hidden for gcc compiles

    Details

    • Subcomponent:
    • Resolved In Build:
      b02
    • CPU:
      x86
    • OS:
      linux
    • Verification:
      Not verified

      Backports

        Description

        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 */

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  coleenp Coleen Phillimore
                  Reporter:
                  duke J. Duke (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: