[11u] RFR: 8256557: libharfbuzz fails to link on gcc 4.4.x due to -Wl,-z,defs

Severin Gehwolf sgehwolf at redhat.com
Wed Nov 18 19:36:01 UTC 2020


Hi,

Please review this JDK 11.0.10 specific fix for building slowdebug on a
system with gcc 4.4.x (e.g. RHEL 6). JDK-8249821 got backported to
11.0.10 and that causes one slight difference in how libharfbuzz is
being linked: When it was linked as part of libfontmanager.so there was
no -Wl,-z,defs. After JDK-8249821 it's there, which makes the build
fail for slowdebug on this old toolchain. The proposal is to remove -
Wl,-z,defs from LDFLAGS_JDKLIB for libharfbuzz as was done before.

Bug: https://bugs.openjdk.java.net/browse/JDK-8256557

Patch:

diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -608,8 +608,9 @@
           truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
           hidevf w_novirtualdescr arrowrtn2 unknownpragma, \
       DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138, \
-      LDFLAGS := $(LDFLAGS_JDKLIB) \
-          $(call SET_SHARED_LIBRARY_ORIGIN), \
+      LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
+        $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) \
+        $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
       LDFLAGS_aix := -Wl$(COMMA)-berok, \
       LIBS := $(BUILD_LIBHARFBUZZ), \

Tested build on gcc 4.4.x slowdebug. Works with the patch.

I know this isn't pretty, but as there were no code changes done
in JDK-8249821 it would preserve the status quo. Plus, it would unbreak
our vanilla JDK 11 builds.

Thoughts?

Thanks,
Severin



More information about the jdk-updates-dev mailing list