# HG changeset patch # User sgehwolf # Date 1523360781 -7200 # Tue Apr 10 13:46:21 2018 +0200 # Node ID 5f2401aef9acb6998f06cb82fdd8a84eda3e63ad # Parent 656ab3b39178c1e4de644d490613bfd8212ae924 8196516: libfontmanager must be built with LDFLAGS allowing unresolved symbols Summary: Fixes build failures on some sustems with custom LDFLAGS settings. diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -927,6 +927,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow endif +# LDFLAGS clarification: +# Filter relevant linker flags disallowing unresolved symbols as we cannot +# build-time decide to which library to link against (libawt_headless or +# libawt_xawt). See JDK-8196516 for details. $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ LIBRARY := fontmanager, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -941,7 +945,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ -DCC_NOEX, \ MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ - LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ + LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ + $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \