--- old/make/lib/Awt2dLibraries.gmk 2018-04-09 13:31:14.764093469 +0200 +++ new/make/lib/Awt2dLibraries.gmk 2018-04-09 13:31:14.508094059 +0200 @@ -619,6 +619,10 @@ BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing 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 SetupJdkLibrary, BUILD_LIBFONTMANAGER, \ NAME := fontmanager, \ SRC := $(LIBFONTMANAGER_SRC), \ @@ -644,7 +648,8 @@ truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ hidevf w_novirtualdescr arrowrtn2, \ DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101, \ - LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)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_unix := -L$(INSTALL_LIBRARIES_HERE), \ LDFLAGS_macosx := -undefined dynamic_lookup, \