[java-1.7.0-openjdk/f19] Sync with f20 - ec support, ppcle support, minor maintainace

jiri vanek jvanek at fedoraproject.org
Wed Jul 2 12:42:44 UTC 2014


commit 2ed57371c7cb714423555b37b5288bfc97239400
Author: Jiri Vanek <jvanek at jvanek.redhat>
Date:   Wed Jul 2 14:42:28 2014 +0200

    Sync with f20 - ec support, ppcle support, minor maintainace

 fsg.sh                    |    8 +----
 java-1.7.0-openjdk.spec   |   61 +++++++++++++++++++++++++++++++++-----
 nss.cfg                   |    3 +-
 remove-origin-from-rpaths |   71 +++++++++++++++++++++++++++++++++++++++++++++
 rh1022017.patch           |   44 ++++++++++++++++++++++++++++
 5 files changed, 171 insertions(+), 16 deletions(-)
---
diff --git a/fsg.sh b/fsg.sh
index 062ffd4..838e585 100644
--- a/fsg.sh
+++ b/fsg.sh
@@ -106,10 +106,4 @@ echo "Removing registration tests"
 rm -rvf openjdk/jdk/test/com/sun/servicetag
 
 echo "Removing EC source code we don't build"
-rm -vf openjdk/jdk/src/share/classes/sun/security/ec/ECDHKeyAgreement.java
-rm -vf openjdk/jdk/src/share/classes/sun/security/ec/ECDSASignature.java
-rm -vf openjdk/jdk/src/share/classes/sun/security/ec/ECKeyPairGenerator.java
-rm -vf openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java
-rm -vf openjdk/jdk/src/share/classes/sun/security/ec/SunECEntries.java
-rm -rvf openjdk/jdk/src/share/native/sun/security/ec
-rm -rvf openjdk/jdk/make/sun/security/ec
+rm -rvf openjdk/jdk/src/share/native/sun/security/ec/impl
diff --git a/java-1.7.0-openjdk.spec b/java-1.7.0-openjdk.spec
index c4895aa..48b86fb 100644
--- a/java-1.7.0-openjdk.spec
+++ b/java-1.7.0-openjdk.spec
@@ -9,7 +9,10 @@
 %global ppc64le			ppc64le
 %global ppc64be			ppc64 ppc64p7
 %global multilib_arches %{power64} sparc64 x86_64 
-%global jit_arches		%{ix86} x86_64 sparcv9 sparc64 %{ppc64be} %{aarch64}
+%global jit_arches		%{ix86} x86_64 sparcv9 sparc64 %{ppc64be} %{ppc64le} %{aarch64}
+
+# Always set this so the nss.cfg file is not broken
+%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
 
 #if 0, then links are set forcibly, if 1 ten only if status is auto
 %global graceful_links 0
@@ -163,7 +166,7 @@
 
 Name:    java-%{javaver}-%{origin}
 Version: %{javaver}.%{updatever}
-Release: %{icedtea_version}.1%{?dist}
+Release: %{icedtea_version}.2%{?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
@@ -231,6 +234,11 @@ Source1111: fsg.sh
 # Ensure we aren't using the limited crypto policy
 Source12: TestCryptoLevel.java
 
+Source13: java-abrt-luncher
+
+# Remove $ORIGIN from RPATHS
+Source14: remove-origin-from-rpaths
+
 # RPM/distribution specific patches
 
 # Allow TCK to pass with access bridge wired in
@@ -268,6 +276,9 @@ Patch200: abrt_friendly_hs_log_jdk7.patch
 # mixer
 Patch300: pulse-soundproperties.patch
 
+# Make the curves reported by Java's SSL implementation match those of NSS
+Patch400: rh1022017.patch
+
 # Temporary patches
 
 #Workaround RH902004
@@ -280,6 +291,7 @@ BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: gcc-c++
 BuildRequires: alsa-lib-devel
+BuildRequires: chrpath
 BuildRequires: cups-devel
 BuildRequires: desktop-file-utils
 BuildRequires: giflib-devel
@@ -309,8 +321,13 @@ BuildRequires: at-spi-devel
 BuildRequires: gawk
 BuildRequires: pkgconfig >= 0.9.0
 BuildRequires: xorg-x11-utils
+# Requirements for setting up the nss.cfg
 BuildRequires: nss-devel
+# Required for NIO2
 BuildRequires: libattr-devel
+# Build requirements for SunEC system NSS support
+BuildRequires: nss-softokn-freebl-devel >= 3.16.1
+BuildRequires: python
 # PulseAudio build requirements.
 %if %{with_pulseaudio}
 BuildRequires: pulseaudio-libs-devel >= 0.9.11
@@ -324,7 +341,7 @@ BuildRequires: libffi-devel >= 3.0.10
 BuildRequires: openssl
 # execstack build requirement.
 # no prelink on ARM yet
-%ifnarch %{arm} %{aarch64}
+%ifnarch %{arm} %{aarch64} %{ppc64le}
 BuildRequires: prelink
 %endif
 %ifarch %{jit_arches}
@@ -332,7 +349,6 @@ BuildRequires: prelink
 BuildRequires: systemtap-sdt-devel
 %endif
 
-Requires: rhino
 Requires: lcms2 >= 2.5
 Requires: libjpeg = 6b
 Requires: fontconfig
@@ -462,6 +478,9 @@ cp %{SOURCE2} .
 %patch300
 %endif
 
+# ECC fix
+%patch400
+
 # Add systemtap patches if enabled
 %if %{with_systemtap}
 %endif
@@ -617,6 +636,10 @@ make \
   STRIP_POLICY="no_strip" \
   JAVAC_WARNINGS_FATAL="false" \
   INSTALL_LOCATION=%{_jvmdir}/%{sdkdir} \
+  SYSTEM_NSS="true" \
+  NSS_LIBS="`pkg-config --libs nss-softokn` -lfreebl" \
+  NSS_CFLAGS="`pkg-config --cflags nss-softokn` " \
+  ECC_JUST_SUITE_B="true" \
   %{debugbuild}
 
 popd >& /dev/null
@@ -627,6 +650,10 @@ fi
 
 export JAVA_HOME=$(pwd)/%{buildoutputdir}/j2sdk-image
 
+# Install nss.cfg right away as we will be using the JRE above
+cp -a %{SOURCE8} $JAVA_HOME/jre/lib/security/
+sed -i -e s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g $JAVA_HOME/jre/lib/security/nss.cfg
+
 # Build pulseaudio and install it to JDK build location
 %if %{with_pulseaudio}
 pushd pulseaudio
@@ -651,6 +678,8 @@ rm -f %{buildoutputdir}/lib/fontconfig*.bfc
 $JAVA_HOME/bin/javac -d . %{SOURCE12}
 $JAVA_HOME/bin/java TestCryptoLevel
 
+files=$(find $(pwd)/%{buildoutputdir}/j2sdk-image/ -type f | xargs file | grep ELF | cut -d: -f1)
+python %{SOURCE14} $files
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -753,10 +782,6 @@ mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/%{archinstall}/client/
 popd
 
 
-# Install nss.cfg
-install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security/
-
-
 # Install Javadoc documentation.
 install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
 cp -a %{buildoutputdir}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir}
@@ -844,6 +869,9 @@ ln -s %{_jvmdir}/java-%{javaver}-%{origin} $RPM_BUILD_ROOT/%{_jvmdir}/java-%{jav
 %{jrebindir}/java -Xshare:dump >/dev/null 2>/dev/null
 %endif
 
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
 # Note current status of alternatives
 MAKE_THIS_DEFAULT=0
 ID="%{_jvmdir}/\(\(jre\)\|\(java\)\)-%{javaver}-%{origin}.*bin/java"
@@ -1144,6 +1172,8 @@ done
 update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir} %{priority} \
 --slave %{_jvmjardir}/java-%{javaver}-%{origin}       java_sdk_%{javaver}_%{origin}_exports      %{_jvmjardir}/%{sdkdir}
 
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
 
 exit 0
 
@@ -1153,8 +1183,19 @@ exit 0
   alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir}
   alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir}
 
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+if [ $1 -eq 0 ] ; then
+    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
 exit 0
 
+%posttrans  devel
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+
 %post javadoc
 MAKE_THIS_DEFAULT=0
 ID="%{_javadocdir}/java-%{javaver}-%{origin}.*/api"
@@ -1316,6 +1357,10 @@ exit 0
 %{_jvmdir}/%{jredir}/lib/accessibility.properties
 
 %changelog
+* Wed Jul 19 2014 Jiri Vanek  <jvanek at redhat.com> - 1.7.0.60-2.5.0.2.f19
+- Sync with 20
+- rpath, ppc64le and NSS EC support
+
 * Thu Jun 19 2014 Jiri Vanek  <jvanek at redhat.com> - 1.7.0.60-2.5.0.1.f19
 - added and applied as reverted patch404 gtk3ToBeReverted.patch
  - reverting controversial fix of http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=729
diff --git a/nss.cfg b/nss.cfg
index c510dd0..377a39c 100644
--- a/nss.cfg
+++ b/nss.cfg
@@ -1,4 +1,5 @@
 name = NSS
-nssLibraryDirectory = 
+nssLibraryDirectory = @NSS_LIBDIR@
 nssDbMode = noDb
 attributes = compatibility
+handleStartupErrors = ignoreMultipleInitialisation
diff --git a/remove-origin-from-rpaths b/remove-origin-from-rpaths
new file mode 100644
index 0000000..bf6218d
--- /dev/null
+++ b/remove-origin-from-rpaths
@@ -0,0 +1,71 @@
+#!/usr/bin/python
+
+# Usage: $0 file1 file2 ....
+#
+# Given binary files, remove all rpath entries from them containing
+# $ORIGIN. Other rpath entries are not modified
+
+import subprocess;
+import sys;
+
+def print_usage(name):
+    print '''Usage: %s file1 file2 ....
+
+    Given binary files, remove all rpath entries from them containing
+    $ORIGIN. Other rpath entries are not modified''' % (name,)
+
+def call(args):
+    pop = subprocess.Popen(args, bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    stdout, stderr = pop.communicate()
+    if (len(stderr.strip())) != 0:
+        print stderr
+    if pop.returncode != 0:
+        raise OSError('Error calling %s' % (str(args),))
+    return stdout
+
+def check_chrpath_present():
+    try:
+        print(call(['/usr/bin/chrpath', '-v']))
+        return True
+    except OSError:
+        return False
+
+def main(args):
+    binaries = args[1:]
+    if len(binaries) == 0:
+        print_usage(args[0])
+        return 1
+
+    if not check_chrpath_present():
+        print('Could not execute "chrpath". Is it installed?')
+        return 1
+
+    for binary in binaries:
+        try:
+            rpath_output = call(['chrpath', '-l', binary])
+        except OSError:
+            continue
+
+        #print '"' + rpath_output + '"'
+        # the output is "file: RUNPATH=path1:path2:path3\n"
+        rpath_output = rpath_output.strip()
+        start = rpath_output.find('RPATH=')
+        rpath = rpath_output[start+len('RPATH='):]
+        rpath_parts = rpath.split(':')
+        modified_rpath = ''
+        for part in rpath_parts:
+            if not '$ORIGIN' in part:
+                modified_rpath = modified_rpath + ':' + part
+        # shave off the last ':'
+        modified_rpath = modified_rpath[1:]
+        #print '"' + modified_rpath + '"'
+        if len(modified_rpath) == 0:
+            call(['chrpath', '-d', binary])
+            print '%s: Deleted RPATH' % (binary,)
+        else:
+            call(['chrpath', '-r', modified_rpath, binary])
+            print '%s: RPATH=%s' % (binary,modified_rpath)
+    return 0
+
+if __name__ == '__main__':
+    exit(main(sys.argv))
diff --git a/rh1022017.patch b/rh1022017.patch
new file mode 100644
index 0000000..3468779
--- /dev/null
+++ b/rh1022017.patch
@@ -0,0 +1,44 @@
+diff -r cdfd161703ed src/share/classes/sun/security/ssl/HelloExtensions.java
+--- openjdk/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java	Wed Oct 23 05:22:55 2013 +0100
++++ openjdk/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java	Thu Nov 07 12:41:45 2013 +0000
+@@ -435,25 +435,11 @@
+     // the extension value to send in the ClientHello message
+     static final SupportedEllipticCurvesExtension DEFAULT;
+ 
+-    private static final boolean fips;
+-
+     static {
+-        int[] ids;
+-        fips = SunJSSE.isFIPS();
+-        if (fips == false) {
+-            ids = new int[] {
+-                // NIST curves first
+-                // prefer NIST P-256, rest in order of increasing key length
+-                23, 1, 3, 19, 21, 6, 7, 9, 10, 24, 11, 12, 25, 13, 14,
+-                // non-NIST curves
+-                15, 16, 17, 2, 18, 4, 5, 20, 8, 22,
+-            };
+-        } else {
+-            ids = new int[] {
+-                // same as above, but allow only NIST curves in FIPS mode
+-                23, 1, 3, 19, 21, 6, 7, 9, 10, 24, 11, 12, 25, 13, 14,
+-            };
+-        }
++	int[] ids = new int[] {
++	    // NSS currently only supports these three NIST curves
++	    23, 24, 25
++	};
+         DEFAULT = new SupportedEllipticCurvesExtension(ids);
+     }
+ 
+@@ -545,10 +531,6 @@
+         if ((index <= 0) || (index >= NAMED_CURVE_OID_TABLE.length)) {
+             return false;
+         }
+-        if (fips == false) {
+-            // in non-FIPS mode, we support all valid indices
+-            return true;
+-        }
+         return DEFAULT.contains(index);
+     }
+ 


More information about the scm-commits mailing list