From e39964f4d9a274e50a1df26f13fcb5c13a515a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2?= Date: Sun, 17 Jan 2021 21:09:04 +0000 Subject: [PATCH 1/3] "error __PIC__ level differs in PCH file vs. current file" add flag -fno-PIC ix86 --- java-11-openjdk.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index 8a31304..cdfa14e 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -146,6 +146,9 @@ # We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) # We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings # We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ +%ifarch %{ix86} +%global optflags %optflags -fno-PIC +%endif %global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||') %global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') From ce1d5041d439625e3304c80336c3d9b0da12e8ec Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Wed, 24 Mar 2021 23:26:31 +0300 Subject: [PATCH 2/3] Bootstrap on i686 and aarch64, use Liberica JDK for bootstrap --- .abf.yml | 9 ++++++--- java-11-openjdk.spec | 26 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.abf.yml b/.abf.yml index f45a118..0da1d79 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,4 +1,7 @@ sources: - "shenandoah-jdk11-shenandoah-jdk-11.0.8+6-4curve.tar.xz": 675c2ab8b8793ab87d0cf9b77b2196b71f4afbca - "tapsets-icedtea-3.15.0.tar.xz": 7ae2cba67467825b2c2a5fec7aea041865023002 - "OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz": 5627bcceee613c4764c120e941c8d24b3e5a6e33 + OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz: 5627bcceee613c4764c120e941c8d24b3e5a6e33 + bellsoft-jdk11.0.10+9-linux-aarch64.tar.gz: 6eed6f7cf4167316b2f22ebb5f3119b0869eb554 + bellsoft-jdk11.0.10+9-linux-amd64.tar.gz: 32e0fe99199c9691e616af48355157139c0c8e60 + bellsoft-jdk11.0.10+9-linux-i586.tar.gz: 301b8efbf861f823b8f44cc22385020cf85d4be3 + shenandoah-jdk11-shenandoah-jdk-11.0.8+6-4curve.tar.xz: 675c2ab8b8793ab87d0cf9b77b2196b71f4afbca + tapsets-icedtea-3.15.0.tar.xz: 7ae2cba67467825b2c2a5fec7aea041865023002 diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index cdfa14e..595efa4 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -1099,7 +1099,27 @@ Source15: TestSecurityProperties.java # ROSA-specific Source300: %{name}.rpmlintrc -Source301: OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz +# Binary JDK for buolding with_bootstrap +# Only Liberica JDK provides binaries for x86_32 +# Gentoo uses https://github.com/AdoptOpenJDK/openjdk11-upstream-binaries/releases, there is no x86_32 there +# Using https://libericajdk.ru/pages/downloads/#/java-11-lts -> "Standard JDK" +# x86_32 +Source301: https://download.bell-sw.com/java/11.0.10+9/bellsoft-jdk11.0.10+9-linux-i586.tar.gz +# x86_64 +Source302: https://download.bell-sw.com/java/11.0.10+9/bellsoft-jdk11.0.10+9-linux-amd64.tar.gz +# aarch64 +Source303: https://download.bell-sw.com/java/11.0.10+9/bellsoft-jdk11.0.10+9-linux-aarch64.tar.gz + +%ifarch %{ix86} +%define bootstrap_jdk_source_num 301 +%endif +%ifarch %{x86_64} +%define bootstrap_jdk_source_num 302 +%endif +%ifarch aarch64 +%define bootstrap_jdk_source_num 303 +%endif + ############################################ # @@ -1418,7 +1438,7 @@ if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then echo "You have disabled both include_debug_build and include_normal_build. That is a no go." exit 13 fi -%setup -q -c -n %{uniquesuffix ""} -T -a 0 %{?with_bootstrap:-b 301} +%setup -q -c -n %{uniquesuffix ""} -T -a 0 %{?with_bootstrap:-b %{bootstrap_jdk_source_num}} # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` if [ $prioritylength -ne 8 ] ; then @@ -1560,7 +1580,7 @@ bash ../configure \ %if ! %{with bootstrap} --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \ %else - --with-boot-jdk="%{_builddir}/jdk-11.0.7+10" \ + --with-boot-jdk="%{_builddir}/jdk-11.0.10" \ %endif --with-debug-level=$debugbuild \ --with-native-debug-symbols=internal \ From 9e15813a9b7880fb0106899f5de0c6647ff5ed96 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Wed, 24 Mar 2021 23:54:53 +0300 Subject: [PATCH 3/3] Fix jar cmd with bootstrap --- java-11-openjdk.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index 595efa4..d5cf0ce 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -1743,7 +1743,7 @@ grep 'JavaCallWrapper::JavaCallWrapper' gdb.out %endif # Check src.zip has all sources. See RHBZ#1130490 -jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe' +$JAVA_HOME/bin/jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe' # Check class files include useful debugging information $JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"