From b76b7fe13579265bef2a881d60788dda17b5c89c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 10:53:55 +0000 Subject: import java-11-openjdk-11.0.3.7-1.el7 --- diff --git a/.gitignore b/.gitignore index 27854a0..313df63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.4+11.tar.xz +SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.3+7.tar.xz SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz diff --git a/.java-11-openjdk.metadata b/.java-11-openjdk.metadata index c8ec3c7..3aeb008 100644 --- a/.java-11-openjdk.metadata +++ b/.java-11-openjdk.metadata @@ -1,2 +1,2 @@ -dcc5e78329858f75342094efdccce1e87d9cb1d9 SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.4+11.tar.xz +f1e75a992a0dc64caf418414a93fed8f99fb4e18 SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.3+7.tar.xz cd8bf91753b9eb1401cfc529e78517105fc66011 SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz diff --git a/SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch b/SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch new file mode 100644 index 0000000..2a88e7f --- /dev/null +++ b/SOURCES/jdk8009550-rh910107-search_for_versioned_libpcsclite.patch @@ -0,0 +1,51 @@ +# 8009550, RH910107: PlatformPCSC should load versioned so +# Author: Andrew Hughes +# Copyright 2019 Red Hat, Inc. + +diff --git openjdk.orig///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java openjdk///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java +--- openjdk.orig/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java ++++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java +@@ -48,9 +48,13 @@ + + private final static String PROP_NAME = "sun.security.smartcardio.library"; + +- private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so"; +- private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; +- private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; ++ private final static String[] SYSTEM_LIBS = { ++ "/usr/$LIBISA/libpcsclite.so", ++ "/usr/local/$LIBISA/libpcsclite.so", ++ "/usr/$LIBISA/libpcsclite.so.1", ++ "/usr/local/$LIBISA/libpcsclite.so.1", ++ "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC" ++ }; + + PlatformPCSC() { + // empty +@@ -104,20 +108,12 @@ + if (lib.length() != 0) { + return lib; + } +- lib = expand(LIB1); +- if (new File(lib).isFile()) { +- // if LIB1 exists, use that +- return lib; +- } +- lib = expand(LIB2); +- if (new File(lib).isFile()) { +- // if LIB2 exists, use that +- return lib; +- } +- lib = PCSC_FRAMEWORK; +- if (new File(lib).isFile()) { +- // if PCSC.framework exists, use that +- return lib; ++ for (String sysLib : SYSTEM_LIBS) { ++ lib = expand(sysLib); ++ if (new File(lib).isFile()) { ++ // if sysLib exists, use that ++ return lib; ++ } + } + throw new IOException("No PC/SC library found on this system"); + } diff --git a/SOURCES/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch b/SOURCES/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch deleted file mode 100644 index 999d74e..0000000 --- a/SOURCES/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch +++ /dev/null @@ -1,434 +0,0 @@ -diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 ---- a/make/autoconf/jdk-options.m4 -+++ b/make/autoconf/jdk-options.m4 -@@ -267,9 +267,10 @@ - # - AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], - [ -+ AC_REQUIRE([LIB_SETUP_MISC_LIBS]) - AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) - -- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then -+ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then - ENABLE_INTREE_EC=true - AC_MSG_RESULT([yes]) - else -diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 ---- a/make/autoconf/libraries.m4 -+++ b/make/autoconf/libraries.m4 -@@ -178,6 +178,48 @@ - AC_SUBST(LIBDL) - LIBS="$save_LIBS" - -+ ############################################################################### -+ # -+ # Check for the NSS libraries -+ # -+ -+ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries]) -+ -+ # default is bundled -+ DEFAULT_SYSTEM_NSS=no -+ -+ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss], -+ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])], -+ [ -+ case "${enableval}" in -+ yes) -+ system_nss=yes -+ ;; -+ *) -+ system_nss=no -+ ;; -+ esac -+ ], -+ [ -+ system_nss=${DEFAULT_SYSTEM_NSS} -+ ]) -+ AC_MSG_RESULT([$system_nss]) -+ -+ if test "x${system_nss}" = "xyes"; then -+ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no]) -+ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no]) -+ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then -+ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl"; -+ USE_EXTERNAL_NSS=true -+ else -+ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.]) -+ fi -+ else -+ USE_EXTERNAL_NSS=false -+ fi -+ AC_SUBST(USE_EXTERNAL_NSS) -+ -+ - # Deprecated libraries, keep the flags for backwards compatibility - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - BASIC_DEPRECATED_ARG_WITH([dxsdk]) -diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in ---- a/make/autoconf/spec.gmk.in -+++ b/make/autoconf/spec.gmk.in -@@ -795,6 +795,10 @@ - # Libraries - # - -+USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@ -+NSS_LIBS:=@NSS_LIBS@ -+NSS_CFLAGS:=@NSS_CFLAGS@ -+ - USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@ - LCMS_CFLAGS:=@LCMS_CFLAGS@ - LCMS_LIBS:=@LCMS_LIBS@ -diff --git a/make/lib/Lib-jdk.crypto.ec.gmk b/make/lib/Lib-jdk.crypto.ec.gmk ---- a/make/lib/Lib-jdk.crypto.ec.gmk -+++ b/make/lib/Lib-jdk.crypto.ec.gmk -@@ -38,6 +38,11 @@ - BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(CXXFLAGS_JDKLIB) - endif - -+ ifeq ($(USE_EXTERNAL_NSS), true) -+ BUILD_LIBSUNEC_CFLAGS_JDKLIB += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC -+ BUILD_LIBSUNEC_CXXFLAGS_JDKLIB += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC -+ endif -+ - $(eval $(call SetupJdkLibrary, BUILD_LIBSUNEC, \ - NAME := sunec, \ - TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ -@@ -47,9 +52,11 @@ - CXXFLAGS := $(BUILD_LIBSUNEC_CXXFLAGS_JDKLIB), \ - DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \ - DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ -- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ -+ LDFLAGS := $(subst -Xlinker --as-needed,, \ -+ $(subst -Wl$(COMMA)--as-needed,, $(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK), \ - LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ - LIBS := $(LIBCXX), \ -+ LIBS_linux := -lc $(NSS_LIBS), \ - )) - - TARGETS += $(BUILD_LIBSUNEC) -diff --git a/src/java.base/unix/native/include/jni_md.h b/src/java.base/unix/native/include/jni_md.h ---- a/src/java.base/unix/native/include/jni_md.h -+++ b/src/java.base/unix/native/include/jni_md.h -@@ -41,6 +41,11 @@ - #define JNIEXPORT - #define JNIIMPORT - #endif -+#if (defined(__GNUC__)) || __has_attribute(unused) -+ #define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) -+#else -+ #define UNUSED(x) UNUSED_ ## x -+#endif - - #define JNICALL - -diff --git a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java ---- a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -+++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -@@ -61,6 +61,7 @@ - AccessController.doPrivileged(new PrivilegedAction() { - public Void run() { - System.loadLibrary("sunec"); // check for native library -+ initialize(); - return null; - } - }); -@@ -293,6 +294,11 @@ - "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS)); - } - -+ /** -+ * Initialize the native code. -+ */ -+ private static native void initialize(); -+ - private void putXDHEntries() { - - HashMap ATTRS = new HashMap<>(1); -diff --git a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp ---- a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp -+++ b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp -@@ -25,7 +25,11 @@ - - #include - #include "jni_util.h" -+#ifdef SYSTEM_NSS -+#include "ecc_impl.h" -+#else - #include "impl/ecc_impl.h" -+#endif - #include "sun_security_ec_ECDHKeyAgreement.h" - #include "sun_security_ec_ECKeyPairGenerator.h" - #include "sun_security_ec_ECDSASignature.h" -@@ -33,6 +37,13 @@ - #define INVALID_PARAMETER_EXCEPTION \ - "java/security/InvalidParameterException" - #define KEY_EXCEPTION "java/security/KeyException" -+#define INTERNAL_ERROR "java/lang/InternalError" -+ -+#ifdef SYSTEM_NSS -+#define SYSTEM_UNUSED(x) UNUSED(x) -+#else -+#define SYSTEM_UNUSED(x) x -+#endif - - extern "C" { - -@@ -55,8 +66,13 @@ - /* - * Deep free of the ECParams struct - */ --void FreeECParams(ECParams *ecparams, jboolean freeStruct) -+void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct)) - { -+#ifdef SYSTEM_NSS -+ // Needs to be freed using the matching method to the one -+ // that allocated it. PR_TRUE means the memory is zeroed. -+ PORT_FreeArena(ecparams->arena, PR_TRUE); -+#else - // Use B_FALSE to free the SECItem->data element, but not the SECItem itself - // Use B_TRUE to free both - -@@ -70,6 +86,7 @@ - SECITEM_FreeItem(&ecparams->curveOID, B_FALSE); - if (freeStruct) - free(ecparams); -+#endif - } - - jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem) -@@ -139,7 +156,7 @@ - */ - JNIEXPORT jobjectArray - JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair -- (JNIEnv *env, jclass clazz, jint keySize, jbyteArray encodedParams, jbyteArray seed) -+ (JNIEnv *env, jclass UNUSED(clazz), jint UNUSED(keySize), jbyteArray encodedParams, jbyteArray seed) - { - ECPrivateKey *privKey = NULL; // contains both public and private values - ECParams *ecparams = NULL; -@@ -171,8 +188,17 @@ - env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer); - - // Generate the new keypair (using the supplied seed) -+#ifdef SYSTEM_NSS -+ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength) -+ != SECSuccess) { -+ ThrowException(env, KEY_EXCEPTION); -+ goto cleanup; -+ } -+ if (EC_NewKey(ecparams, &privKey) != SECSuccess) { -+#else - if (EC_NewKey(ecparams, &privKey, (unsigned char *) pSeedBuffer, - jSeedLength, 0) != SECSuccess) { -+#endif - ThrowException(env, KEY_EXCEPTION); - goto cleanup; - } -@@ -219,10 +245,15 @@ - } - if (privKey) { - FreeECParams(&privKey->ecParams, false); -+#ifndef SYSTEM_NSS -+ // The entire ECPrivateKey is allocated in the arena -+ // when using system NSS, so only the in-tree version -+ // needs to clear these manually. - SECITEM_FreeItem(&privKey->version, B_FALSE); - SECITEM_FreeItem(&privKey->privateValue, B_FALSE); - SECITEM_FreeItem(&privKey->publicValue, B_FALSE); - free(privKey); -+#endif - } - - if (pSeedBuffer) { -@@ -240,7 +271,7 @@ - */ - JNIEXPORT jbyteArray - JNICALL Java_sun_security_ec_ECDSASignature_signDigest -- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) -+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) - { - jbyte* pDigestBuffer = NULL; - jint jDigestLength = env->GetArrayLength(digest); -@@ -299,8 +330,18 @@ - env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer); - - // Sign the digest (using the supplied seed) -+#ifdef SYSTEM_NSS -+ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength) -+ != SECSuccess) { -+ ThrowException(env, KEY_EXCEPTION); -+ goto cleanup; -+ } -+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item) -+ != SECSuccess) { -+#else - if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item, - (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) { -+#endif - ThrowException(env, KEY_EXCEPTION); - goto cleanup; - } -@@ -349,7 +390,7 @@ - */ - JNIEXPORT jboolean - JNICALL Java_sun_security_ec_ECDSASignature_verifySignedDigest -- (JNIEnv *env, jclass clazz, jbyteArray signedDigest, jbyteArray digest, jbyteArray publicKey, jbyteArray encodedParams) -+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray signedDigest, jbyteArray digest, jbyteArray publicKey, jbyteArray encodedParams) - { - jboolean isValid = false; - -@@ -406,9 +447,10 @@ - - cleanup: - { -- if (params_item.data) -+ if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+ } - - if (pubKey.publicValue.data) - env->ReleaseByteArrayElements(publicKey, -@@ -434,7 +476,7 @@ - */ - JNIEXPORT jbyteArray - JNICALL Java_sun_security_ec_ECDHKeyAgreement_deriveKey -- (JNIEnv *env, jclass clazz, jbyteArray privateKey, jbyteArray publicKey, jbyteArray encodedParams) -+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray privateKey, jbyteArray publicKey, jbyteArray encodedParams) - { - jbyteArray jSecret = NULL; - ECParams *ecparams = NULL; -@@ -510,9 +552,10 @@ - env->ReleaseByteArrayElements(publicKey, - (jbyte *) publicValue_item.data, JNI_ABORT); - -- if (params_item.data) -+ if (params_item.data) { - env->ReleaseByteArrayElements(encodedParams, - (jbyte *) params_item.data, JNI_ABORT); -+ } - - if (ecparams) - FreeECParams(ecparams, true); -@@ -521,4 +564,28 @@ - return jSecret; - } - -+JNIEXPORT void -+JNICALL Java_sun_security_ec_SunEC_initialize -+ (JNIEnv *env, jclass UNUSED(clazz)) -+{ -+#ifdef SYSTEM_NSS -+ if (SECOID_Init() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+ if (RNG_RNGInit() != SECSuccess) { -+ ThrowException(env, INTERNAL_ERROR); -+ } -+#endif -+} -+ -+JNIEXPORT void -+JNICALL JNI_OnUnload -+ (JavaVM *vm, void *reserved) -+{ -+#ifdef SYSTEM_NSS -+ RNG_RNGShutdown(); -+ SECOID_Shutdown(); -+#endif -+} -+ - } /* extern "C" */ ---- a/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h 2019-01-11 00:01:25.000000000 -0500 -+++ b/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h 2019-01-14 03:52:54.145695946 -0500 -@@ -45,7 +45,19 @@ - #endif - - #include -+ -+#ifdef SYSTEM_NSS -+#include -+#include -+#include -+#ifdef LEGACY_NSS -+#include -+#else -+#include -+#endif -+#else - #include "ecl-exp.h" -+#endif - - /* - * Multi-platform definitions -@@ -96,6 +108,7 @@ - * Various structures and definitions from NSS are here. - */ - -+#ifndef SYSTEM_NSS - #ifdef _KERNEL - #define PORT_ArenaAlloc(a, n, f) kmem_alloc((n), (f)) - #define PORT_ArenaZAlloc(a, n, f) kmem_zalloc((n), (f)) -@@ -130,9 +143,12 @@ - #define PORT_Memcpy(t, f, l) memcpy((t), (f), (l)) - #endif - -+#endif -+ - #define CHECK_OK(func) if (func == NULL) goto cleanup - #define CHECK_SEC_OK(func) if (SECSuccess != (rv = func)) goto cleanup - -+#ifndef SYSTEM_NSS - typedef enum { - siBuffer = 0, - siClearDataBuffer = 1, -@@ -229,6 +245,7 @@ - SECFailure = -1, - SECSuccess = 0 - } SECStatus; -+#endif - - #ifdef _KERNEL - #define RNG_GenerateGlobalRandomBytes(p,l) ecc_knzero_random_generator((p), (l)) -@@ -237,8 +254,10 @@ - This function is no longer required because the random bytes are now - supplied by the caller. Force a failure. - */ -+#ifndef SYSTEM_NSS - #define RNG_GenerateGlobalRandomBytes(p,l) SECFailure - #endif -+#endif - #define CHECK_MPI_OK(func) if (MP_OKAY > (err = func)) goto cleanup - #define MP_TO_SEC_ERROR(err) - -@@ -248,11 +267,18 @@ - extern int ecc_knzero_random_generator(uint8_t *, size_t); - extern ulong_t soft_nzero_random_generator(uint8_t *, ulong_t); - -+#ifdef SYSTEM_NSS -+#define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) -+#define ECDSA_VerifyDigest(a,b,c,d) ECDSA_VerifyDigest(a,b,c) -+#define ECDH_Derive(a,b,c,d,e,f) ECDH_Derive(a,b,c,d,e) -+#else - extern SECStatus EC_DecodeParams(const SECItem *, ECParams **, int); -+ - extern SECItem * SECITEM_AllocItem(PRArenaPool *, SECItem *, unsigned int, int); - extern SECStatus SECITEM_CopyItem(PRArenaPool *, SECItem *, const SECItem *, - int); - extern void SECITEM_FreeItem(SECItem *, boolean_t); -+ - /* This function has been modified to accept an array of random bytes */ - extern SECStatus EC_NewKey(ECParams *ecParams, ECPrivateKey **privKey, - const unsigned char* random, int randomlen, int); -@@ -263,9 +289,10 @@ - const SECItem *, int); - extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, - SECItem *, int); -+#endif - - #ifdef __cplusplus - } - #endif - --#endif /* _ECC_IMPL_H */ -+#endif /* _ECC_IMPL_H */ diff --git a/SOURCES/remove-intree-libraries.sh b/SOURCES/remove-intree-libraries.sh index 0e87b0c..044ea88 100644 --- a/SOURCES/remove-intree-libraries.sh +++ b/SOURCES/remove-intree-libraries.sh @@ -131,10 +131,4 @@ rm -vf ${LCMS_SRC}/lcms2_internal.h rm -vf ${LCMS_SRC}/lcms2_plugin.h fi -# Get rid of in-tree SunEC until RH1656676 is implemented -echo "Removing SunEC native code" -mv -v src/jdk.crypto.ec/share/native/libsunec/impl/ecc_impl.h . -rm -vrf src/jdk.crypto.ec/share/native/libsunec/impl -mv -v ecc_impl.h src/jdk.crypto.ec/share/native/libsunec - diff --git a/SPECS/java-11-openjdk.spec b/SPECS/java-11-openjdk.spec index f8236f1..9ef689f 100644 --- a/SPECS/java-11-openjdk.spec +++ b/SPECS/java-11-openjdk.spec @@ -21,6 +21,11 @@ # Enable release builds by default on relevant arches. %bcond_without release +# The -g flag says to use strip -g instead of full strip on DSOs or EXEs. +# This fixes detailed NMT and other tools which need minimal debug info. +# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879 +%global _find_debuginfo_opts -g + # note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros # also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch # see the difference between global and define: @@ -85,7 +90,6 @@ %endif # if you disable both builds, then the build fails -# Note that the debug build requires the normal build for docs %global build_loop %{build_loop1} %{build_loop2} # note: that order: normal_suffix debug_suffix, in case of both enabled # is expected in one single case at the end of the build @@ -98,12 +102,10 @@ %endif %if %{bootstrap_build} -%global release_targets bootcycle-images docs-zip +%global targets bootcycle-images all docs %else -%global release_targets images docs-zip +%global targets all docs %endif -# No docs nor bootcycle for debug builds -%global debug_targets images # Filter out flags from the optflags macro that cause problems with the OpenJDK build @@ -120,15 +122,6 @@ # looks like openjdk RPM specific bug # Always set this so the nss.cfg file is not broken %global NSS_LIBDIR %(pkg-config --variable=libdir nss) -%global NSS_LIBS %(pkg-config --libs nss) -%global NSS_CFLAGS %(pkg-config --cflags nss-softokn) -# see https://bugzilla.redhat.com/show_bug.cgi?id=1332456 -%global NSSSOFTOKN_BUILDTIME_NUMBER %(pkg-config --modversion nss-softokn || : ) -%global NSS_BUILDTIME_NUMBER %(pkg-config --modversion nss || : ) -# this is workaround for processing of requires during srpm creation -%global NSSSOFTOKN_BUILDTIME_VERSION %(if [ "x%{NSSSOFTOKN_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSSSOFTOKN_BUILDTIME_NUMBER}" ;fi) -%global NSS_BUILDTIME_VERSION %(if [ "x%{NSS_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSS_BUILDTIME_NUMBER}" ;fi) - # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 %global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsunec[.]so.*|libunpack[.]so.*|libzip[.]so.* @@ -192,8 +185,8 @@ # New Version-String scheme-style defines %global majorver 11 -%global securityver 4 -# buildjdkver is usually same as %%{majorver}, +%global securityver 3 +# buildjdkver is usually same as %{majorver}, # but in time of bootstrap of next jdk, it is majorver-1, # and this it is better to change it here, on single place %global buildjdkver %{majorver} @@ -214,8 +207,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global minorver 0 -%global buildver 11 -%global rpmrelease 0 +%global buildver 7 #%%global tagsuffix %{nil} # priority must be 7 digits in total # setting to 1, so debug ones can have 0 @@ -224,23 +216,6 @@ %global javaver %{majorver} -# Define milestone (EA for pre-releases, GA for releases) -# Release will be (where N is usually a number starting at 1): -# - 0.N%%{?extraver}%%{?dist} for EA releases, -# - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 -%if %{is_ga} -%global ea_designator "" -%global ea_designator_zip "" -%global extraver %{nil} -%global eaprefix %{nil} -%else -%global ea_designator ea -%global ea_designator_zip -%{ea_designator} -%global extraver .%{ea_designator} -%global eaprefix 0. -%endif - # parametrized macros are order-sensitive %global compatiblename java-%{majorver}-%{origin} %global fullversion %{compatiblename}-%{version}-%{release} @@ -543,7 +518,6 @@ exit 0 %{_jvmdir}/%{sdkdir %%1}/lib/classlist %endif %{_jvmdir}/%{sdkdir %%1}/lib/jexec -%{_jvmdir}/%{sdkdir %%1}/lib/jspawnhelper %{_jvmdir}/%{sdkdir %%1}/lib/jrt-fs.jar %{_jvmdir}/%{sdkdir %%1}/lib/modules %{_jvmdir}/%{sdkdir %%1}/lib/psfont.properties.ja @@ -757,16 +731,20 @@ Requires: ca-certificates Requires: javapackages-tools # Require zone-info data provided by tzdata-java sub-package Requires: tzdata-java >= 2015d +# for support of kernel stream control # libsctp.so.1 is being `dlopen`ed on demand Requires: lksctp-tools%{?_isa} -# there is a need to depend on the exact version of NSS -Requires: nss%{?_isa} %{NSS_BUILDTIME_VERSION} -Requires: nss-softokn%{?_isa} %{NSSSOFTOKN_BUILDTIME_VERSION} +# For smartcard support +# libpcsclite.so & libpcsclite.so.1 are both tried for dlopen +# and this package provides the latter (see RH910107) +Requires: pcsc-lite-libs%{?_isa} # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it, # not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be # considered as regression Requires: copy-jdk-configs >= 3.3 OrderWithRequires: copy-jdk-configs +# for printing support +Requires: cups-libs%{?_isa} # Post requires alternatives to install tool alternatives Requires(post): %{_sbindir}/alternatives # in version 1.7 and higher for --family switch @@ -775,9 +753,8 @@ Requires(post): chkconfig >= 1.7 Requires(postun): %{_sbindir}/alternatives # in version 1.7 and higher for --family switch Requires(postun): chkconfig >= 1.7 -# for optional support of kernel stream control, card reader and printing bindings -#Suggests: lksctp-tools%{?_isa}, pcsc-lite-devel%{?_isa}, cups -# rhel7 do not have week depndencies + +# rhel7 do not have weak depndencies # Standard JPackage base provides #Provides: jre-headless%1 = %{epoch}:%{javaver} @@ -872,7 +849,7 @@ Provides: java-%{javaver}-%{origin}-src%1 = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist} +Release: 1%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -946,8 +923,6 @@ Patch525: rh1022017-reduce_ssl_curves.patch Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch # Follow system wide crypto policy RHBZ#1249083 Patch4: pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch -# System NSS via SunEC Provider -Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch ############################################# # @@ -963,6 +938,8 @@ Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_th # RH1566890: CVE-2018-3639 Patch6: rh1566890-CVE_2018_3639-speculative_store_bypass.patch +# JDK-8009550, RH910107: Search for libpcsclite.so.1 if libpcsclite.so fails +Patch7: jdk8009550-rh910107-search_for_versioned_libpcsclite.patch # S390 ambiguous log2_intptr call Patch8: s390-8214206_fix.patch @@ -985,13 +962,6 @@ BuildRequires: freetype-devel BuildRequires: giflib-devel BuildRequires: gcc-c++ BuildRequires: gdb -%ifarch %{arm} -BuildRequires: devtoolset-7-build -BuildRequires: devtoolset-7-binutils -BuildRequires: devtoolset-7-gcc -BuildRequires: devtoolset-7-gcc-c++ -BuildRequires: devtoolset-7-gdb -%endif BuildRequires: gtk2-devel # LCMS on rhel7 is older then LCMS in intree JDK BuildRequires: lcms2-devel @@ -1009,7 +979,7 @@ BuildRequires: pkgconfig BuildRequires: xorg-x11-proto-devel BuildRequires: zip BuildRequires: javapackages-tools -BuildRequires: java-11-openjdk-devel +BuildRequires: java-%{buildjdkver}-openjdk-devel # Zero-assembler build requirement %ifnarch %{jit_arches} BuildRequires: libffi-devel @@ -1017,8 +987,6 @@ BuildRequires: libffi-devel BuildRequires: tzdata-java >= 2015d # Earlier versions have a bug in tree vectorization on PPC BuildRequires: gcc >= 4.8.3-8 -# Build requirements for SunEC system NSS support -BuildRequires: nss-softokn-freebl-devel >= 3.16.1 %if %{with_systemtap} BuildRequires: systemtap-sdt-devel @@ -1172,14 +1140,14 @@ The %{origin_nice} %{majorver} API documentation. %if %{include_normal_build} %package javadoc-zip -Summary: %{origin_nice} %{majorver} API documentation compressed in a single archive +Summary: %{origin_nice} %{majorver} API documentation compressed in single archive Group: Documentation Requires: javapackages-tools %{java_javadoc_rpo %{nil}} %description javadoc-zip -The %{origin_nice} %{majorver} API documentation compressed in a single archive. +The %{origin_nice} %{majorver} API documentation compressed in single archive. %endif %if %{include_debug_build} @@ -1196,16 +1164,17 @@ The %{origin_nice} %{majorver} API documentation %{for_debug}. %if %{include_debug_build} %package javadoc-zip-debug -Summary: %{origin_nice} %{majorver} API documentation compressed in a single archive %{for_debug} +Summary: %{origin_nice} %{majorver} API documentation compressed in single archive %{for_debug} Group: Documentation Requires: javapackages-tools %{java_javadoc_rpo -- %{debug_suffix_unquoted}} %description javadoc-zip-debug -The %{origin_nice} %{majorver} API documentation compressed in a single archive %{for_debug}. +The %{origin_nice} %{majorver} API documentation compressed in single archive %{for_debug}. %endif + %prep if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then echo "include_normal_build is %{include_normal_build}" @@ -1223,10 +1192,6 @@ 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 -if [ %{include_normal_build} -eq 0 ] ; then - echo "You have disabled the normal build, but this is required to provide docs for the debug build." - exit 14 -fi %setup -q -c -n %{uniquesuffix ""} -T -a 0 # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` @@ -1244,8 +1209,8 @@ pushd %{top_level_dir_name} %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 %patch6 -p1 +%patch7 -p1 %patch8 -p1 %patch525 -p1 popd # openjdk @@ -1298,10 +1263,6 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg %build -%ifarch %{arm} -%{?enable_devtoolset7:%{enable_devtoolset7}} -%endif - # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} @@ -1355,14 +1316,13 @@ bash ../configure \ --with-jobs=1 \ %endif --with-version-build=%{buildver} \ - --with-version-pre="%{ea_designator}" \ + --with-version-pre="" \ --with-version-opt=%{lts_designator} \ --with-vendor-version-string="%{vendor_version_string}" \ - --with-boot-jdk=/usr/lib/jvm/java-11-openjdk \ + --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \ --with-debug-level=$debugbuild \ --with-native-debug-symbols=internal \ --enable-unlimited-crypto \ - --enable-system-nss \ --with-zlib=system \ --with-libjpeg=system \ --with-giflib=system \ @@ -1379,18 +1339,14 @@ bash ../configure \ %endif --disable-warnings-as-errors -# Debug builds don't need same targets as release for -# build speed-up -maketargets="%{release_targets}" -if echo $debugbuild | grep -q "debug" ; then - maketargets="%{debug_targets}" -fi make \ JAVAC_FLAGS=-g \ LOG=trace \ WARNINGS_ARE_ERRORS="-Wno-error" \ CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ - $maketargets || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false ) + %{targets} || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false ) + +make docs-zip # the build (erroneously) removes read permissions from some jars # this is a regression in OpenJDK 7 (our compiler): @@ -1424,7 +1380,7 @@ for suffix in %{rev_build_loop} ; do export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{jdkimage} -#check Shenandoah is enabled +#check sheandoah is enabled %if %{use_shenandoah_hotspot} $JAVA_HOME//bin/java -XX:+UseShenandoahGC -version %endif @@ -1581,10 +1537,9 @@ popd # Install Javadoc documentation -# Always take docs from normal build to avoid building them twice install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} -cp -a %{buildoutputdir $normal_suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix} -cp -a %{buildoutputdir $normal_suffix}/bundles/jdk-%{newjavaver}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip +cp -a %{buildoutputdir $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix} +cp -a %{buildoutputdir $suffix}/bundles/jdk-%{newjavaver}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix}.zip # Install icons and menu entries for s in 16 24 32 48 ; do @@ -1732,7 +1687,6 @@ require "copy_jdk_configs.lua" %postun javadoc-zip-debug %{postun_javadoc_zip -- %{debug_suffix_unquoted}} - %endif %if %{include_normal_build} @@ -1798,107 +1752,55 @@ require "copy_jdk_configs.lua" %files javadoc-zip-debug %{files_javadoc_zip -- %{debug_suffix_unquoted}} - %endif -%changelog -* Tue Jul 23 2019 Johnny Hughes -- Manual CentOS Debranding - -* Tue Jul 09 2019 Andrew Hughes - 1:11.0.4.11-0 -- Update to shenandoah-jdk-11.0.4+11 (GA) -- Switch to GA mode for final release. -- Resolves: rhbz#1724452 - -* Mon Jul 08 2019 Andrew Hughes - 1:11.0.4.10-0.0.ea -- Update to shenandoah-jdk-11.0.4+10 (EA) -- Resolves: rhbz#1724452 - -* Mon Jul 08 2019 Andrew Hughes - 1:11.0.4.9-0.0.ea -- Update to shenandoah-jdk-11.0.4+9 (EA) -- Resolves: rhbz#1724452 - -* Mon Jul 08 2019 Andrew Hughes - 1:11.0.4.8-0.0.ea -- Update to shenandoah-jdk-11.0.4+8 (EA) -- Resolves: rhbz#1724452 - -* Sun Jul 07 2019 Andrew Hughes - 1:11.0.4.7-0.0.ea -- Update to shenandoah-jdk-11.0.4+7 (EA) -- Resolves: rhbz#1724452 - -* Wed Jul 03 2019 Andrew Hughes - 1:11.0.4.6-0.0.ea -- Provide Javadoc debug subpackages for now, but populate them from the normal build. -- Resolves: rhbz#1724452 - -* Wed Jul 03 2019 Andrew Hughes - 1:11.0.4.6-0.0.ea -- Update to shenandoah-jdk-11.0.4+6 (EA) -- Resolves: rhbz#1724452 - -* Wed Jul 03 2019 Andrew Hughes - 1:11.0.4.5-0.0.ea -- Update to shenandoah-jdk-11.0.4+5 (EA) -- Resolves: rhbz#1724452 - -* Tue Jul 02 2019 Andrew Hughes - 1:11.0.4.4-0.0.ea -- Update to shenandoah-jdk-11.0.4+4 (EA) -- Resolves: rhbz#1724452 -* Mon Jul 01 2019 Andrew Hughes - 1:11.0.4.3-0.0.ea -- Update to shenandoah-jdk-11.0.4+3 (EA) -- Resolves: rhbz#1724452 - -* Sun Jun 30 2019 Andrew Hughes - 1:11.0.4.2-0.0.ea -- Use RHEL 7 format for jspawnhelper addition. -- Resolves: rhbz#1724452 - -* Sun Jun 30 2019 Andrew John Hughes - 1:11.0.4.2-0.0.ea -- Update to shenandoah-jdk-11.0.4+2 (EA) -- Resolves: rhbz#1724452 - -* Fri Jun 21 2019 Severin Gehwolf - 1:11.0.4.2-0.1.ea -- Package jspawnhelper (see JDK-8220360). -- Resolves: rhbz#1724452 - -* Fri Jun 21 2019 Severin Gehwolf - 1:11.0.3.7-2 -- Include 'ea' designator in Release when appropriate. -- Resolves: rhbz#1724452 - -* Wed May 22 2019 Andrew Hughes - 1:11.0.3.7-2 -- Handle milestone as variables so we can alter it easily and set the docs zip filename appropriately. -- Resolves: rhbz#1724452 - -* Thu Apr 25 2019 Severin Gehwolf - 1:11.0.3.7-1 -- Don't build the test images needlessly. -- Don't produce javadoc/javadoc-zip sub packages for the debug variant build. -- Don't perform a bootcycle build for the debug variant build. -- Resolves: rhbz#1724452 +%changelog +* Thu Apr 04 2019 Andrew Hughes - 1:11.0.3.7-1 +- Update to shenandoah-jdk-11.0.3+7 (April 2019 GA) +- Resolves: rhbz#1693468 -* Mon Apr 08 2019 Andrew Hughes - 1:11.0.3.7-0 +* Thu Apr 04 2019 Andrew Hughes - 1:11.0.3.6-1 - Add -mstackrealign workaround to build flags to avoid SSE issues on x86 -- Resolves: rhbz#1693468 +- Resolves: rhbz#1677516 -* Mon Apr 08 2019 Andrew Hughes - 1:11.0.3.7-0 -- Update to shenandoah-jdk-11.0.3+7 (April 2019 GA) -- Resolves: rhbz#1693468 +* Thu Apr 04 2019 Severin Gehwolf - 1:11.0.3.6-1 +- Fix macro which doesn't expand. +- Related: rhbz#1684617 + +* Thu Apr 04 2019 Andrew Hughes - 1:11.0.3.6-1 +- Add cast to resolve s390 ambiguity in call to log2_intptr +- Resolves: rhbz#1677516 -* Sat Apr 06 2019 Andrew Hughes - 1:11.0.3.6-0 +* Thu Apr 04 2019 Andrew Hughes - 1:11.0.3.6-1 - Update to shenandoah-jdk-11.0.3+6 (April 2019 EA) - Drop JDK-8210416/RH1632174 applied upstream. - Drop JDK-8210425/RH1632174 applied upstream. - Drop JDK-8210647/RH1632174 applied upstream. - Drop JDK-8210761/RH1632174 applied upstream. - Drop JDK-8210703/RH1632174 applied upstream. -- Add cast to resolve s390 ambiguity in call to log2_intptr -- Resolves: rhbz#1693468 +- Resolves: rhbz#1677516 -* Wed Apr 03 2019 Andrew Hughes - 1:11.0.2.7-1 +* Wed Apr 03 2019 Andrew Hughes - 1:11.0.2.7-4 +- Replace pcsc-lite-devel with pcsc-lite-libs so deps can be resolved without optional repository +- Add JDK-8009550/RH910107 patch so OpenJDK checks for libpcsclite.so.1 (in pcsc-lite-libs) +- Add missing ISA to cups-libs requirement +- Remove duplicate lksctp-tools requirement +- Resolves: rhbz#1684617 + +* Wed Apr 03 2019 Andrew Hughes - 1:11.0.2.7-4 - Disable gdb check on s390 as it sporadically fails with SIGFPE - Resolves: rhbz#1693468 -* Thu Mar 21 2019 Severin Gehwolf - 1:11.0.2.7-1 +* Tue Apr 02 2019 Andrew Hughes - 1:11.0.2.7-3 +- Drop NSS runtime dependencies and patches to link against it. +- Resolves: rhbz#1656677 + +* Thu Mar 21 2019 Severin Gehwolf - 1:11.0.2.7-2 - Add patch for RH1566890 - Resolves: rhbz#1693468 -* Tue Jan 15 2019 Andrew Hughes - 1:11.0.2.7-0 +* Tue Jan 15 2019 Andrew Hughes - 1:11.0.2.7-1 - Update to shenandoah-jdk-11.0.2+7 (January 2019 CPU) - Make tagsuffix optional and comment it out while unused. - Drop JDK-8211105/RH1628612/RH1630996 applied upstream. @@ -1906,15 +1808,30 @@ require "copy_jdk_configs.lua" - Re-generate JDK-8210416/RH1632174 following JDK-8209786 - Resolves: rhbz#1661577 -* Mon Jan 14 2019 Andrew Hughes - 1:11.0.1.13-4 +* Mon Jan 14 2019 Andrew Hughes - 1:11.0.1.13-8 +- Fix remove-intree-libraries.sh to not exit early and skip SunEC handling. +- Fix PR1983 SunEC patch so that ecc_impl.h is patched rather than added +- Resolves: rhbz#1661577 + +* Fri Jan 11 2019 Andrew Hughes - 1:11.0.1.13-8 - Update to shenandoah-jdk-11.0.1+13-20190101 - Update tarball generation script in preparation for PR3681/RH1656677 SunEC changes. - Use remove-intree-libraries.sh to remove the remaining SunEC code for now. -- Fix remove-intree-libraries.sh to not exit early and skip SunEC handling. -- Fix PR1983 SunEC patch so that ecc_impl.h is patched rather than added - Add missing RH1022017 patch to reduce curves reported by SSL to those we support. +- Drop upstream Shenandoah patch RH1648995. - Resolves: rhbz#1661577 +* Fri Dec 07 2018 Severin Gehwolf - 1:11.0.1.13-7 +- Added %%global _find_debuginfo_opts -g +- Resolves: rhbz#1656997 + +* Mon Nov 12 2018 Jiri Vanek - 1:11.0.1.13-6 +- fixed tck failures of arraycopy and process exec with shenandoah on +- added patch585 rh1648995-shenandoah_array_copy_broken_by_not_always_copy_forward_for_disjoint_arrays.patch + +* Wed Nov 07 2018 Jiri Vanek - 1:11.0.1.13-5 +- headless' suggests of cups, replaced by Requires of cups-libs + * Thu Nov 01 2018 Jiri Vanek - 1:11.0.1.13-3 - added Patch584 jdk8209639-rh1640127-02-coalesce_attempted_spill_non_spillable.patch