Patch syslookup.c so it actually has some code to be compiled into libsyslookup

This commit is contained in:
Jiri Vanek 2021-11-08 14:48:30 +01:00 committed by Andrew John Hughes
parent 1cc9d59897
commit 4289c678a9
2 changed files with 28 additions and 9 deletions

View File

@ -298,7 +298,7 @@
%global top_level_dir_name %{origin} %global top_level_dir_name %{origin}
%global top_level_dir_name_backup %{top_level_dir_name}-backup %global top_level_dir_name_backup %{top_level_dir_name}-backup
%global buildver 12 %global buildver 12
%global rpmrelease 4 %global rpmrelease 5
# Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit # Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
%if %is_system_jdk %if %is_system_jdk
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
@ -1198,6 +1198,8 @@ Patch1013: rh1991003-enable_fips_keys_import.patch
# OpenJDK patches in need of upstreaming # OpenJDK patches in need of upstreaming
# #
############################################# #############################################
# JDK-8276572: Fake libsyslookup.so library causes tooling issues
Patch2000: jdk8276572-fake_libsyslookup_causes_tooling_issues.patch
BuildRequires: autoconf BuildRequires: autoconf
@ -1596,6 +1598,7 @@ popd # openjdk
%patch1011 %patch1011
%patch1012 %patch1012
%patch1013 %patch1013
%patch2000
# Extract systemtap tapsets # Extract systemtap tapsets
%if %{with_systemtap} %if %{with_systemtap}
@ -1916,14 +1919,6 @@ do
# All these tests rely on RPM failing the build if the exit code of any set # All these tests rely on RPM failing the build if the exit code of any set
# of piped commands is non-zero. # of piped commands is non-zero.
# If this is the empty library, libsyslookup.so, of the foreign function and memory
# API incubation module (JEP 412), skip the debuginfo check as this seems unreliable
# on s390x. It's not very useful for other arches either, so skip unconditionally.
if [ "`basename $lib`" = "libsyslookup.so" ]; then
echo "Skipping debuginfo check for empty library 'libsyslookup.so'"
continue
fi
# Test for .debug_* sections in the shared object. This is the main test # Test for .debug_* sections in the shared object. This is the main test
# Stripped objects will not contain these # Stripped objects will not contain these
eu-readelf -S "$lib" | grep "] .debug_" eu-readelf -S "$lib" | grep "] .debug_"
@ -2367,6 +2362,9 @@ cjc.mainProgram(args)
%endif %endif
%changelog %changelog
* Wed Dec 01 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-5.rolling
- Patch syslookup.c so it actually has some code to be compiled into libsyslookup
* Tue Nov 30 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-4.rolling * Tue Nov 30 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-4.rolling
- Restructure the build so a minimal initial build is then used for the final build (with docs) - Restructure the build so a minimal initial build is then used for the final build (with docs)
- This reduces pressure on the system JDK and ensures the JDK being built can do a full build - This reduces pressure on the system JDK and ensures the JDK being built can do a full build

View File

@ -0,0 +1,21 @@
commit a4724332098cd8bff44ee27e9190fd28fa5c1865
Author: Andrew John Hughes <andrew@openjdk.org>
Date: Fri Nov 5 21:05:42 2021 +0000
8276572: Fake libsyslookup.so library causes tooling issues
Reviewed-by: shade, mcimadamore
diff --git openjdk.orig/src/jdk.incubator.foreign/share/native/libsyslookup/syslookup.c openjdk/src/jdk.incubator.foreign/share/native/libsyslookup/syslookup.c
index fdf99866786..b1f543bfdb7 100644
--- openjdk.orig/src/jdk.incubator.foreign/share/native/libsyslookup/syslookup.c
+++ openjdk/src/jdk.incubator.foreign/share/native/libsyslookup/syslookup.c
@@ -26,3 +26,8 @@
// Note: the include below is not strictly required, as dependencies will be pulled using linker flags.
// Adding at least one #include removes unwanted warnings on some platforms.
#include <stdlib.h>
+
+// Simple dummy function so this library appears as a normal library to tooling.
+char* syslookup() {
+ return "syslookup";
+}