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

Related: rhbz#2013846
This commit is contained in:
Andrew Hughes 2021-11-05 04:51:15 +00:00
parent ccefd13b01
commit bf21f1a810
2 changed files with 29 additions and 9 deletions

View File

@ -298,7 +298,7 @@
%global top_level_dir_name %{origin}
%global top_level_dir_name_backup %{top_level_dir_name}-backup
%global buildver 35
%global rpmrelease 5
%global rpmrelease 6
# 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
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
@ -1189,6 +1189,8 @@ Patch1013: rh1991003-enable_fips_keys_import.patch
# OpenJDK patches in need of upstreaming
#
#############################################
# JDK-8276572: Fake libsyslookup.so library causes tooling issues
Patch2000: jdk8276572-fake_libsyslookup_causes_tooling_issues.patch
#############################################
#
@ -1558,6 +1560,7 @@ popd # openjdk
%patch1011
%patch1012
%patch1013
%patch2000
# Extract systemtap tapsets
%if %{with_systemtap}
@ -1834,14 +1837,6 @@ do
# All these tests rely on RPM failing the build if the exit code of any set
# 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
# Stripped objects will not contain these
eu-readelf -S "$lib" | grep "] .debug_"
@ -2275,6 +2270,10 @@ cjc.mainProgram(args)
%endif
%changelog
* Fri Nov 05 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.0.0.35-6
- Patch syslookup.c so it actually has some code to be compiled into libsyslookup
- Related: rhbz#2013846
* Sun Oct 10 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.0.0.35-5
- Allow plain key import to be disabled with -Dcom.redhat.fips.plainKeySupport=false
- Resolves: rhbz#1994682

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";
+}