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

-Wl,-z,defs JDK 8 build failure

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • OS:
      linux

      Backports

        Description

        Compiling JDK 8 head with --with-extra-ldflags="-Wl,-z,defs" results in a build failure in when linking the SA debugger backend:

        Making SA debugger back-end...
        /usr/bin/gcc -Damd64 -D_GNU_SOURCE \
        -D_FILE_OFFSET_BITS=64 \
                           -g -m64 -shared -fPIC \
                   -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux \
                   -I../generated \
                   -I/usr/lib/jvm/java-1.8.0-openjdk/include \
                   -I/usr/lib/jvm/java-1.8.0-openjdk/include/linux \
        \
                   /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/salibelf.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/symtab.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/libproc_impl.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/ps_proc.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/ps_core.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/share/native/sadis.c \
                   -Xlinker --version-script=/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/os/linux/mapfile -Wl,--hash-style=both "-Wl,-z,noexecstack" -Wl,-z,defs \
                   -g \
                   -DJDWP_LOGGING -std=gnu++98 \
                   -o libsaproc.so \
                   -lthread_db
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        cc1: warning: command line option ‘-std=gnu++98’ is valid for C++/ObjC++ but not for C
        /tmp/ccJ2XvnU.o: In function `Java_sun_jvm_hotspot_asm_Disassembler_load_1library':
        /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/share/native/sadis.c:138: undefined reference to `dlopen'
        /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/share/native/sadis.c:141: undefined reference to `dlopen'
        /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/share/native/sadis.c:144: undefined reference to `dlsym'
        /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/agent/src/share/native/sadis.c:147: undefined reference to `dlerror'
        collect2: error: ld returned 1 exit status
        gmake[6]: *** [/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/make/linux/makefiles/saproc.make:85: libsaproc.so] Error 1
        gmake[6]: *** Waiting for unfinished jobs....

        This isn't an issue on latest JDK (12) or any JDK with the new build system JDK 9+. Hence, JDK 8 only.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sgehwolf Severin Gehwolf
                  Reporter:
                  sgehwolf Severin Gehwolf
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: