From bed64197890484cca279590bebe68dc2810e760c Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Thu, 16 Jan 2025 22:51:59 +0000 Subject: [PATCH] Revise JDK-8141590 backport to install libffi.so* in lib as well as jre/lib Related: RHEL-74304 --- java-1.8.0-openjdk.spec | 2 ++ jdk8141590-bundle_libffi-followup.patch | 32 ++++++++++++++++------ jdk8141590-bundle_libffi.patch | 35 +++++++++++-------------- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 9c5b856..8efff0e 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -2712,7 +2712,9 @@ cjc.mainProgram(args) - Update to 8u442-b06 (GA) - Update release notes for 8u442-b06. - Switch to GA mode for final release +- Revise JDK-8141590 backport to install libffi.so* in lib as well as jre/lib - Resolves: RHEL-73540 +- Related: RHEL-74304 * Thu Jan 16 2025 Andrew Hughes - 1:1.8.0.442.b05-0.3.ea - Add zero_arches to the portable_build_arches now that the portable build bundles libffi diff --git a/jdk8141590-bundle_libffi-followup.patch b/jdk8141590-bundle_libffi-followup.patch index 3dd74ba..73b09ab 100644 --- a/jdk8141590-bundle_libffi-followup.patch +++ b/jdk8141590-bundle_libffi-followup.patch @@ -1,18 +1,30 @@ +commit 928f3bf4a3017931ecc7012688e62d8a03264e61 +Author: Andrew Hughes +AuthorDate: Thu Jan 16 17:40:36 2025 +0000 +Commit: Andrew Hughes +CommitDate: Thu Jan 16 22:50:24 2025 +0000 + + Search /usr/lib64 on architectures other than x86_64 + diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh -index c6144b1968..b9e2471a19 100644 +index 587b4c2657..5aeebe49a3 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4493,7 +4493,7 @@ VS_TOOLSET_SUPPORTED_2022=true #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: --DATE_WHEN_GENERATED=1736991241 -+DATE_WHEN_GENERATED=1737030662 +-DATE_WHEN_GENERATED=1737049912 ++DATE_WHEN_GENERATED=1737067804 ############################################################################### # -@@ -50593,6 +50593,8 @@ $as_echo_n "checking for libffi lib file location... " >&6; } - # Fallback on the default /usr/lib dir +@@ -50590,9 +50590,11 @@ $as_echo_n "checking for libffi lib file location... " >&6; } + as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5 + fi + else +- # Fallback on the default /usr/lib dir ++ # Fallback on the default /usr/lib and /usr/lib64 dirs if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?" + elif test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then @@ -21,11 +33,15 @@ index c6144b1968..b9e2471a19 100644 as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5 fi diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 -index 4ed8b4fdd6..1e759a7589 100644 +index 4ed8b4fdd6..6ab6dbc075 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 -@@ -1124,6 +1124,8 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], - # Fallback on the default /usr/lib dir +@@ -1121,9 +1121,11 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], + AC_MSG_ERROR([Could not locate libffi.so.? for bundling]) + fi + else +- # Fallback on the default /usr/lib dir ++ # Fallback on the default /usr/lib and /usr/lib64 dirs if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?" + elif test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then diff --git a/jdk8141590-bundle_libffi.patch b/jdk8141590-bundle_libffi.patch index 3e6c208..a200be7 100644 --- a/jdk8141590-bundle_libffi.patch +++ b/jdk8141590-bundle_libffi.patch @@ -1,5 +1,5 @@ diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh -index ad3f7f232e..c6144b1968 100644 +index ad3f7f232e..587b4c2657 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -649,6 +649,9 @@ LLVM_LIBS @@ -103,7 +103,7 @@ index ad3f7f232e..c6144b1968 100644 # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1716396030 -+DATE_WHEN_GENERATED=1736991241 ++DATE_WHEN_GENERATED=1737049912 ############################################################################### # @@ -691,6 +691,20 @@ index 6b36f0e2bc..6f42c7ad37 100644 # Propagate compiler and tools paths from configure to nmake. # Need to make sure they contain \\ and not /. ifneq ($(SPEC),) +diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk +index 2e378c9134..0edefd7b5c 100644 +--- a/jdk/make/Images.gmk ++++ b/jdk/make/Images.gmk +@@ -249,7 +249,8 @@ endif + + ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris + JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ +- $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) ++ $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \ ++ $(LIBFFI_LIB_FILE) + endif + + # Find all files to copy from $(JDK_OUTPUTDIR)/lib diff --git a/jdk/make/Import.gmk b/jdk/make/Import.gmk index b115fa7f86..29fa2662a6 100644 --- a/jdk/make/Import.gmk @@ -704,23 +718,6 @@ index b115fa7f86..29fa2662a6 100644 Xusage.txt sa-jdi.jar ifeq ($(OPENJDK_TARGET_OS), macosx) -diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk -index 892df0a424..1727dd19c7 100644 ---- a/make/common/MakeBase.gmk -+++ b/make/common/MakeBase.gmk -@@ -384,6 +384,12 @@ else - endef - endif - -+# Variant of install file that does not preserve symlinks -+define install-file-nolink -+ $(MKDIR) -p $(@D) -+ $(CP) -f '$<' '$@' -+endef -+ - # Convenience functions for working around make's limitations with $(filter ). - containing = $(foreach v,$2,$(if $(findstring $1,$v),$v)) - not-containing = $(foreach v,$2,$(if $(findstring $1,$v),,$v)) diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk index c2460105b7..cf2ef251ac 100644 --- a/make/devkit/Tools.gmk