Use correct patch for RHBZ#1538767 (JDK-8196516)

The old patch caused problems upstream and a new
fix got developed under JDK-8196516.
This commit is contained in:
Severin Gehwolf 2018-04-10 14:08:11 +02:00
parent 44da3ccafd
commit a720eb72a5
2 changed files with 35 additions and 19 deletions

View File

@ -938,7 +938,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%{?1}
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}
Release: 5.%{buildver}%{?dist}
Release: 6.%{buildver}%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@ -1036,8 +1036,9 @@ Patch509: rh1176206-root.patch
Patch523: pr2974-rh1337583.patch
# PR3083, RH1346460: Regression in SSL debug output without an ECC provider
Patch528: pr3083-rh1346460.patch
# 8196218, RH1538767: libfontmanager.so needs to link against headless awt library
Patch529: rhbz_1538767_fix_linking.patch
# 8196516, RH1538767: libfontmanager.so needs to be built with LDFLAGS so as to allow
# linking with unresolved symbols.
Patch529: rhbz_1538767_fix_linking2.patch
# Upstreamable debugging patches
# Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files
@ -2125,6 +2126,9 @@ require "copy_jdk_configs.lua"
%endif
%changelog
* Tue Apr 10 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1:1.8.0.162-6.b12
- Use correct patch for RHBZ#1538767 (JDK-8196516)
* Mon Apr 02 2018 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.162-5.b12
- Cleanup from previous commit.
- Remove unused upstream patch 8167200.hotspotAarch64.patch.

View File

@ -1,21 +1,33 @@
# 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
@@ -921,7 +921,7 @@
LDFLAGS := $(subst -Xlinker -z -Xlinker 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, \
+ LDFLAGS_SUFFIX_linux := -lawt_headless -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
@@ -938,7 +938,7 @@
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
-ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
+ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix linux))
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
@@ -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, \