Compare commits

...

No commits in common. "c8" and "c9-bootstrap" have entirely different histories.

17 changed files with 1596 additions and 11396 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/shenandoah8u452-b09.tar.xz
SOURCES/openjdk-shenandoah-jdk8u-shenandoah-jdk8u372-b07-4curve.tar.xz
SOURCES/tapsets-icedtea-3.15.0.tar.xz

View File

@ -1,2 +1,2 @@
c09d806f1a991cd77d3f15bb35ff69cb9d1bdbc0 SOURCES/shenandoah8u452-b09.tar.xz
3f015b60e085b0e1f0fd9ea13abf775a890c2b1b SOURCES/openjdk-shenandoah-jdk8u-shenandoah-jdk8u372-b07-4curve.tar.xz
7ae2cba67467825b2c2a5fec7aea041865023002 SOURCES/tapsets-icedtea-3.15.0.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac
index 151e5a109f..a8761b500e 100644
index 151e5a109f8..a8761b500e0 100644
--- a/common/autoconf/configure.ac
+++ b/common/autoconf/configure.ac
@@ -212,6 +212,7 @@ LIB_SETUP_FREETYPE
@ -11,10 +11,10 @@ index 151e5a109f..a8761b500e 100644
LIB_SETUP_ON_WINDOWS
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index c6144b1968..9ac55d20d3 100644
index 71fabf4dbb3..17f4f50673d 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -655,6 +655,9 @@ ENABLE_LIBFFI_BUNDLING
@@ -651,6 +651,9 @@ LLVM_CONFIG
LIBFFI_LIBS
LIBFFI_CFLAGS
STATIC_CXX_SETTING
@ -24,15 +24,15 @@ index c6144b1968..9ac55d20d3 100644
LIBDL
LIBM
LIBZIP_CAN_USE_MMAP
@@ -1119,6 +1122,7 @@ with_fontconfig
@@ -1111,6 +1114,7 @@ with_fontconfig
with_fontconfig_include
with_giflib
with_zlib
+enable_sysconf_nss
with_stdc__lib
with_libffi
with_libffi_include
@@ -1232,6 +1236,8 @@ FREETYPE_CFLAGS
with_msvcr_dll
with_msvcp_dll
@@ -1218,6 +1222,8 @@ FREETYPE_CFLAGS
FREETYPE_LIBS
ALSA_CFLAGS
ALSA_LIBS
@ -41,16 +41,16 @@ index c6144b1968..9ac55d20d3 100644
LIBFFI_CFLAGS
LIBFFI_LIBS
CCACHE'
@@ -1874,6 +1880,8 @@ Optional Features:
@@ -1871,6 +1877,8 @@ Optional Features:
disable bundling of the freetype library with the
build result [enabled on Windows or when using
--with-freetype, disabled otherwise]
+ --enable-sysconf-nss build the System Configurator (libsysconf) using the
+ system NSS library if available [disabled]
--enable-libffi-bundling
enable bundling of libffi.so to make the built JDK
runnable on more systems
@@ -2129,6 +2137,8 @@ Some influential environment variables:
--enable-sjavac use sjavac to do fast incremental compiles
[disabled]
--disable-precompiled-headers
@@ -2115,6 +2123,8 @@ Some influential environment variables:
linker flags for FREETYPE, overriding pkg-config
ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config
ALSA_LIBS linker flags for ALSA, overriding pkg-config
@ -59,7 +59,60 @@ index c6144b1968..9ac55d20d3 100644
LIBFFI_CFLAGS
C compiler flags for LIBFFI, overriding pkg-config
LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config
@@ -4109,6 +4119,11 @@ fi
@@ -2879,6 +2889,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -4049,6 +4105,11 @@ fi
@ -71,7 +124,7 @@ index c6144b1968..9ac55d20d3 100644
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50141,6 +50156,157 @@ fi
@@ -49304,6 +49365,157 @@ fi
LIBS="$save_LIBS"
@ -193,7 +246,7 @@ index c6144b1968..9ac55d20d3 100644
+/* end confdefs.h. */
+#include <nss3/pk11pub.h>
+int
+main (void)
+main ()
+{
+SECMOD_GetSystemFIPSEnabled()
+ ;
@ -230,10 +283,10 @@ index c6144b1968..9ac55d20d3 100644
#
# statically link libstdc++ before C++ ABI is stablized on Linux unless
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index 4ed8b4fdd6..caf293be72 100644
index 6efae578ea9..0080846255b 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -1216,3 +1216,63 @@ AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
@@ -1067,3 +1067,63 @@ AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
fi
])
@ -298,12 +351,12 @@ index 4ed8b4fdd6..caf293be72 100644
+ AC_SUBST(USE_SYSCONF_NSS)
+])
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 8da3ac32a0..4d081d1b84 100644
index 506cf617087..7241593b1a4 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -317,6 +317,10 @@ ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
LIBFFI_LIB_DIR:=@LIBFFI_LIB_DIR@
LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
@@ -312,6 +312,10 @@ CUPS_CFLAGS:=@CUPS_CFLAGS@
ALSA_LIBS:=@ALSA_LIBS@
ALSA_CFLAGS:=@ALSA_CFLAGS@
+USE_SYSCONF_NSS:=@USE_SYSCONF_NSS@
+NSS_LIBS:=@NSS_LIBS@
@ -313,7 +366,7 @@ index 8da3ac32a0..4d081d1b84 100644
# Source file for cacerts
diff --git a/common/bin/compare_exceptions.sh.incl b/common/bin/compare_exceptions.sh.incl
index 3b79a526f5..d2a0e39b20 100644
index 3b79a526f56..d2a0e39b206 100644
--- a/common/bin/compare_exceptions.sh.incl
+++ b/common/bin/compare_exceptions.sh.incl
@@ -280,6 +280,7 @@ ACCEPTED_SMALL_SIZE_DIFF="
@ -349,7 +402,7 @@ index 3b79a526f5..d2a0e39b20 100644
./jre/lib/sparcv9/libunpack.so
./jre/lib/sparcv9/libverify.so
diff --git a/common/nb_native/nbproject/configurations.xml b/common/nb_native/nbproject/configurations.xml
index d2beed0b93..3b6aef98d9 100644
index d2beed0b93a..3b6aef98d9a 100644
--- a/common/nb_native/nbproject/configurations.xml
+++ b/common/nb_native/nbproject/configurations.xml
@@ -53,6 +53,9 @@
@ -375,10 +428,10 @@ index d2beed0b93..3b6aef98d9 100644
ex="false"
tool="0"
diff --git a/jdk/make/lib/SecurityLibraries.gmk b/jdk/make/lib/SecurityLibraries.gmk
index 84abb7e76b..cb4531b880 100644
index b0b85d80448..47a41d7518d 100644
--- a/jdk/make/lib/SecurityLibraries.gmk
+++ b/jdk/make/lib/SecurityLibraries.gmk
@@ -303,3 +303,34 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
@@ -289,3 +289,34 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
endif
endif
@ -415,7 +468,7 @@ index 84abb7e76b..cb4531b880 100644
+
diff --git a/jdk/make/mapfiles/libsystemconf/mapfile-vers b/jdk/make/mapfiles/libsystemconf/mapfile-vers
new file mode 100644
index 0000000000..a65ceb3b78
index 00000000000..a65ceb3b78c
--- /dev/null
+++ b/jdk/make/mapfiles/libsystemconf/mapfile-vers
@@ -0,0 +1,35 @@
@ -455,7 +508,7 @@ index 0000000000..a65ceb3b78
+ *;
+};
diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java
index 0db09da706..813b907db3 100644
index 0db09da7061..813b907db3e 100644
--- a/jdk/src/share/classes/java/security/Security.java
+++ b/jdk/src/share/classes/java/security/Security.java
@@ -30,6 +30,8 @@ import java.util.*;
@ -587,7 +640,7 @@ index 0db09da706..813b907db3 100644
/*
diff --git a/jdk/src/share/classes/java/security/SystemConfigurator.java b/jdk/src/share/classes/java/security/SystemConfigurator.java
new file mode 100644
index 0000000000..a24a0445db
index 00000000000..a24a0445db2
--- /dev/null
+++ b/jdk/src/share/classes/java/security/SystemConfigurator.java
@@ -0,0 +1,248 @@
@ -841,7 +894,7 @@ index 0000000000..a24a0445db
+}
diff --git a/jdk/src/share/classes/sun/misc/JavaSecuritySystemConfiguratorAccess.java b/jdk/src/share/classes/sun/misc/JavaSecuritySystemConfiguratorAccess.java
new file mode 100644
index 0000000000..5c30a8b29c
index 00000000000..5c30a8b29c7
--- /dev/null
+++ b/jdk/src/share/classes/sun/misc/JavaSecuritySystemConfiguratorAccess.java
@@ -0,0 +1,31 @@
@ -877,7 +930,7 @@ index 0000000000..5c30a8b29c
+ boolean isPlainKeySupportEnabled();
+}
diff --git a/jdk/src/share/classes/sun/misc/SharedSecrets.java b/jdk/src/share/classes/sun/misc/SharedSecrets.java
index f065a2c685..0dafe6f59c 100644
index f065a2c685d..0dafe6f59cf 100644
--- a/jdk/src/share/classes/sun/misc/SharedSecrets.java
+++ b/jdk/src/share/classes/sun/misc/SharedSecrets.java
@@ -31,6 +31,7 @@ import java.io.Console;
@ -914,7 +967,7 @@ index f065a2c685..0dafe6f59c 100644
}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/FIPSKeyImporter.java b/jdk/src/share/classes/sun/security/pkcs11/FIPSKeyImporter.java
new file mode 100644
index 0000000000..14d1945039
index 00000000000..14d19450390
--- /dev/null
+++ b/jdk/src/share/classes/sun/security/pkcs11/FIPSKeyImporter.java
@@ -0,0 +1,290 @@
@ -1209,7 +1262,7 @@ index 0000000000..14d1945039
+ }
+}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
index fedcd7743e..f9d70863bd 100644
index fedcd7743ef..f9d70863bd1 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -26,6 +26,9 @@
@ -1313,7 +1366,7 @@ index fedcd7743e..f9d70863bd 100644
if (config.getHandleStartupErrors() == Config.ERR_IGNORE_ALL) {
throw new UnsupportedOperationException
diff --git a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
index 2e42d1d9fb..1b7eed1c65 100644
index 2e42d1d9fb0..1b7eed1c656 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
@@ -49,6 +49,7 @@ package sun.security.pkcs11.wrapper;
@ -1440,7 +1493,7 @@ index 2e42d1d9fb..1b7eed1c65 100644
+}
}
diff --git a/jdk/src/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java b/jdk/src/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java
index ffee2c1603..9811947982 100644
index ffee2c1603b..98119479823 100644
--- a/jdk/src/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java
+++ b/jdk/src/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java
@@ -33,8 +33,13 @@ import java.security.KeyStore.*;
@ -1479,7 +1532,7 @@ index ffee2c1603..9811947982 100644
"FIPS mode: KeyStore must be " +
"from provider " + SunJSSE.cryptoProvider.getName());
diff --git a/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java
index 820e10164f..6fe2c29389 100644
index 820e10164fc..6fe2c29389f 100644
--- a/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java
+++ b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java
@@ -31,6 +31,7 @@ import java.security.*;
@ -1577,7 +1630,7 @@ index 820e10164f..6fe2c29389 100644
ProtocolVersion.TLS13,
ProtocolVersion.TLS12,
diff --git a/jdk/src/share/classes/sun/security/ssl/SunJSSE.java b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java
index 2845dc3793..52337a7b6c 100644
index 2845dc37938..52337a7b6cf 100644
--- a/jdk/src/share/classes/sun/security/ssl/SunJSSE.java
+++ b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java
@@ -30,6 +30,8 @@ import static sun.security.util.SecurityConstants.PROVIDER_VER;
@ -1606,7 +1659,7 @@ index 2845dc3793..52337a7b6c 100644
"sun.security.ssl.SSLContextImpl$TLSContext");
if (isfips == false) {
diff --git a/jdk/src/share/lib/security/java.security-aix b/jdk/src/share/lib/security/java.security-aix
index 37bca2df46..730212b601 100644
index 7a93d4e6b59..681a24b905d 100644
--- a/jdk/src/share/lib/security/java.security-aix
+++ b/jdk/src/share/lib/security/java.security-aix
@@ -287,6 +287,13 @@ package.definition=sun.,\
@ -1624,7 +1677,7 @@ index 37bca2df46..730212b601 100644
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux
index 9bb8e992fb..a1b3943b11 100644
index 145a84f94cf..789c19a8cba 100644
--- a/jdk/src/share/lib/security/java.security-linux
+++ b/jdk/src/share/lib/security/java.security-linux
@@ -75,6 +75,14 @@ security.provider.7=com.sun.security.sasl.Provider
@ -1669,7 +1722,7 @@ index 9bb8e992fb..a1b3943b11 100644
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx
index 7a765742e6..5abd95fff8 100644
index 35fa140d7a5..d4da666af3b 100644
--- a/jdk/src/share/lib/security/java.security-macosx
+++ b/jdk/src/share/lib/security/java.security-macosx
@@ -290,6 +290,13 @@ package.definition=sun.,\
@ -1687,7 +1740,7 @@ index 7a765742e6..5abd95fff8 100644
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris
index f0100336f5..2f4c6c2fd6 100644
index f79ba37ddb9..300132384a1 100644
--- a/jdk/src/share/lib/security/java.security-solaris
+++ b/jdk/src/share/lib/security/java.security-solaris
@@ -288,6 +288,13 @@ package.definition=sun.,\
@ -1705,7 +1758,7 @@ index f0100336f5..2f4c6c2fd6 100644
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows
index e51bdece13..b4a509753b 100644
index d70503ce95f..64db5a5cd1e 100644
--- a/jdk/src/share/lib/security/java.security-windows
+++ b/jdk/src/share/lib/security/java.security-windows
@@ -290,6 +290,13 @@ package.definition=sun.,\
@ -1724,7 +1777,7 @@ index e51bdece13..b4a509753b 100644
# the javax.net.ssl package.
diff --git a/jdk/src/solaris/native/java/security/systemconf.c b/jdk/src/solaris/native/java/security/systemconf.c
new file mode 100644
index 0000000000..8dcb7d9073
index 00000000000..8dcb7d9073f
--- /dev/null
+++ b/jdk/src/solaris/native/java/security/systemconf.c
@@ -0,0 +1,224 @@

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
#!/bin/sh
ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib
JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg
GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib
PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng
LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms
echo "Removing built-in libs (they will be linked)"
echo "Removing zlib"
if [ ! -d ${ZIP_SRC} ]; then
echo "${ZIP_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${ZIP_SRC}
echo "Removing libjpeg"
if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist
echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed."
exit 1
fi
rm -vf ${JPEG_SRC}/jcomapi.c
rm -vf ${JPEG_SRC}/jdapimin.c
rm -vf ${JPEG_SRC}/jdapistd.c
rm -vf ${JPEG_SRC}/jdcoefct.c
rm -vf ${JPEG_SRC}/jdcolor.c
rm -vf ${JPEG_SRC}/jdct.h
rm -vf ${JPEG_SRC}/jddctmgr.c
rm -vf ${JPEG_SRC}/jdhuff.c
rm -vf ${JPEG_SRC}/jdhuff.h
rm -vf ${JPEG_SRC}/jdinput.c
rm -vf ${JPEG_SRC}/jdmainct.c
rm -vf ${JPEG_SRC}/jdmarker.c
rm -vf ${JPEG_SRC}/jdmaster.c
rm -vf ${JPEG_SRC}/jdmerge.c
rm -vf ${JPEG_SRC}/jdphuff.c
rm -vf ${JPEG_SRC}/jdpostct.c
rm -vf ${JPEG_SRC}/jdsample.c
rm -vf ${JPEG_SRC}/jerror.c
rm -vf ${JPEG_SRC}/jerror.h
rm -vf ${JPEG_SRC}/jidctflt.c
rm -vf ${JPEG_SRC}/jidctfst.c
rm -vf ${JPEG_SRC}/jidctint.c
rm -vf ${JPEG_SRC}/jidctred.c
rm -vf ${JPEG_SRC}/jinclude.h
rm -vf ${JPEG_SRC}/jmemmgr.c
rm -vf ${JPEG_SRC}/jmemsys.h
rm -vf ${JPEG_SRC}/jmemnobs.c
rm -vf ${JPEG_SRC}/jmorecfg.h
rm -vf ${JPEG_SRC}/jpegint.h
rm -vf ${JPEG_SRC}/jpeglib.h
rm -vf ${JPEG_SRC}/jquant1.c
rm -vf ${JPEG_SRC}/jquant2.c
rm -vf ${JPEG_SRC}/jutils.c
rm -vf ${JPEG_SRC}/jcapimin.c
rm -vf ${JPEG_SRC}/jcapistd.c
rm -vf ${JPEG_SRC}/jccoefct.c
rm -vf ${JPEG_SRC}/jccolor.c
rm -vf ${JPEG_SRC}/jcdctmgr.c
rm -vf ${JPEG_SRC}/jchuff.c
rm -vf ${JPEG_SRC}/jchuff.h
rm -vf ${JPEG_SRC}/jcinit.c
rm -vf ${JPEG_SRC}/jconfig.h
rm -vf ${JPEG_SRC}/jcmainct.c
rm -vf ${JPEG_SRC}/jcmarker.c
rm -vf ${JPEG_SRC}/jcmaster.c
rm -vf ${JPEG_SRC}/jcparam.c
rm -vf ${JPEG_SRC}/jcphuff.c
rm -vf ${JPEG_SRC}/jcprepct.c
rm -vf ${JPEG_SRC}/jcsample.c
rm -vf ${JPEG_SRC}/jctrans.c
rm -vf ${JPEG_SRC}/jdtrans.c
rm -vf ${JPEG_SRC}/jfdctflt.c
rm -vf ${JPEG_SRC}/jfdctfst.c
rm -vf ${JPEG_SRC}/jfdctint.c
rm -vf ${JPEG_SRC}/jversion.h
rm -vf ${JPEG_SRC}/README
echo "Removing giflib"
if [ ! -d ${GIF_SRC} ]; then
echo "${GIF_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${GIF_SRC}
echo "Removing libpng"
if [ ! -d ${PNG_SRC} ]; then
echo "${PNG_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${PNG_SRC}
echo "Removing lcms"
if [ ! -d ${LCMS_SRC} ]; then
echo "${LCMS_SRC} does not exist. Refusing to proceed."
exit 1
fi
# temporary change to move bundled LCMS
if [ ! true ]; then
rm -vf ${LCMS_SRC}/cmsalpha.c
rm -vf ${LCMS_SRC}/cmscam02.c
rm -vf ${LCMS_SRC}/cmscgats.c
rm -vf ${LCMS_SRC}/cmscnvrt.c
rm -vf ${LCMS_SRC}/cmserr.c
rm -vf ${LCMS_SRC}/cmsgamma.c
rm -vf ${LCMS_SRC}/cmsgmt.c
rm -vf ${LCMS_SRC}/cmshalf.c
rm -vf ${LCMS_SRC}/cmsintrp.c
rm -vf ${LCMS_SRC}/cmsio0.c
rm -vf ${LCMS_SRC}/cmsio1.c
rm -vf ${LCMS_SRC}/cmslut.c
rm -vf ${LCMS_SRC}/cmsmd5.c
rm -vf ${LCMS_SRC}/cmsmtrx.c
rm -vf ${LCMS_SRC}/cmsnamed.c
rm -vf ${LCMS_SRC}/cmsopt.c
rm -vf ${LCMS_SRC}/cmspack.c
rm -vf ${LCMS_SRC}/cmspcs.c
rm -vf ${LCMS_SRC}/cmsplugin.c
rm -vf ${LCMS_SRC}/cmsps2.c
rm -vf ${LCMS_SRC}/cmssamp.c
rm -vf ${LCMS_SRC}/cmssm.c
rm -vf ${LCMS_SRC}/cmstypes.c
rm -vf ${LCMS_SRC}/cmsvirt.c
rm -vf ${LCMS_SRC}/cmswtpnt.c
rm -vf ${LCMS_SRC}/cmsxform.c
rm -vf ${LCMS_SRC}/lcms2.h
rm -vf ${LCMS_SRC}/lcms2_internal.h
rm -vf ${LCMS_SRC}/lcms2_plugin.h
fi

View File

@ -1,51 +0,0 @@
commit 928f3bf4a3017931ecc7012688e62d8a03264e61
Author: Andrew Hughes <gnu.andrew@redhat.com>
AuthorDate: Thu Jan 16 17:40:36 2025 +0000
Commit: Andrew Hughes <gnu.andrew@redhat.com>
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 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=1737049912
+DATE_WHEN_GENERATED=1737067804
###############################################################################
#
@@ -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
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
else
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..6ab6dbc075 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -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
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
else
AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
fi

View File

@ -1,763 +0,0 @@
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index ad3f7f232e..587b4c2657 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -649,6 +649,9 @@ LLVM_LIBS
LLVM_LDFLAGS
LLVM_CFLAGS
LLVM_CONFIG
+LIBFFI_LIB_FILE
+LIBFFI_LIB_DIR
+ENABLE_LIBFFI_BUNDLING
LIBFFI_LIBS
LIBFFI_CFLAGS
STATIC_CXX_SETTING
@@ -1117,6 +1120,10 @@ with_fontconfig_include
with_giflib
with_zlib
with_stdc__lib
+with_libffi
+with_libffi_include
+with_libffi_lib
+enable_libffi_bundling
with_msvcr_dll
with_msvcp_dll
with_vcruntime_1_dll
@@ -1867,6 +1874,9 @@ Optional Features:
disable bundling of the freetype library with the
build result [enabled on Windows or when using
--with-freetype, disabled otherwise]
+ --enable-libffi-bundling
+ enable bundling of libffi.so to make the built JDK
+ runnable on more systems
--enable-sjavac use sjavac to do fast incremental compiles
[disabled]
--disable-precompiled-headers
@@ -1996,6 +2006,11 @@ Optional Packages:
force linking of the C++ runtime on Linux to either
static or dynamic, default is static with dynamic as
fallback
+ --with-libffi specify prefix directory for the libffi package
+ (expecting the libraries under PATH/lib and the
+ headers under PATH/include)
+ --with-libffi-include specify directory for the libffi include files
+ --with-libffi-lib specify directory for the libffi library
--with-msvcr-dll path to microsoft C runtime dll (msvcr*.dll)
(Windows only) [probed]
--with-msvcp-dll path to microsoft C++ runtime dll (msvcp*.dll)
@@ -2878,6 +2893,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -4432,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=1716396030
+DATE_WHEN_GENERATED=1737049912
###############################################################################
#
@@ -50215,8 +50276,70 @@ $as_echo "static" >&6; }
fi
+
+# Check whether --with-libffi was given.
+if test "${with_libffi+set}" = set; then :
+ withval=$with_libffi;
+fi
+
+
+# Check whether --with-libffi-include was given.
+if test "${with_libffi_include+set}" = set; then :
+ withval=$with_libffi_include;
+fi
+
+
+# Check whether --with-libffi-lib was given.
+if test "${with_libffi_lib+set}" = set; then :
+ withval=$with_libffi_lib;
+fi
+
+ # Check whether --enable-libffi-bundling was given.
+if test "${enable_libffi_bundling+set}" = set; then :
+ enableval=$enable_libffi_bundling;
+fi
+
+
+ # Check if ffi is needed
if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
- # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
+ NEEDS_LIB_FFI=true
+ else
+ NEEDS_LIB_FFI=false
+ fi
+
+ if test "x$NEEDS_LIB_FFI" = xfalse; then
+ if test "x${with_libffi}" != x || test "x${with_libffi_include}" != x || test "x${with_libffi_lib}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libffi not used, so --with-libffi is ignored" >&5
+$as_echo "$as_me: WARNING: libffi not used, so --with-libffi is ignored" >&2;}
+ fi
+ LIBFFI_CFLAGS=
+ LIBFFI_LIBS=
+ else
+ LIBFFI_FOUND=no
+
+ if test "x${with_libffi}" = xno || test "x${with_libffi_include}" = xno || test "x${with_libffi_lib}" = xno; then
+ as_fn_error $? "It is not possible to disable the use of libffi. Remove the --without-libffi option." "$LINENO" 5
+ fi
+
+ if test "x${with_libffi}" != x; then
+ LIBFFI_LIB_PATH="${with_libffi}/lib"
+ LIBFFI_LIBS="-L${with_libffi}/lib -lffi"
+ LIBFFI_CFLAGS="-I${with_libffi}/include"
+ LIBFFI_FOUND=yes
+ fi
+ if test "x${with_libffi_include}" != x; then
+ LIBFFI_CFLAGS="-I${with_libffi_include}"
+ LIBFFI_FOUND=yes
+ fi
+ if test "x${with_libffi_lib}" != x; then
+ LIBFFI_LIB_PATH="${with_libffi_lib}"
+ LIBFFI_LIBS="-L${with_libffi_lib} -lffi"
+ LIBFFI_FOUND=yes
+ fi
+ # Do not try pkg-config if we have a sysroot set.
+ if test "x$SYSROOT" = x; then
+ if test "x$LIBFFI_FOUND" = xno; then
+ # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBFFI" >&5
@@ -50272,40 +50395,224 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$LIBFFI_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (libffi) were not met:
-
-$LIBFFI_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables LIBFFI_CFLAGS
-and LIBFFI_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ LIBFFI_FOUND=no
elif test $pkg_failed = untried; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables LIBFFI_CFLAGS
-and LIBFFI_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+ LIBFFI_FOUND=no
else
LIBFFI_CFLAGS=$pkg_cv_LIBFFI_CFLAGS
LIBFFI_LIBS=$pkg_cv_LIBFFI_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- :
+ LIBFFI_FOUND=yes
+fi
+ fi
+ fi
+ if test "x$LIBFFI_FOUND" = xno; then
+ for ac_header in ffi.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "ffi.h" "ac_cv_header_ffi_h" "$ac_includes_default"
+if test "x$ac_cv_header_ffi_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FFI_H 1
+_ACEOF
+
+ LIBFFI_FOUND=yes
+ LIBFFI_CFLAGS=
+ LIBFFI_LIBS=-lffi
+
+else
+ LIBFFI_FOUND=no
+
+fi
+
+done
+
+ fi
+ if test "x$LIBFFI_FOUND" = xno; then
+
+ # Print a helpful message on how to acquire the necessary build dependency.
+ # ffi is the help tag: freetype, cups, pulse, alsa etc
+ MISSING_DEPENDENCY=ffi
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ cygwin_help $MISSING_DEPENDENCY
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ msys_help $MISSING_DEPENDENCY
+ else
+ PKGHANDLER_COMMAND=
+
+ case $PKGHANDLER in
+ apt-get)
+ apt_help $MISSING_DEPENDENCY ;;
+ yum)
+ yum_help $MISSING_DEPENDENCY ;;
+ port)
+ port_help $MISSING_DEPENDENCY ;;
+ pkgutil)
+ pkgutil_help $MISSING_DEPENDENCY ;;
+ pkgadd)
+ pkgadd_help $MISSING_DEPENDENCY ;;
+ esac
+
+ if test "x$PKGHANDLER_COMMAND" != x; then
+ HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+ fi
+ fi
+
+ as_fn_error $? "Could not find libffi! $HELP_MSG" "$LINENO" 5
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libffi works" >&5
+$as_echo_n "checking if libffi works... " >&6; }
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LIBFFI_CFLAGS"
+ OLD_LIBS="$LIBS"
+ LIBS="$LIBS $LIBFFI_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ffi.h>
+int
+main (void)
+{
+
+ ffi_call(NULL, NULL, NULL, NULL);
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIBFFI_WORKS=yes
+else
+ LIBFFI_WORKS=no
+
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$OLD_CFLAGS"
+ LIBS="$OLD_LIBS"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBFFI_WORKS" >&5
+$as_echo "$LIBFFI_WORKS" >&6; }
+ if test "x$LIBFFI_WORKS" = xno; then
+
+ # Print a helpful message on how to acquire the necessary build dependency.
+ # ffi is the help tag: freetype, cups, pulse, alsa etc
+ MISSING_DEPENDENCY=ffi
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ cygwin_help $MISSING_DEPENDENCY
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ msys_help $MISSING_DEPENDENCY
+ else
+ PKGHANDLER_COMMAND=
+
+ case $PKGHANDLER in
+ apt-get)
+ apt_help $MISSING_DEPENDENCY ;;
+ yum)
+ yum_help $MISSING_DEPENDENCY ;;
+ port)
+ port_help $MISSING_DEPENDENCY ;;
+ pkgutil)
+ pkgutil_help $MISSING_DEPENDENCY ;;
+ pkgadd)
+ pkgadd_help $MISSING_DEPENDENCY ;;
+ esac
+
+ if test "x$PKGHANDLER_COMMAND" != x; then
+ HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+ fi
fi
+ as_fn_error $? "Found libffi but could not link and compile with it. $HELP_MSG" "$LINENO" 5
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libffi should be bundled" >&5
+$as_echo_n "checking if libffi should be bundled... " >&6; }
+ if test "x$enable_libffi_bundling" = "x"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ENABLE_LIBFFI_BUNDLING=false
+ elif test "x$enable_libffi_bundling" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+ ENABLE_LIBFFI_BUNDLING=false
+ elif test "x$enable_libffi_bundling" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+ ENABLE_LIBFFI_BUNDLING=true
+ else
+ as_fn_error $? "Invalid value for --enable-libffi-bundling" "$LINENO" 5
+ fi
+
+ # Find the libffi.so.X to bundle
+ if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libffi lib file location" >&5
+$as_echo_n "checking for libffi lib file location... " >&6; }
+ if test "x${LIBFFI_LIB_PATH}" != x; then
+ if test -e ${LIBFFI_LIB_PATH}/libffi.so.?; then
+ LIBFFI_LIB_FILE="${LIBFFI_LIB_PATH}/libffi.so.?"
+ else
+ as_fn_error $? "Could not locate libffi.so.? for bundling in ${LIBFFI_LIB_PATH}" "$LINENO" 5
+ fi
+ else
+ # If we don't have an explicit path, look in a few obvious places
+ if test "x${OPENJDK_TARGET_CPU}" = "xx86"; then
+ if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
+ elif test -e ${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.?"
+ else
+ as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
+ fi
+ elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then
+ if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
+ elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.?"
+ else
+ as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
+ fi
+ else
+ # Fallback on the default /usr/lib dir
+ if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
+ else
+ as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
+ fi
+ fi
+ fi
+ # Make sure the wildcard is evaluated
+ LIBFFI_LIB_FILE="$(ls ${LIBFFI_LIB_FILE})"
+ LIBFFI_LIB_DIR="$(dirname ${LIBFFI_LIB_FILE})"
+ LIBFFI_LIB_FILE="$(basename ${LIBFFI_LIB_FILE})"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LIBFFI_LIB_FILE} in ${LIBFFI_LIB_DIR}" >&5
+$as_echo "${LIBFFI_LIB_FILE} in ${LIBFFI_LIB_DIR}" >&6; }
+ fi
+ fi
+
+
+
+
+
+
+
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
# Extract the first word of "llvm-config", so it can be a program name with args.
set dummy llvm-config; ac_word=$2
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index 6efae578ea..4ed8b4fdd6 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -988,12 +988,161 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
fi
AC_SUBST(STATIC_CXX_SETTING)
+ AC_ARG_WITH(libffi, [AS_HELP_STRING([--with-libffi],
+ [specify prefix directory for the libffi package
+ (expecting the libraries under PATH/lib and the headers under PATH/include)])])
+ AC_ARG_WITH(libffi-include, [AS_HELP_STRING([--with-libffi-include],
+ [specify directory for the libffi include files])])
+ AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib],
+ [specify directory for the libffi library])])
+ AC_ARG_ENABLE(libffi-bundling, [AS_HELP_STRING([--enable-libffi-bundling],
+ [enable bundling of libffi.so to make the built JDK runnable on more systems])])
+
+ # Check if ffi is needed
if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
- # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
- PKG_CHECK_MODULES([LIBFFI], [libffi])
+ NEEDS_LIB_FFI=true
+ else
+ NEEDS_LIB_FFI=false
+ fi
+
+ if test "x$NEEDS_LIB_FFI" = xfalse; then
+ if test "x${with_libffi}" != x || test "x${with_libffi_include}" != x || test "x${with_libffi_lib}" != x; then
+ AC_MSG_WARN([libffi not used, so --with-libffi is ignored])
+ fi
+ LIBFFI_CFLAGS=
+ LIBFFI_LIBS=
+ else
+ LIBFFI_FOUND=no
+ if test "x${with_libffi}" = xno || test "x${with_libffi_include}" = xno || test "x${with_libffi_lib}" = xno; then
+ AC_MSG_ERROR([It is not possible to disable the use of libffi. Remove the --without-libffi option.])
+ fi
+
+ if test "x${with_libffi}" != x; then
+ LIBFFI_LIB_PATH="${with_libffi}/lib"
+ LIBFFI_LIBS="-L${with_libffi}/lib -lffi"
+ LIBFFI_CFLAGS="-I${with_libffi}/include"
+ LIBFFI_FOUND=yes
+ fi
+ if test "x${with_libffi_include}" != x; then
+ LIBFFI_CFLAGS="-I${with_libffi_include}"
+ LIBFFI_FOUND=yes
+ fi
+ if test "x${with_libffi_lib}" != x; then
+ LIBFFI_LIB_PATH="${with_libffi_lib}"
+ LIBFFI_LIBS="-L${with_libffi_lib} -lffi"
+ LIBFFI_FOUND=yes
+ fi
+ # Do not try pkg-config if we have a sysroot set.
+ if test "x$SYSROOT" = x; then
+ if test "x$LIBFFI_FOUND" = xno; then
+ # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
+ PKG_CHECK_MODULES([LIBFFI], [libffi], [LIBFFI_FOUND=yes], [LIBFFI_FOUND=no])
+ fi
+ fi
+ if test "x$LIBFFI_FOUND" = xno; then
+ AC_CHECK_HEADERS([ffi.h],
+ [
+ LIBFFI_FOUND=yes
+ LIBFFI_CFLAGS=
+ LIBFFI_LIBS=-lffi
+ ],
+ [LIBFFI_FOUND=no]
+ )
+ fi
+ if test "x$LIBFFI_FOUND" = xno; then
+ HELP_MSG_MISSING_DEPENDENCY([ffi])
+ AC_MSG_ERROR([Could not find libffi! $HELP_MSG])
+ fi
+
+ AC_MSG_CHECKING([if libffi works])
+ AC_LANG_PUSH(C)
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LIBFFI_CFLAGS"
+ OLD_LIBS="$LIBS"
+ LIBS="$LIBS $LIBFFI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ffi.h>],
+ [
+ ffi_call(NULL, NULL, NULL, NULL);
+ return 0;
+ ])],
+ [LIBFFI_WORKS=yes],
+ [LIBFFI_WORKS=no]
+ )
+ CFLAGS="$OLD_CFLAGS"
+ LIBS="$OLD_LIBS"
+ AC_LANG_POP(C)
+ AC_MSG_RESULT([$LIBFFI_WORKS])
+
+ if test "x$LIBFFI_WORKS" = xno; then
+ HELP_MSG_MISSING_DEPENDENCY([ffi])
+ AC_MSG_ERROR([Found libffi but could not link and compile with it. $HELP_MSG])
+ fi
+
+ AC_MSG_CHECKING([if libffi should be bundled])
+ if test "x$enable_libffi_bundling" = "x"; then
+ AC_MSG_RESULT([no])
+ ENABLE_LIBFFI_BUNDLING=false
+ elif test "x$enable_libffi_bundling" = "xno"; then
+ AC_MSG_RESULT([no, forced])
+ ENABLE_LIBFFI_BUNDLING=false
+ elif test "x$enable_libffi_bundling" = "xyes"; then
+ AC_MSG_RESULT([yes, forced])
+ ENABLE_LIBFFI_BUNDLING=true
+ else
+ AC_MSG_ERROR([Invalid value for --enable-libffi-bundling])
+ fi
+
+ # Find the libffi.so.X to bundle
+ if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then
+ AC_MSG_CHECKING([for libffi lib file location])
+ if test "x${LIBFFI_LIB_PATH}" != x; then
+ if test -e ${LIBFFI_LIB_PATH}/libffi.so.?; then
+ LIBFFI_LIB_FILE="${LIBFFI_LIB_PATH}/libffi.so.?"
+ else
+ AC_MSG_ERROR([Could not locate libffi.so.? for bundling in ${LIBFFI_LIB_PATH}])
+ fi
+ else
+ # If we don't have an explicit path, look in a few obvious places
+ if test "x${OPENJDK_TARGET_CPU}" = "xx86"; then
+ if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
+ elif test -e ${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.?"
+ else
+ AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
+ fi
+ elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then
+ if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
+ elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.?"
+ else
+ AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
+ fi
+ else
+ # Fallback on the default /usr/lib dir
+ if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
+ LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
+ else
+ AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
+ fi
+ fi
+ fi
+ # Make sure the wildcard is evaluated
+ LIBFFI_LIB_FILE="$(ls ${LIBFFI_LIB_FILE})"
+ LIBFFI_LIB_DIR="$(dirname ${LIBFFI_LIB_FILE})"
+ LIBFFI_LIB_FILE="$(basename ${LIBFFI_LIB_FILE})"
+ AC_MSG_RESULT([${LIBFFI_LIB_FILE} in ${LIBFFI_LIB_DIR}])
+ fi
fi
+ AC_SUBST(LIBFFI_CFLAGS)
+ AC_SUBST(LIBFFI_LIBS)
+ AC_SUBST(ENABLE_LIBFFI_BUNDLING)
+ AC_SUBST(LIBFFI_LIB_DIR)
+ AC_SUBST(LIBFFI_LIB_FILE)
+
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config])
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 9573bb2cbd..8da3ac32a0 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -311,6 +311,11 @@ FONTCONFIG_CFLAGS:=@FONTCONFIG_CFLAGS@
CUPS_CFLAGS:=@CUPS_CFLAGS@
ALSA_LIBS:=@ALSA_LIBS@
ALSA_CFLAGS:=@ALSA_CFLAGS@
+LIBFFI_LIBS:=@LIBFFI_LIBS@
+LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
+ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
+LIBFFI_LIB_DIR:=@LIBFFI_LIB_DIR@
+LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
PACKAGE_PATH=@PACKAGE_PATH@
diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile
index ad195763be..b9114cb99a 100644
--- a/hotspot/make/Makefile
+++ b/hotspot/make/Makefile
@@ -476,6 +476,8 @@ $(EXPORT_INCLUDE_DIR)/%: $(ZERO_BUILD_DIR)/../generated/jvmtifiles/%
# Unix
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
+$(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE): $(LIBFFI_LIB_DIR)/$(LIBFFI_LIB_FILE)
+ $(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
diff --git a/hotspot/make/aix/makefiles/defs.make b/hotspot/make/aix/makefiles/defs.make
index b12c9c8df2..db10f6a68f 100644
--- a/hotspot/make/aix/makefiles/defs.make
+++ b/hotspot/make/aix/makefiles/defs.make
@@ -220,4 +220,7 @@ ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
+ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE)
+endif
diff --git a/hotspot/make/bsd/makefiles/defs.make b/hotspot/make/bsd/makefiles/defs.make
index 7cd21cc175..23436f12d8 100644
--- a/hotspot/make/bsd/makefiles/defs.make
+++ b/hotspot/make/bsd/makefiles/defs.make
@@ -364,6 +364,10 @@ ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
+ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE)
+endif
+
# Universal build settings
ifeq ($(OS_VENDOR), Darwin)
# Build universal binaries by default on Mac OS X
diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make
index ec414639d2..0baa4f068d 100644
--- a/hotspot/make/linux/makefiles/defs.make
+++ b/hotspot/make/linux/makefiles/defs.make
@@ -333,4 +333,6 @@ ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
-
+ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE)
+endif
diff --git a/hotspot/make/solaris/makefiles/defs.make b/hotspot/make/solaris/makefiles/defs.make
index c88351c82b..cb838e854d 100644
--- a/hotspot/make/solaris/makefiles/defs.make
+++ b/hotspot/make/solaris/makefiles/defs.make
@@ -304,3 +304,7 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
endif
endif
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
+
+ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE)
+endif
diff --git a/hotspot/make/windows/makefiles/defs.make b/hotspot/make/windows/makefiles/defs.make
index 6b36f0e2bc..6f42c7ad37 100644
--- a/hotspot/make/windows/makefiles/defs.make
+++ b/hotspot/make/windows/makefiles/defs.make
@@ -300,6 +300,10 @@ ifeq ($(BUILD_WIN_SA), 1)
MAKE_ARGS += BUILD_WIN_SA=1
endif
+ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/$(LIBFFI_LIB_FILE)
+endif
+
# 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
+++ b/jdk/make/Import.gmk
@@ -114,7 +114,7 @@ endef
#
# Import hotspot
#
-HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
+HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.* ffi.*) \
Xusage.txt sa-jdi.jar
ifeq ($(OPENJDK_TARGET_OS), macosx)
diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk
index c2460105b7..cf2ef251ac 100644
--- a/make/devkit/Tools.gmk
+++ b/make/devkit/Tools.gmk
@@ -82,8 +82,8 @@ RPM_LIST := \
libXi libXi-devel \
libXdmcp libXdmcp-devel \
libXau libXau-devel \
- libgcc
-
+ libgcc \
+ libffi libffi-devel
ifeq ($(ARCH),x86_64)
RPM_DIR ?= $(RPM_DIR_x86_64)
@@ -203,6 +203,18 @@ $(libs) : $(rpms)
@mkdir -p $(SYSROOT)/usr/lib
@touch $@
+##########################################################################################
+# Create links for ffi header files so that they become visible by default when using the
+# devkit.
+
+$(SYSROOT)/usr/include/ffi.h: $(rpms)
+ cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
+
+$(SYSROOT)/usr/include/ffitarget.h: $(rpms)
+ cd $(@D) && rm $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
+
+SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h
+
##########################################################################################
# Define marker files for each source package to be compiled
@@ -479,7 +491,7 @@ rpms : $(rpms)
libs : $(libs)
sysroot : rpms libs
gcc : sysroot $(gcc) $(gccpatch)
-all : binutils gcc bfdlib $(PREFIX)/devkit.info
+all : binutils gcc bfdlib $(PREFIX)/devkit.info $(SYSROOT_LINKS)
# this is only built for host. so separate.
ccache : $(ccache)

View File

@ -7,11 +7,10 @@
PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations
Summary: Enable -mstackrealign on x86 Linux as well as x86 Mac OS X
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 113bf367e2..bed030e8d1 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -451,6 +451,21 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
diff --git openjdk.orig///common/autoconf/flags.m4 openjdk///common/autoconf/flags.m4
--- openjdk.orig///common/autoconf/flags.m4
+++ openjdk///common/autoconf/flags.m4
@@ -402,6 +402,21 @@
AC_SUBST($2CXXSTD_CXXFLAG)
fi
@ -23,7 +22,7 @@ index 113bf367e2..bed030e8d1 100644
+ # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
+ # While waiting for a better solution, the current workaround is to use -mstackrealign
+ # This is also required on Linux systems which use libraries compiled with SSE instructions
+ REALIGN_CFLAG="-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4"
+ REALIGN_CFLAG="-mstackrealign"
+ FLAGS_COMPILER_CHECK_ARGUMENTS([$REALIGN_CFLAG -Werror], [],
+ AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
+ )
@ -33,32 +32,23 @@ index 113bf367e2..bed030e8d1 100644
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
fi
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
index 3f86751d2b..f8a271383f 100644
--- a/common/autoconf/hotspot-spec.gmk.in
+++ b/common/autoconf/hotspot-spec.gmk.in
@@ -114,13 +114,14 @@ RC:=@HOTSPOT_RC@
# Retain EXTRA_{CFLAGS,CXXFLAGS,LDFLAGS,ASFLAGS} for the target flags to
# maintain compatibility with the existing Makefiles
EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
diff --git openjdk.orig///common/autoconf/hotspot-spec.gmk.in openjdk///common/autoconf/hotspot-spec.gmk.in
--- openjdk.orig///common/autoconf/hotspot-spec.gmk.in
+++ openjdk///common/autoconf/hotspot-spec.gmk.in
@@ -112,7 +112,8 @@
RC:=@HOTSPOT_RC@
EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) \
+ $(REALIGN_CFLAG)
EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@
EXTRA_LDFLAGS=@LEGACY_TARGET_LDFLAGS@
EXTRA_ASFLAGS=@LEGACY_TARGET_ASFLAGS@
# Define an equivalent set for the host flags (i.e. without sysroot options)
HOST_CFLAGS=@LEGACY_HOST_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
HOST_CXXFLAGS=@LEGACY_HOST_CXXFLAGS@
HOST_LDFLAGS=@LEGACY_HOST_LDFLAGS@
HOST_ASFLAGS=@LEGACY_HOST_ASFLAGS@
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 9573bb2cbd..fe7efc130c 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -366,6 +366,7 @@ CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
EXTRA_ASFLAGS=@LEGACY_EXTRA_ASFLAGS@
diff --git openjdk.orig///common/autoconf/spec.gmk.in openjdk///common/autoconf/spec.gmk.in
--- openjdk.orig///common/autoconf/spec.gmk.in
+++ openjdk///common/autoconf/spec.gmk.in
@@ -366,6 +366,7 @@
NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@
NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@

View File

@ -0,0 +1,12 @@
diff --git openjdk.orig/hotspot/src/os/linux/vm/perfMemory_linux.cpp openjdk/hotspot/src/os/linux/vm/perfMemory_linux.cpp
--- openjdk.orig/hotspot/src/os/linux/vm/perfMemory_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/perfMemory_linux.cpp
@@ -878,7 +878,7 @@
// open the file
int result;
- RESTARTABLE(::open(filename, oflags), result);
+ RESTARTABLE(::open(filename, oflags, 0), result);
if (result == OS_ERR) {
if (errno == ENOENT) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),

View File

@ -0,0 +1,167 @@
commit d41618f34f1d2f5416ec3c035f33dcb15cf5ab99
Author: Alexey Bakhtin <abakhtin@openjdk.org>
Date: Tue Apr 4 10:29:11 2023 +0000
8271199: Mutual TLS handshake fails signing client certificate with custom sensitive PKCS11 key
Reviewed-by: andrew, mbalao
Backport-of: f6232982b91cb2314e96ddbde3984836a810a556
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPSSSignature.java b/jdk/src/share/classes/sun/security/rsa/RSAPSSSignature.java
index a79e97d7c74..5378446b97b 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAPSSSignature.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAPSSSignature.java
@@ -127,12 +127,15 @@ public class RSAPSSSignature extends SignatureSpi {
@Override
protected void engineInitVerify(PublicKey publicKey)
throws InvalidKeyException {
- if (!(publicKey instanceof RSAPublicKey)) {
+ if (publicKey instanceof RSAPublicKey) {
+ RSAPublicKey rsaPubKey = (RSAPublicKey)publicKey;
+ isPublicKeyValid(rsaPubKey);
+ this.pubKey = rsaPubKey;
+ this.privKey = null;
+ resetDigest();
+ } else {
throw new InvalidKeyException("key must be RSAPublicKey");
}
- this.pubKey = (RSAPublicKey) isValid((RSAKey)publicKey);
- this.privKey = null;
- resetDigest();
}
// initialize for signing. See JCA doc
@@ -146,14 +149,17 @@ public class RSAPSSSignature extends SignatureSpi {
@Override
protected void engineInitSign(PrivateKey privateKey, SecureRandom random)
throws InvalidKeyException {
- if (!(privateKey instanceof RSAPrivateKey)) {
+ if (privateKey instanceof RSAPrivateKey) {
+ RSAPrivateKey rsaPrivateKey = (RSAPrivateKey)privateKey;
+ isPrivateKeyValid(rsaPrivateKey);
+ this.privKey = rsaPrivateKey;
+ this.pubKey = null;
+ this.random =
+ (random == null ? JCAUtil.getSecureRandom() : random);
+ resetDigest();
+ } else {
throw new InvalidKeyException("key must be RSAPrivateKey");
}
- this.privKey = (RSAPrivateKey) isValid((RSAKey)privateKey);
- this.pubKey = null;
- this.random =
- (random == null? JCAUtil.getSecureRandom() : random);
- resetDigest();
}
/**
@@ -205,11 +211,57 @@ public class RSAPSSSignature extends SignatureSpi {
}
}
+ /**
+ * Validate the specified RSAPrivateKey
+ */
+ private void isPrivateKeyValid(RSAPrivateKey prKey) throws InvalidKeyException {
+ try {
+ if (prKey instanceof RSAPrivateCrtKey) {
+ RSAPrivateCrtKey crtKey = (RSAPrivateCrtKey)prKey;
+ if (RSAPrivateCrtKeyImpl.checkComponents(crtKey)) {
+ RSAKeyFactory.checkRSAProviderKeyLengths(
+ crtKey.getModulus().bitLength(),
+ crtKey.getPublicExponent());
+ } else {
+ throw new InvalidKeyException(
+ "Some of the CRT-specific components are not available");
+ }
+ } else {
+ RSAKeyFactory.checkRSAProviderKeyLengths(
+ prKey.getModulus().bitLength(),
+ null);
+ }
+ } catch (InvalidKeyException ikEx) {
+ throw ikEx;
+ } catch (Exception e) {
+ throw new InvalidKeyException(
+ "Can not access private key components", e);
+ }
+ isValid(prKey);
+ }
+
+ /**
+ * Validate the specified RSAPublicKey
+ */
+ private void isPublicKeyValid(RSAPublicKey pKey) throws InvalidKeyException {
+ try {
+ RSAKeyFactory.checkRSAProviderKeyLengths(
+ pKey.getModulus().bitLength(),
+ pKey.getPublicExponent());
+ } catch (InvalidKeyException ikEx) {
+ throw ikEx;
+ } catch (Exception e) {
+ throw new InvalidKeyException(
+ "Can not access public key components", e);
+ }
+ isValid(pKey);
+ }
+
/**
* Validate the specified RSAKey and its associated parameters against
* internal signature parameters.
*/
- private RSAKey isValid(RSAKey rsaKey) throws InvalidKeyException {
+ private void isValid(RSAKey rsaKey) throws InvalidKeyException {
try {
AlgorithmParameterSpec keyParams = rsaKey.getParams();
// validate key parameters
@@ -227,7 +279,6 @@ public class RSAPSSSignature extends SignatureSpi {
}
checkKeyLength(rsaKey, hLen, this.sigParams.getSaltLength());
}
- return rsaKey;
} catch (SignatureException e) {
throw new InvalidKeyException(e);
}
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
index 6b219937981..b3c1fae9672 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
@@ -80,22 +80,28 @@ public final class RSAPrivateCrtKeyImpl
RSAPrivateCrtKeyImpl key = new RSAPrivateCrtKeyImpl(encoded);
// check all CRT-specific components are available, if any one
// missing, return a non-CRT key instead
- if ((key.getPublicExponent().signum() == 0) ||
- (key.getPrimeExponentP().signum() == 0) ||
- (key.getPrimeExponentQ().signum() == 0) ||
- (key.getPrimeP().signum() == 0) ||
- (key.getPrimeQ().signum() == 0) ||
- (key.getCrtCoefficient().signum() == 0)) {
+ if (checkComponents(key)) {
+ return key;
+ } else {
return new RSAPrivateKeyImpl(
key.algid,
key.getModulus(),
- key.getPrivateExponent()
- );
- } else {
- return key;
+ key.getPrivateExponent());
}
}
+ /**
+ * Validate if all CRT-specific components are available.
+ */
+ static boolean checkComponents(RSAPrivateCrtKey key) {
+ return !((key.getPublicExponent().signum() == 0) ||
+ (key.getPrimeExponentP().signum() == 0) ||
+ (key.getPrimeExponentQ().signum() == 0) ||
+ (key.getPrimeP().signum() == 0) ||
+ (key.getPrimeQ().signum() == 0) ||
+ (key.getCrtCoefficient().signum() == 0));
+ }
+
/**
* Generate a new key from the specified type and components.
* Returns a CRT key if possible and a non-CRT key otherwise.

View File

@ -0,0 +1,67 @@
# HG changeset patch
# User Andrew John Hughes <gnu_andrew@member.fsf.org>
# Date 1620365804 -3600
# Fri May 07 06:36:44 2021 +0100
# Node ID 39b62f35eca823b4c9a98bc1dc0cb9acb87360f8
# Parent 723b59ed1afe878c5cd35f080399c8ceec4f776b
PR3836: Extra compiler flags not passed to adlc build
diff --git openjdk.orig/hotspot/make/aix/makefiles/adlc.make openjdk/hotspot/make/aix/makefiles/adlc.make
--- openjdk.orig/hotspot/make/aix/makefiles/adlc.make
+++ openjdk/hotspot/make/aix/makefiles/adlc.make
@@ -69,6 +69,11 @@
CFLAGS_WARN = -w
CFLAGS += $(CFLAGS_WARN)
+# Extra flags from gnumake's invocation or environment
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
+ASFLAGS += $(EXTRA_ASFLAGS)
+
OBJECTNAMES = \
adlparse.o \
archDesc.o \
diff --git openjdk.orig/hotspot/make/bsd/makefiles/adlc.make openjdk/hotspot/make/bsd/makefiles/adlc.make
--- openjdk.orig/hotspot/make/bsd/makefiles/adlc.make
+++ openjdk/hotspot/make/bsd/makefiles/adlc.make
@@ -71,6 +71,11 @@
endif
CFLAGS += $(CFLAGS_WARN)
+# Extra flags from gnumake's invocation or environment
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
+ASFLAGS += $(EXTRA_ASFLAGS)
+
OBJECTNAMES = \
adlparse.o \
archDesc.o \
diff --git openjdk.orig/hotspot/make/linux/makefiles/adlc.make openjdk/hotspot/make/linux/makefiles/adlc.make
--- openjdk.orig/hotspot/make/linux/makefiles/adlc.make
+++ openjdk/hotspot/make/linux/makefiles/adlc.make
@@ -69,6 +69,11 @@
CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
CFLAGS += $(CFLAGS_WARN)
+# Extra flags from gnumake's invocation or environment
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
+ASFLAGS += $(EXTRA_ASFLAGS)
+
OBJECTNAMES = \
adlparse.o \
archDesc.o \
diff --git openjdk.orig/hotspot/make/solaris/makefiles/adlc.make openjdk/hotspot/make/solaris/makefiles/adlc.make
--- openjdk.orig/hotspot/make/solaris/makefiles/adlc.make
+++ openjdk/hotspot/make/solaris/makefiles/adlc.make
@@ -85,6 +85,10 @@
endif
CFLAGS += $(CFLAGS_WARN)
+# Extra flags from gnumake's invocation or environment
+CFLAGS += $(EXTRA_CFLAGS)
+ASFLAGS += $(EXTRA_ASFLAGS)
+
ifeq ("${Platform_compiler}", "sparcWorks")
# Enable the following CFLAGS addition if you need to compare the
# built ELF objects.

File diff suppressed because it is too large Load Diff

View File

@ -7,11 +7,10 @@
8074839: Resolve disabled warnings for libunpack and the unpack200 binary
Reviewed-by: dholmes, ksrini
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
index bdaf95a2f6a..60c5b4f2a69 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
@@ -63,7 +63,7 @@ struct bytes {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
@@ -63,7 +63,7 @@
bytes res;
res.ptr = ptr + beg;
res.len = end - beg;
@ -20,11 +19,10 @@ index bdaf95a2f6a..60c5b4f2a69 100644
return res;
}
// building C strings inside byte buffers:
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
index 5fbc7261fb3..4c002e779d8 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
@@ -292,7 +292,7 @@ Java_com_sun_java_util_jar_pack_NativeUnpack_getUnusedInput(JNIEnv *env, jobject
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
@@ -292,7 +292,7 @@
if (uPtr->aborting()) {
THROW_IOE(uPtr->get_abort_message());
@ -33,16 +31,16 @@ index 5fbc7261fb3..4c002e779d8 100644
}
// We have fetched all the files.
@@ -312,7 +312,7 @@ Java_com_sun_java_util_jar_pack_NativeUnpack_finish(JNIEnv *env, jobject pObj) {
// There's no need to create a new unpacker here if we don't already have one
// just to immediatly free it afterwards.
unpacker* uPtr = get_unpacker(env, pObj, /* noCreate= */ true);
@@ -310,7 +310,7 @@
JNIEXPORT jlong JNICALL
Java_com_sun_java_util_jar_pack_NativeUnpack_finish(JNIEnv *env, jobject pObj) {
unpacker* uPtr = get_unpacker(env, pObj, false);
- CHECK_EXCEPTION_RETURN_VALUE(uPtr, NULL);
+ CHECK_EXCEPTION_RETURN_VALUE(uPtr, 0);
size_t consumed = uPtr->input_consumed();
// free_unpacker() will set the unpacker field on 'pObj' to null
free_unpacker(env, pObj, uPtr);
@@ -323,6 +323,7 @@ JNIEXPORT jboolean JNICALL
return consumed;
@@ -320,6 +320,7 @@
Java_com_sun_java_util_jar_pack_NativeUnpack_setOption(JNIEnv *env, jobject pObj,
jstring pProp, jstring pValue) {
unpacker* uPtr = get_unpacker(env, pObj);
@ -50,11 +48,10 @@ index 5fbc7261fb3..4c002e779d8 100644
const char* prop = env->GetStringUTFChars(pProp, JNI_FALSE);
CHECK_EXCEPTION_RETURN_VALUE(prop, false);
const char* value = env->GetStringUTFChars(pValue, JNI_FALSE);
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
index 6fbc43a18ae..722c8baaff0 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
@@ -142,31 +142,28 @@ static const char* nbasename(const char* progname) {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
@@ -142,31 +142,28 @@
return progname;
}
@ -104,11 +101,10 @@ index 6fbc43a18ae..722c8baaff0 100644
}
}
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
index a585535c513..8df3fade499 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
@@ -225,9 +225,9 @@ struct entry {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
@@ -222,9 +222,9 @@
}
#ifdef PRODUCT
@ -120,7 +116,7 @@ index a585535c513..8df3fade499 100644
#endif
};
@@ -719,13 +719,13 @@ void unpacker::read_file_header() {
@@ -715,13 +715,13 @@
// Now we can size the whole archive.
// Read everything else into a mega-buffer.
rp = hdr.rp;
@ -138,7 +134,7 @@ index a585535c513..8df3fade499 100644
abort("EOF reading fixed input buffer");
return;
}
@@ -739,7 +739,7 @@ void unpacker::read_file_header() {
@@ -735,7 +735,7 @@
return;
}
input.set(U_NEW(byte, add_size(header_size_0, archive_size, C_SLOP)),
@ -147,7 +143,7 @@ index a585535c513..8df3fade499 100644
CHECK;
assert(input.limit()[0] == 0);
// Move all the bytes we read initially into the real buffer.
@@ -962,13 +962,13 @@ void cpool::init(unpacker* u_, int counts[CONSTANT_Limit]) {
@@ -958,13 +958,13 @@
nentries = next_entry;
// place a limit on future CP growth:
@ -163,7 +159,18 @@ index a585535c513..8df3fade499 100644
// Note that this CP does not include "empty" entries
// for longs and doubles. Those are introduced when
@@ -3694,21 +3694,22 @@ void cpool::computeOutputIndexes() {
@@ -982,8 +982,9 @@
}
// Initialize *all* our entries once
- for (int i = 0 ; i < maxentries ; i++)
+ for (uint i = 0 ; i < maxentries ; i++) {
entries[i].outputIndex = REQUESTED_NONE;
+ }
initGroupIndexes();
// Initialize hashTab to a generous power-of-two size.
@@ -3677,21 +3678,22 @@
unpacker* debug_u;
@ -190,7 +197,7 @@ index a585535c513..8df3fade499 100644
case CONSTANT_Signature:
if (value.b.ptr == null)
return ref(0)->string();
@@ -3728,26 +3729,28 @@ char* entry::string() {
@@ -3711,26 +3713,28 @@
break;
default:
if (nrefs == 0) {
@ -228,11 +235,10 @@ index a585535c513..8df3fade499 100644
}
void print_cp_entries(int beg, int end) {
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
index 4ec595333c4..aad0c971ef2 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
@@ -209,7 +209,7 @@ struct unpacker {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
@@ -209,7 +209,7 @@
byte* rp; // read pointer (< rplimit <= input.limit())
byte* rplimit; // how much of the input block has been read?
julong bytes_read;
@ -241,11 +247,10 @@ index 4ec595333c4..aad0c971ef2 100644
// callback to read at least one byte, up to available input
typedef jlong (*read_input_fn_t)(unpacker* self, void* buf, jlong minlen, jlong maxlen);
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
index da39a589545..1281d8b25c8 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
@@ -81,7 +81,7 @@ void breakpoint() { } // hook for debugger
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
@@ -81,7 +81,7 @@
int assert_failed(const char* p) {
char message[1<<12];
sprintf(message, "@assert failed: %s\n", p);
@ -254,11 +259,10 @@ index da39a589545..1281d8b25c8 100644
breakpoint();
unpack_abort(message);
return 0;
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
index f58c94956c0..343da3e183b 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
@@ -84,7 +84,7 @@ void jar::init(unpacker* u_) {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
@@ -84,7 +84,7 @@
}
// Write data to the ZIP output stream.
@ -267,7 +271,7 @@ index f58c94956c0..343da3e183b 100644
while (len > 0) {
int rc = (int)fwrite(buff, 1, len, jarfp);
if (rc <= 0) {
@@ -323,12 +323,12 @@ void jar::write_central_directory() {
@@ -323,12 +323,12 @@
// Total number of disks (int)
header64[36] = (ushort)SWAP_BYTES(1);
header64[37] = 0;
@ -282,11 +286,10 @@ index f58c94956c0..343da3e183b 100644
PRINTCR((2, "writing zip comment\n"));
// Write the comment.
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
index 14ffc9d65bd..9877f6f68ca 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
@@ -68,8 +68,8 @@ struct jar {
diff --git openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
--- openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
@@ -68,8 +68,8 @@
}
// Private Methods

View File

@ -16,7 +16,7 @@ diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/shenan
Atomic::add(val, &_sum);
- int mag = log2_intptr(val) + 1;
+ int mag = log2_long(val) + 1;
+ int mag = log2_intptr((uintptr_t)val) + 1;
// Defensively saturate for product bits:
if (mag < 0) {

File diff suppressed because it is too large Load Diff