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

libharfbuzz fails to link on gcc 4.4.x due to -Wl,-z,defs

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      b04
    • CPU:
      generic
    • OS:
      linux

      Description

      We are seeing slowdebug build failures of 11.0.10+1 due to link issues of libharfbuzz.so:

      Linking libharfbuzz.so
      ( /bin/rm -f /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log && /usr/bin/g++ -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -m64 -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base/server -shared -Wl,--exclude-libs,ALL -Wl,-z,origin -Wl,-rpath,\$ORIGIN -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop -Wl,-soname=libharfbuzz.so -o /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.so @/home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/_BUILD_LIBHARFBUZZ_objectfilenames.txt -lm -static-libstdc++ -static-libgcc > >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log) 2> >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log >&2) || ( exitcode=$? && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libharfbuzz_BUILD_LIBHARFBUZZ_link.log && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.cmdline /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libharfbuzz_BUILD_LIBHARFBUZZ_link.cmdline && exit $exitcode ) ) ; /usr/bin/objcopy --only-keep-debug /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.so /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.debuginfo
      /bin/rm -f /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d
      cd /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz && /bin/cat *.d > /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d.tmp
      g++: unrecognized option '-static-libstdc++'
      cd /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz && /bin/cat *.d.targets | /bin/sort -u >> /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d.tmp
      /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d.tmp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d.old
      /bin/mv /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d.tmp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ.d
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-aat-layout.o: In function `AAT::KerxTable<AAT::kerx>::apply(AAT::hb_aat_apply_context_t*) const':
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `AAT::kerx::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `AAT::kerx::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `AAT::kerx::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `AAT::kerx::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: undefined reference to `AAT::kerx::tableTag'
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-aat-layout.o:/home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: more undefined references to `AAT::kerx::tableTag' follow
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-ot-layout.o: In function `AAT::KerxTable<OT::KernOT>::apply(AAT::hb_aat_apply_context_t*) const':
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernOT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernOT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernOT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernOT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: undefined reference to `OT::KernOT::tableTag'
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-ot-layout.o:/home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: more undefined references to `OT::KernOT::tableTag' follow
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-ot-layout.o: In function `AAT::KerxTable<OT::KernAAT>::apply(AAT::hb_aat_apply_context_t*) const':
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernAAT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernAAT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernAAT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:894: undefined reference to `OT::KernAAT::tableTag'
      /home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: undefined reference to `OT::KernAAT::tableTag'
      /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/hb-ot-layout.o:/home/openjdk/jdk11u/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh:926: more undefined references to `OT::KernAAT::tableTag' follow
      collect2: ld returned 1 exit status
      gmake[3]: *** [/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.so] Error 1
      gmake[3]: Leaving directory `/home/openjdk/jdk11u/make'
      gmake[2]: *** [java.desktop-libs] Error 1
      gmake[2]: Leaving directory `/home/openjdk/jdk11u'

      As it turns out JDK-8249821 got backported to 11.0.10 and that change also includes some LDFLAGS changes. Previously the link when it was part of libfontmanager.so was:

      Linking libfontmanager.so
      ( /bin/rm -f /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/BUILD_LIBFONTMANAGER_link.log && /usr/bin/g++ -Wl,--hash-style=both -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -m64 -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base/server -shared -Wl,--exclude-libs,ALL -Wl,-z,origin -Wl,-rpath,\$ORIGIN -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop -Wl,-soname=libfontmanager.so -o /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libfontmanager.so @/home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/_BUILD_LIBFONTMANAGER_objectfilenames.txt -lfreetype -lawt -ljava -ljvm -lm -static-libstdc++ -static-libgcc > >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/BUILD_LIBFONTMANAGER_link.log) 2> >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/BUILD_LIBFONTMANAGER_link.log >&2) || ( exitcode=$? && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/BUILD_LIBFONTMANAGER_link.log /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link.log && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libfontmanager/BUILD_LIBFONTMANAGER_link.cmdline /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link.cmdline && exit $exitcode ) ) ; /usr/bin/objcopy --only-keep-debug /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libfontmanager.so /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libfontmanager.debuginfo

      Now it's:

      Linking libharfbuzz.so
      ( /bin/rm -f /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log && /usr/bin/g++ -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -m64 -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.base/server -shared -Wl,--exclude-libs,ALL -Wl,-z,origin -Wl,-rpath,\$ORIGIN -L/home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop -Wl,-soname=libharfbuzz.so -o /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.so @/home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/_BUILD_LIBHARFBUZZ_objectfilenames.txt -lm -static-libstdc++ -static-libgcc > >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log) 2> >(/usr/bin/tee -a /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log >&2) || ( exitcode=$? && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.log /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libharfbuzz_BUILD_LIBHARFBUZZ_link.log && /bin/cp /home/openjdk/jdk11u/build/slowdebug/support/native/java.desktop/libharfbuzz/BUILD_LIBHARFBUZZ_link.cmdline /home/openjdk/jdk11u/build/slowdebug/make-support/failure-logs/support_native_java.desktop_libharfbuzz_BUILD_LIBHARFBUZZ_link.cmdline && exit $exitcode ) ) ; /usr/bin/objcopy --only-keep-debug /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.so /home/openjdk/jdk11u/build/slowdebug/support/modules_libs/java.desktop/libharfbuzz.debuginfo

      The keen-eyed will notice that the latter includes "-Wl,-z,defs" while the former does not.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: