diff --git a/.abf.yml b/.abf.yml index 0fa31c8..6b6d42a 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,4 +1,8 @@ sources: + aarch64-port-jdk8u-aarch64-jdk8u102-b14.tar.xz: 41d3f07e4879d07f74e6cb87707147686245f73a + aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u102-b14.tar.xz: 5efa8d72712b912f05f195839ce4223d14134748 + e8d009c4e4e7.tar.bz2: f27a6840d4137dea4b509400539b25166fe75de3 jdk8-jdk8u45-b13-aarch64-jdk8u45-b13.tar.xz: 1f44e78df64b2f8722cf1bf5e3cde65bdd980be9 jdk8u-jdk8u60-b16.tar.xz: 7b02a21bd45ff54f0fb3286cf36d1a60b6e39b0a + systemtap-tapset-3.1.0.tar.xz: 44b09844ec2e90db08d3d883993e0dbab0c1988a systemtap-tapset.tar.gz: 44444c943de42c8d08dbf6954cb05a5275d1fa56 diff --git a/6260348-pr3066.patch b/6260348-pr3066.patch new file mode 100644 index 0000000..06be502 --- /dev/null +++ b/6260348-pr3066.patch @@ -0,0 +1,150 @@ +# HG changeset patch +# User ssadetsky +# Date 1467220169 -3600 +# Wed Jun 29 18:09:29 2016 +0100 +# Node ID 9fffaa63c49d93bff70b96af9a86b7635bce44be +# Parent d0462c26152fc8bd5f79db7f1670777e807ef2b3 +6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate +Reviewed-by: alexsch, azvegint + +diff -r d0462c26152f -r 9fffaa63c49d src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java +--- openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java Tue Jun 28 19:44:50 2016 +0100 ++++ openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java Wed Jun 29 18:09:29 2016 +0100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -93,7 +93,9 @@ + */ + static enum Settings { + GTK_FONT_NAME, +- GTK_ICON_SIZES ++ GTK_ICON_SIZES, ++ GTK_CURSOR_BLINK, ++ GTK_CURSOR_BLINK_TIME + } + + /* Custom regions are needed for representing regions that don't exist +diff -r d0462c26152f -r 9fffaa63c49d src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +--- openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Tue Jun 28 19:44:50 2016 +0100 ++++ openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Wed Jun 29 18:09:29 2016 +0100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -371,7 +371,17 @@ + int vProgWidth = 22 - (progXThickness * 2); + int vProgHeight = 80 - (progYThickness * 2); + +- Integer caretBlinkRate = Integer.valueOf(500); ++ Integer caretBlinkRate; ++ if (Boolean.FALSE.equals(GTKEngine.INSTANCE.getSetting( ++ GTKEngine.Settings.GTK_CURSOR_BLINK))) { ++ caretBlinkRate = Integer.valueOf(0); ++ } else { ++ caretBlinkRate = (Integer) GTKEngine.INSTANCE.getSetting( ++ GTKEngine.Settings.GTK_CURSOR_BLINK_TIME); ++ if (caretBlinkRate == null) { ++ caretBlinkRate = Integer.valueOf(500); ++ } ++ } + Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0); + + Double defaultCaretAspectRatio = new Double(0.025); +diff -r d0462c26152f -r 9fffaa63c49d src/solaris/native/sun/awt/gtk2_interface.c +--- openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c Tue Jun 28 19:44:50 2016 +0100 ++++ openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c Wed Jun 29 18:09:29 2016 +0100 +@@ -1316,9 +1316,6 @@ + { + result = gtk2_widgets[_GTK_COMBO_BOX_TEXT_FIELD_TYPE] = + (*fp_gtk_entry_new)(); +- +- GtkSettings* settings = fp_gtk_widget_get_settings(result); +- fp_g_object_set(settings, "gtk-cursor-blink", FALSE, NULL); + } + result = gtk2_widgets[_GTK_COMBO_BOX_TEXT_FIELD_TYPE]; + break; +@@ -1363,10 +1360,6 @@ + { + gtk2_widgets[_GTK_ENTRY_TYPE] = + (*fp_gtk_entry_new)(); +- +- GtkSettings* settings = +- fp_gtk_widget_get_settings(gtk2_widgets[_GTK_ENTRY_TYPE]); +- fp_g_object_set(settings, "gtk-cursor-blink", FALSE, NULL); + } + result = gtk2_widgets[_GTK_ENTRY_TYPE]; + break; +@@ -1558,9 +1551,6 @@ + { + result = gtk2_widgets[_GTK_SPIN_BUTTON_TYPE] = + (*fp_gtk_spin_button_new)(NULL, 0, 0); +- +- GtkSettings* settings = fp_gtk_widget_get_settings(result); +- fp_g_object_set(settings, "gtk-cursor-blink", FALSE, NULL); + } + result = gtk2_widgets[_GTK_SPIN_BUTTON_TYPE]; + break; +@@ -2510,14 +2500,20 @@ + + return result; + } +-/* ++ + jobject get_integer_property(JNIEnv *env, GtkSettings* settings, const gchar* key) + { +- gint intval = NULL; +- ++ gint intval = NULL; + (*fp_g_object_get)(settings, key, &intval, NULL); + return create_Integer(env, intval); +-}*/ ++} ++ ++jobject get_boolean_property(JNIEnv *env, GtkSettings* settings, const gchar* key) ++{ ++ gint intval = NULL; ++ (*fp_g_object_get)(settings, key, &intval, NULL); ++ return create_Boolean(env, intval); ++} + + jobject gtk2_get_setting(JNIEnv *env, Setting property) + { +@@ -2529,6 +2525,10 @@ + return get_string_property(env, settings, "gtk-font-name"); + case GTK_ICON_SIZES: + return get_string_property(env, settings, "gtk-icon-sizes"); ++ case GTK_CURSOR_BLINK: ++ return get_boolean_property(env, settings, "gtk-cursor-blink"); ++ case GTK_CURSOR_BLINK_TIME: ++ return get_integer_property(env, settings, "gtk-cursor-blink-time"); + } + + return NULL; +diff -r d0462c26152f -r 9fffaa63c49d src/solaris/native/sun/awt/gtk2_interface.h +--- openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h Tue Jun 28 19:44:50 2016 +0100 ++++ openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h Wed Jun 29 18:09:29 2016 +0100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -140,7 +140,9 @@ + typedef enum _Setting + { + GTK_FONT_NAME, +- GTK_ICON_SIZES ++ GTK_ICON_SIZES, ++ GTK_CURSOR_BLINK, ++ GTK_CURSOR_BLINK_TIME + } Setting; + + /* GTK types, here to eliminate need for GTK headers at compile time */ diff --git a/8044762-pr2960.patch b/8044762-pr2960.patch new file mode 100644 index 0000000..af5b606 --- /dev/null +++ b/8044762-pr2960.patch @@ -0,0 +1,45 @@ +# HG changeset patch +# User dsamersoff +# Date 1403087398 25200 +# Wed Jun 18 03:29:58 2014 -0700 +# Node ID 13411144d46b50d0087f35eca2b8e827aae558f1 +# Parent 10c9f8461c297a200ef57970c1f4c32d4081d790 +8044762, PR2960: com/sun/jdi/OptionTest.java test time out +Summary: gdata could be NULL in debugInit_exit +Reviewed-by: dcubed + +diff -r 10c9f8461c29 -r 13411144d46b src/share/back/debugInit.c +--- openjdk/jdk/src/share/back/debugInit.c Fri May 20 19:42:05 2016 +0100 ++++ openjdk/jdk/src/share/back/debugInit.c Wed Jun 18 03:29:58 2014 -0700 +@@ -1307,22 +1307,26 @@ + if ( error != JVMTI_ERROR_NONE ) { + exit_code = 1; + if ( docoredump ) { ++ LOG_MISC(("Dumping core as requested by command line")); + finish_logging(exit_code); + abort(); + } + } ++ + if ( msg==NULL ) { + msg = ""; + } + + LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg)); + +- gdata->vmDead = JNI_TRUE; ++ if (gdata != NULL) { ++ gdata->vmDead = JNI_TRUE; + +- /* Let's try and cleanup the JVMTI, if we even have one */ +- if ( gdata->jvmti != NULL ) { +- /* Dispose of jvmti (gdata->jvmti becomes NULL) */ +- disposeEnvironment(gdata->jvmti); ++ /* Let's try and cleanup the JVMTI, if we even have one */ ++ if ( gdata->jvmti != NULL ) { ++ /* Dispose of jvmti (gdata->jvmti becomes NULL) */ ++ disposeEnvironment(gdata->jvmti); ++ } + } + + /* Finish up logging. We reach here if JDWP is doing the exiting. */ diff --git a/8049226-pr2960.patch b/8049226-pr2960.patch new file mode 100644 index 0000000..0f6bdf8 --- /dev/null +++ b/8049226-pr2960.patch @@ -0,0 +1,123 @@ +# HG changeset patch +# User dsamersoff +# Date 1409228402 25200 +# Thu Aug 28 05:20:02 2014 -0700 +# Node ID f4c9545cd8a56a5fab74c95de3573623ba2b83c4 +# Parent 13411144d46b50d0087f35eca2b8e827aae558f1 +8049226, PR2960: com/sun/jdi/OptionTest.java test times out again +Summary: Don't call jni_FatalError if transport initialization fails +Reviewed-by: sspitsyn, sla + +diff -r 13411144d46b -r f4c9545cd8a5 src/share/back/debugInit.c +--- openjdk/jdk/src/share/back/debugInit.c Wed Jun 18 03:29:58 2014 -0700 ++++ openjdk/jdk/src/share/back/debugInit.c Thu Aug 28 05:20:02 2014 -0700 +@@ -1013,7 +1013,7 @@ + atexit_finish_logging(void) + { + /* Normal exit(0) (not _exit()) may only reach here */ +- finish_logging(0); /* Only first call matters */ ++ finish_logging(); /* Only first call matters */ + } + + static jboolean +@@ -1301,43 +1301,49 @@ + void + debugInit_exit(jvmtiError error, const char *msg) + { +- int exit_code = 0; ++ enum exit_codes { EXIT_NO_ERRORS = 0, EXIT_JVMTI_ERROR = 1, EXIT_TRANSPORT_ERROR = 2 }; + +- /* Pick an error code */ +- if ( error != JVMTI_ERROR_NONE ) { +- exit_code = 1; +- if ( docoredump ) { +- LOG_MISC(("Dumping core as requested by command line")); +- finish_logging(exit_code); +- abort(); +- } ++ // Prepare to exit. Log error and finish logging ++ LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, ++ ((msg == NULL) ? "" : msg))); ++ ++ // coredump requested by command line. Keep JVMTI data dirty ++ if (error != JVMTI_ERROR_NONE && docoredump) { ++ LOG_MISC(("Dumping core as requested by command line")); ++ finish_logging(); ++ abort(); + } + +- if ( msg==NULL ) { +- msg = ""; +- } ++ finish_logging(); + +- LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg)); +- ++ // Cleanup the JVMTI if we have one + if (gdata != NULL) { + gdata->vmDead = JNI_TRUE; +- +- /* Let's try and cleanup the JVMTI, if we even have one */ +- if ( gdata->jvmti != NULL ) { +- /* Dispose of jvmti (gdata->jvmti becomes NULL) */ ++ if (gdata->jvmti != NULL) { ++ // Dispose of jvmti (gdata->jvmti becomes NULL) + disposeEnvironment(gdata->jvmti); + } + } + +- /* Finish up logging. We reach here if JDWP is doing the exiting. */ +- finish_logging(exit_code); /* Only first call matters */ +- +- /* Let's give the JNI a FatalError if non-exit 0, which is historic way */ +- if ( exit_code != 0 ) { +- JNIEnv *env = NULL; +- jniFatalError(env, msg, error, exit_code); ++ // We are here with no errors. Kill entire process and exit with zero exit code ++ if (error == JVMTI_ERROR_NONE) { ++ forceExit(EXIT_NO_ERRORS); ++ return; + } + +- /* Last chance to die, this kills the entire process. */ +- forceExit(exit_code); ++ // No transport initilized. ++ // As we don't have any details here exiting with separate exit code ++ if (error == AGENT_ERROR_TRANSPORT_INIT) { ++ forceExit(EXIT_TRANSPORT_ERROR); ++ return; ++ } ++ ++ // We have JVMTI error. Call hotspot jni_FatalError handler ++ jniFatalError(NULL, msg, error, EXIT_JVMTI_ERROR); ++ ++ // hotspot calls os:abort() so we should never reach code below, ++ // but guard against possible hotspot changes ++ ++ // Last chance to die, this kills the entire process. ++ forceExit(EXIT_JVMTI_ERROR); + } +diff -r 13411144d46b -r f4c9545cd8a5 src/share/back/log_messages.c +--- openjdk/jdk/src/share/back/log_messages.c Wed Jun 18 03:29:58 2014 -0700 ++++ openjdk/jdk/src/share/back/log_messages.c Thu Aug 28 05:20:02 2014 -0700 +@@ -230,7 +230,7 @@ + + /* Finish up logging, flush output to the logfile. */ + void +-finish_logging(int exit_code) ++finish_logging() + { + #ifdef JDWP_LOGGING + MUTEX_LOCK(my_mutex); +diff -r 13411144d46b -r f4c9545cd8a5 src/share/back/log_messages.h +--- openjdk/jdk/src/share/back/log_messages.h Wed Jun 18 03:29:58 2014 -0700 ++++ openjdk/jdk/src/share/back/log_messages.h Thu Aug 28 05:20:02 2014 -0700 +@@ -29,7 +29,7 @@ + /* LOG: Must be called like: LOG_category(("anything")) or LOG_category((format,args)) */ + + void setup_logging(const char *, unsigned); +-void finish_logging(int); ++void finish_logging(); + + #define LOG_NULL ((void)0) + diff --git a/8154210.patch b/8154210.patch new file mode 100644 index 0000000..51b8138 --- /dev/null +++ b/8154210.patch @@ -0,0 +1,47 @@ +# HG changeset patch +# User aph +# Date 1461121375 -3600 +# Wed Apr 20 04:02:55 2016 +0100 +# Node ID 5605c859f0ec47d6f507cc83e783554a4210ccf6 +# Parent 7458e5178c8646a9b4f76ac3d13b222abed3f16f +8154210: Zero: Better byte behaviour +Summary: Complete support for 8132051 on Zero and fix failure on 64-bit big-endian systems +Reviewed-by: andrew, chrisphi + +diff -r 7458e5178c86 -r 5605c859f0ec src/cpu/zero/vm/cppInterpreter_zero.cpp +--- openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue May 17 03:03:36 2016 +0100 ++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Apr 20 04:02:55 2016 +0100 +@@ -220,9 +220,16 @@ + // Push our result + for (int i = 0; i < result_slots; i++) { + // Adjust result to smaller +- intptr_t res = result[-i]; ++ union { ++ intptr_t res; ++ jint res_jint; ++ }; ++ res = result[-i]; + if (result_slots == 1) { +- res = narrow(method->result_type(), res); ++ BasicType t = method->result_type(); ++ if (is_subword_type(t)) { ++ res_jint = (jint)narrow(t, res_jint); ++ } + } + stack->push(res); + } +diff -r 7458e5178c86 -r 5605c859f0ec src/share/vm/interpreter/bytecodeInterpreter.cpp +--- openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Tue May 17 03:03:36 2016 +0100 ++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Wed Apr 20 04:02:55 2016 +0100 +@@ -593,8 +593,9 @@ + /* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + + /* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +-/* 0xE4 */ &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, &&opc_return_register_finalizer, +-/* 0xE8 */ &&opc_invokehandle,&&opc_default, &&opc_default, &&opc_default, ++/* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, ++/* 0xE8 */ &&opc_return_register_finalizer, ++ &&opc_invokehandle, &&opc_default, &&opc_default, + /* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + + /* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, diff --git a/8154313.patch b/8154313.patch new file mode 100644 index 0000000..3a43c5f --- /dev/null +++ b/8154313.patch @@ -0,0 +1,68 @@ +--- jdk8/make/Javadoc.gmk 2016-04-01 16:53:41.069477682 +0200 ++++ jdk8/make/Javadoc.gmk 2016-04-01 16:53:41.014477059 +0200 +@@ -220,6 +220,12 @@ + JRE_API_DOCSDIR = $(DOCSDIR)/jre/api + PLATFORM_DOCSDIR = $(DOCSDIR)/platform + ++ ++JAVADOC_ARCHIVE_NAME := jdk-$(FULL_VERSION)-docs.zip ++JAVADOC_ARCHIVE_ASSEMBLY_DIR := $(DOCSTMPDIR)/zip-docs ++JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles ++JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME) ++ + # The non-core api javadocs need to be able to access the root of the core + # api directory, so for jdk/api or jre/api to get to the core api/ + # directory we would use this: +@@ -319,6 +325,37 @@ + all: docs + docs: coredocs otherdocs + ++# ++# Optional target which bundles all generated javadocs into a zip ++# archive. The dependency on docs is handled in Main.gmk. Incremental ++# building of docs is currently broken so if you invoke zip-docs after ++# docs, the docs are always rebuilt. ++# ++ ++zip-docs: $(JAVADOC_ARCHIVE) ++ ++# ++# Add the core docs as prerequisite to the archive to trigger a rebuild ++# if the core docs were rebuilt. Ideally any doc rebuild should trigger ++# this, but the way prerequisites are currently setup in this file, that ++# is hard to achieve. ++# ++ ++$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE) ++ @$(ECHO) "Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME)" ; ++ $(MKDIR) -p $(JAVADOC_ARCHIVE_DIR) ; ++ $(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR) ; ++ $(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); ++ all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html `; \ ++ pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \ ++ for index_file in $${all_roots} ; do \ ++ target_dir=`dirname $${index_file}`; \ ++ name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \ ++ $(LN) -s $${target_dir} $${name}; \ ++ done; \ ++ $(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \ ++ popd ; ++ + ################################################################# + # Production Targets -- USE THESE TARGETS WHEN: + # a) You're generating docs outside of release engineering's +--- jdk8/make/Main.gmk 2016-04-01 16:53:41.311480424 +0200 ++++ jdk8/make/Main.gmk 2016-04-01 16:53:41.266479914 +0200 +@@ -165,6 +165,12 @@ + @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) + @$(call TargetExit) + ++zip-docs: docs zip-docs-only ++zip-docs-only: start-make ++ @$(call TargetEnter) ++ @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk zip-docs) ++ @$(call TargetExit) ++ + sign-jars: jdk sign-jars-only + sign-jars-only: start-make + @$(call TargetEnter) diff --git a/8157306-pr3121-rh1360863.patch b/8157306-pr3121-rh1360863.patch new file mode 100644 index 0000000..8cb69ae --- /dev/null +++ b/8157306-pr3121-rh1360863.patch @@ -0,0 +1,29 @@ +# HG changeset patch +# User aph +# Date 1470065634 -3600 +# Mon Aug 01 16:33:54 2016 +0100 +# Node ID ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +# Parent ab3e0bde3c15bbba60de4decabcd70ffef657448 +8157306, PR3121: Random infrequent null pointer exceptions in javac +Reviewed-by: kvn + +diff -r ab3e0bde3c15 -r ee9bffb3bd39 src/share/vm/opto/lcm.cpp +--- openjdk/hotspot/src/share/vm/opto/lcm.cpp Tue Jul 26 04:42:03 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp Mon Aug 01 16:33:54 2016 +0100 +@@ -1090,11 +1090,14 @@ + Block *sb = block->_succs[i]; + // Clone the entire area; ignoring the edge fixup for now. + for( uint j = end; j > beg; j-- ) { +- // It is safe here to clone a node with anti_dependence +- // since clones dominate on each path. + Node *clone = block->get_node(j-1)->clone(); + sb->insert_node(clone, 1); + map_node_to_block(clone, sb); ++#ifdef AARCH64 ++ if (clone->needs_anti_dependence_check()) { ++ insert_anti_dependences(sb, clone); ++ } ++#endif + } + } + diff --git a/8158260-pr2991-rh1341258.patch b/8158260-pr2991-rh1341258.patch new file mode 100644 index 0000000..dae9509 --- /dev/null +++ b/8158260-pr2991-rh1341258.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# User simonis +# Date 1466155884 -7200 +# Fri Jun 17 11:31:24 2016 +0200 +# Node ID 74081c30fede694b547c8b3386b9887ff14e8775 +# Parent 3fc29347b27fdd2075e6ec6d80bb26ab2bf667c1 +8158260, PR2991, RH1341258: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions +Summary: Adjust instruction generation. +Reviewed-by: goetz +Contributed-by: gromero@linux.vnet.ibm.com, horii@jp.ibm.com + +diff -r 3fc29347b27f -r 74081c30fede src/cpu/ppc/vm/ppc.ad +--- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad Fri Jun 17 11:31:24 2016 +0200 +@@ -5461,7 +5461,7 @@ + %} + + // Match loading integer and casting it to long. +-instruct loadI2L(iRegLdst dst, memory mem) %{ ++instruct loadI2L(iRegLdst dst, memoryAlg4 mem) %{ + match(Set dst (ConvI2L (LoadI mem))); + predicate(_kids[0]->_leaf->as_Load()->is_unordered()); + ins_cost(MEMORY_REF_COST); +@@ -5477,7 +5477,7 @@ + %} + + // Match loading integer and casting it to long - acquire. +-instruct loadI2L_ac(iRegLdst dst, memory mem) %{ ++instruct loadI2L_ac(iRegLdst dst, memoryAlg4 mem) %{ + match(Set dst (ConvI2L (LoadI mem))); + ins_cost(3*MEMORY_REF_COST); + diff --git a/8159244-pr3074.patch b/8159244-pr3074.patch new file mode 100644 index 0000000..94ba21b --- /dev/null +++ b/8159244-pr3074.patch @@ -0,0 +1,115 @@ +# HG changeset patch +# User thartmann +# Date 1468206230 -3600 +# Mon Jul 11 04:03:50 2016 +0100 +# Node ID 7c89f7f3f2c57d64970cc2ae3a81d24765830118 +# Parent 4b40867e627dd9043bc67a4795caa9834ef69478 +8159244, PR3074: Partially initialized string object created by C2's string concat optimization may escape +Summary: Emit release barrier after String creation to prevent partially initialized object from escaping. +Reviewed-by: kvn + +diff -r 4b40867e627d -r 7c89f7f3f2c5 src/share/vm/opto/stringopts.cpp +--- openjdk/hotspot/src/share/vm/opto/stringopts.cpp Fri Jun 17 11:31:24 2016 +0200 ++++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp Mon Jul 11 04:03:50 2016 +0100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -1640,6 +1640,12 @@ + kit.store_String_length(kit.control(), result, length); + } + kit.store_String_value(kit.control(), result, char_array); ++ ++ // The value field is final. Emit a barrier here to ensure that the effect ++ // of the initialization is committed to memory before any code publishes ++ // a reference to the newly constructed object (see Parse::do_exits()). ++ assert(AllocateNode::Ideal_allocation(result, _gvn) != NULL, "should be newly allocated"); ++ kit.insert_mem_bar(Op_MemBarRelease, result); + } else { + result = C->top(); + } +diff -r 4b40867e627d -r 7c89f7f3f2c5 test/compiler/stringopts/TestStringObjectInitialization.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/stringopts/TestStringObjectInitialization.java Mon Jul 11 04:03:50 2016 +0100 +@@ -0,0 +1,78 @@ ++/* ++ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++ ++import java.util.Arrays; ++ ++/* ++ * @test ++ * @bug 8159244 ++ * @requires vm.gc == "Parallel" | vm.gc == "null" ++ * @summary Verifies that no partially initialized String object escapes from ++ * C2's String concat optimization in a highly concurrent setting. ++ * This test triggers the bug in about 1 out of 10 runs. ++ * @compile -XDstringConcat=inline TestStringObjectInitialization.java ++ * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-CompactStrings ++ * -XX:-UseG1GC -XX:+UseParallelGC TestStringObjectInitialization ++ */ ++public class TestStringObjectInitialization { ++ ++ String myString; ++ ++ public static void main(String[] args) throws Exception { ++ TestStringObjectInitialization t = new TestStringObjectInitialization(); ++ // Create some threads that concurrently update 'myString' ++ for (int i = 0; i < 100; ++i) { ++ (new Thread(new Runner(t))).start(); ++ } ++ Thread last = new Thread(new Runner(t)); ++ last.start(); ++ last.join(); ++ } ++ ++ private void add(String message) { ++ // String escapes to other threads here ++ myString += message; ++ } ++ ++ public void run(String s, String[] sArray) { ++ // Trigger C2's string concatenation optimization ++ add(s + Arrays.toString(sArray) + " const "); ++ } ++} ++ ++class Runner implements Runnable { ++ private TestStringObjectInitialization test; ++ ++ public Runner(TestStringObjectInitialization t) { ++ test = t; ++ } ++ ++ public void run(){ ++ String[] array = {"a", "b", "c"}; ++ for (int i = 0; i < 10000; ++i) { ++ test.run("a", array); ++ } ++ } ++} ++ diff --git a/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch new file mode 100644 index 0000000..ff38413 --- /dev/null +++ b/8162384-pr3122-rh1358661.patch @@ -0,0 +1,54 @@ +# HG changeset patch +# User roland +# Date 1469615613 -7200 +# Wed Jul 27 12:33:33 2016 +0200 +# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 +# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation +Summary: when speculation fails at a call fallback to profile data at the call site +Reviewed-by: kvn + +diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp +--- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 +@@ -205,16 +205,22 @@ + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { +- // We have a speculative type, we should be able to resolve +- // the call. We do that before looking at the profiling at +- // this invoke because it may lead to bimorphic inlining which +- // a speculative type should help us avoid. +- receiver_method = callee->resolve_invoke(jvms->method()->holder(), +- speculative_receiver_type); +- if (receiver_method == NULL) { ++ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { ++ // We have a speculative type, we should be able to resolve ++ // the call. We do that before looking at the profiling at ++ // this invoke because it may lead to bimorphic inlining which ++ // a speculative type should help us avoid. ++ receiver_method = callee->resolve_invoke(jvms->method()->holder(), ++ speculative_receiver_type); ++ if (receiver_method == NULL) { ++ speculative_receiver_type = NULL; ++ } else { ++ morphism = 1; ++ } ++ } else { ++ // speculation failed before. Use profiling at the call ++ // (could allow bimorphic inlining for instance). + speculative_receiver_type = NULL; +- } else { +- morphism = 1; + } + } + if (receiver_method == NULL && +@@ -252,7 +258,7 @@ + Deoptimization::Reason_bimorphic : + (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && +- !too_many_traps(jvms->method(), jvms->bci(), reason) ++ !too_many_traps(caller, bci, reason) + ) { + // Generate uncommon trap for class check failure path + // in case of monomorphic or bimorphic virtual call site. diff --git a/TestECDSA.java b/TestECDSA.java new file mode 100644 index 0000000..6eb9cb2 --- /dev/null +++ b/TestECDSA.java @@ -0,0 +1,49 @@ +/* TestECDSA -- Ensure ECDSA signatures are working. + Copyright (C) 2016 Red Hat, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.Signature; + +/** + * @test + */ +public class TestECDSA { + + public static void main(String[] args) throws Exception { + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); + KeyPair key = keyGen.generateKeyPair(); + + byte[] data = "This is a string to sign".getBytes("UTF-8"); + + Signature dsa = Signature.getInstance("NONEwithECDSA"); + dsa.initSign(key.getPrivate()); + dsa.update(data); + byte[] sig = dsa.sign(); + System.out.println("Signature: " + new BigInteger(1, sig).toString(16)); + + Signature dsaCheck = Signature.getInstance("NONEwithECDSA"); + dsaCheck.initVerify(key.getPublic()); + dsaCheck.update(data); + boolean success = dsaCheck.verify(sig); + if (!success) { + throw new RuntimeException("Test failed. Signature verification error"); + } + System.out.println("Test passed."); + } +} diff --git a/corba_typo_fix.patch b/corba_typo_fix.patch new file mode 100644 index 0000000..9756a8a --- /dev/null +++ b/corba_typo_fix.patch @@ -0,0 +1,24 @@ +diff -r 5c43ac1f2a59 src/share/classes/javax/rmi/CORBA/Util.java +--- openjdk.orig/corba/src/share/classes/javax/rmi/CORBA/Util.java Fri Jul 01 04:11:22 2016 +0100 ++++ openjdk/corba/src/share/classes/javax/rmi/CORBA/Util.java Mon Jul 04 16:04:39 2016 +0100 +@@ -413,8 +413,18 @@ + // check that a serialization permission has been + // set to allow the loading of the Util delegate + // which provides access to custom ValueHandler +- sm.checkPermission(new SerializablePermission( +- "enableCustomValueHanlder")); ++ try { ++ sm.checkPermission(new SerializablePermission( ++ "enableCustomValueHandler")); ++ } catch (SecurityException ex1) { ++ // Fallback: See if the permission is mis-spelt ++ try { ++ sm.checkPermission(new SerializablePermission( ++ "enableCustomValueHanlder")); ++ } catch (SecurityException ex2) { ++ throw ex1; // Throw original exception ++ } ++ } + } + } + } diff --git a/include-all-srcs.patch b/include-all-srcs.patch new file mode 100644 index 0000000..41b1ea2 --- /dev/null +++ b/include-all-srcs.patch @@ -0,0 +1,54 @@ +--- jdk8/jdk/make/CreateJars.gmk ++++ jdk8/jdk/make/CreateJars.gmk +@@ -569,38 +569,12 @@ + ########################################################################################## + + SRC_ZIP_INCLUDES = \ +- com/sun/corba \ +- com/sun/image/codec/jpeg \ +- com/sun/imageio \ +- com/sun/java_cup \ +- com/sun/javadoc \ +- com/sun/java/swing \ +- com/sun/jmx \ +- com/sun/naming \ +- com/sun/org/apache \ +- com/sun/security/auth \ +- com/sun/security/jgss \ +- com/sun/source \ ++ com \ + java \ +- javax/accessibility \ +- javax/annotation \ +- javax/imageio \ +- javax/lang \ +- javax/management \ +- javax/naming \ +- javax/print \ +- javax/rmi \ +- javax/script \ +- javax/security \ +- javax/sound \ +- javax/sql \ +- javax/swing \ +- javax/tools \ +- javax/xml \ +- org/ietf \ +- org/omg \ +- org/w3c/dom \ +- org/xml/sax \ ++ javax \ ++ jdk \ ++ org \ ++ sun \ + # + + SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes +@@ -632,7 +606,6 @@ + $(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \ + SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \ + INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \ +- EXCLUDES := javax/swing/beaninfo, \ + SUFFIXES := .java .c .h, \ + ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \ + EXTRA_DEPS := $(LAUNCHER_ZIP_SRC))) diff --git a/remove-intree-libraries.sh b/java-1.8.0-openjdk-remove-intree-libraries.sh old mode 100644 new mode 100755 similarity index 98% rename from remove-intree-libraries.sh rename to java-1.8.0-openjdk-remove-intree-libraries.sh index 76a4156..1f022f6 --- a/remove-intree-libraries.sh +++ b/java-1.8.0-openjdk-remove-intree-libraries.sh @@ -97,6 +97,8 @@ 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}/cmscam02.c rm -vf ${LCMS_SRC}/cmscgats.c rm -vf ${LCMS_SRC}/cmscnvrt.c @@ -125,3 +127,4 @@ 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 diff --git a/java-1.8.0-openjdk-rh1191652-hotspot-aarch64.patch b/java-1.8.0-openjdk-rh1191652-hotspot-aarch64.patch new file mode 100644 index 0000000..865ecb3 --- /dev/null +++ b/java-1.8.0-openjdk-rh1191652-hotspot-aarch64.patch @@ -0,0 +1,25 @@ +# HG changeset patch +# User andrew +# Date 1424102734 0 +# Mon Feb 16 16:05:34 2015 +0000 +# Node ID 4fdaf786d977aa77afdb68b8829579d31069e39c +# Parent 01a0011cc101f3308c5876db8282c0fc5e3ba2e6 +PR2236: ppc64le should report its os.arch as ppc64le so tools can detect it +Summary: Use ppc64le as the arch directory on that platform and report it in os.arch + +--- openjdk/hotspot/make/defs.make.orig 2015-03-03 17:05:51.000000000 -0500 ++++ openjdk/hotspot/make/defs.make 2015-03-03 19:18:20.000000000 -0500 +@@ -319,6 +319,13 @@ + LIBARCH/ppc64 = ppc64 + LIBARCH/zero = $(ZERO_LIBARCH) + ++ # Override LIBARCH for ppc64le ++ ifeq ($(ARCH), ppc64) ++ ifeq ($(OPENJDK_TARGET_CPU_ENDIAN), little) ++ LIBARCH = ppc64le ++ endif ++ endif ++ + LP64_ARCH += sparcv9 amd64 ia64 ppc64 aarch64 zero + endif + diff --git a/java-1.8.0-openjdk-rh1191652-jdk.patch b/java-1.8.0-openjdk-rh1191652-jdk.patch new file mode 100644 index 0000000..5157f40 --- /dev/null +++ b/java-1.8.0-openjdk-rh1191652-jdk.patch @@ -0,0 +1,63 @@ +diff -r 1fe56343ecc8 make/lib/SoundLibraries.gmk +--- openjdk/jdk/make/lib/SoundLibraries.gmk Tue Jan 12 21:01:12 2016 +0000 ++++ openjdk/jdk/make/lib/SoundLibraries.gmk Wed Jan 13 00:18:02 2016 +0000 +@@ -140,6 +140,10 @@ + LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 + endif + ++ ifeq ($(OPENJDK_TARGET_CPU), ppc64le) ++ LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64LE ++ endif ++ + ifeq ($(OPENJDK_TARGET_CPU), aarch64) + LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64 + endif +diff -r 1fe56343ecc8 src/share/native/com/sun/media/sound/SoundDefs.h +--- openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h Tue Jan 12 21:01:12 2016 +0000 ++++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h Wed Jan 13 00:18:02 2016 +0000 +@@ -44,6 +44,8 @@ + #define X_ARM 7 + #define X_PPC 8 + #define X_AARCH64 9 ++#define X_PPC64 10 ++#define X_PPC64LE 11 + + // ********************************** + // Make sure you set X_PLATFORM and X_ARCH defines correctly. +diff -r 1fe56343ecc8 src/solaris/bin/ppc64le/jvm.cfg +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/jdk/src/solaris/bin/ppc64le/jvm.cfg Wed Jan 13 00:18:02 2016 +0000 +@@ -0,0 +1,33 @@ ++# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# This code is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License version 2 only, as ++# published by the Free Software Foundation. Oracle designates this ++# particular file as subject to the "Classpath" exception as provided ++# by Oracle in the LICENSE file that accompanied this code. ++# ++# This code is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++# version 2 for more details (a copy is included in the LICENSE file that ++# accompanied this code). ++# ++# You should have received a copy of the GNU General Public License version ++# 2 along with this work; if not, write to the Free Software Foundation, ++# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++# or visit www.oracle.com if you need additional information or have any ++# questions. ++# ++# List of JVMs that can be used as an option to java, javac, etc. ++# Order is important -- first in this list is the default JVM. ++# NOTE that this both this file and its format are UNSUPPORTED and ++# WILL GO AWAY in a future release. ++# ++# You may also select a JVM in an arbitrary location with the ++# "-XXaltjvm=" option, but that too is unsupported ++# and may not be available in a future release. ++# ++-server KNOWN diff --git a/java-1.8.0-openjdk-rh1191652-root.patch b/java-1.8.0-openjdk-rh1191652-root.patch new file mode 100644 index 0000000..aa0ce35 --- /dev/null +++ b/java-1.8.0-openjdk-rh1191652-root.patch @@ -0,0 +1,51 @@ +diff -r 59d5dc6a0d95 common/autoconf/hotspot-spec.gmk.in +--- openjdk///common/autoconf/hotspot-spec.gmk.in Wed May 25 13:42:38 2016 +0100 ++++ openjdk///common/autoconf/hotspot-spec.gmk.in Thu May 26 04:43:57 2016 +0100 +@@ -71,6 +71,10 @@ + LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB) + # Set the cpu architecture + ARCH=$(OPENJDK_TARGET_CPU_ARCH) ++# ppc64le uses the HotSpot ppc64 build ++ifeq ($(OPENJDK_TARGET_CPU), ppc64le) ++ ARCH=ppc64 ++endif + # Legacy setting for building for a 64 bit machine. + # If yes then this expands to _LP64:=1 + @LP64@ +diff -r 59d5dc6a0d95 common/autoconf/jdk-options.m4 +--- openjdk///common/autoconf/jdk-options.m4 Wed May 25 13:42:38 2016 +0100 ++++ openjdk///common/autoconf/jdk-options.m4 Thu May 26 04:43:57 2016 +0100 +@@ -158,7 +158,7 @@ + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then + INCLUDE_SA=false + fi +- if test "x$VAR_CPU" = xppc64 ; then ++ if test "x$VAR_CPU" = xppc64 -o "x$VAR_CPU" = xppc64le ; then + INCLUDE_SA=false + fi + if test "x$OPENJDK_TARGET_CPU" = xaarch64; then +diff -r 59d5dc6a0d95 common/autoconf/platform.m4 +--- openjdk///common/autoconf/platform.m4 Wed May 25 13:42:38 2016 +0100 ++++ openjdk///common/autoconf/platform.m4 Thu May 26 04:43:57 2016 +0100 +@@ -67,7 +67,7 @@ + VAR_CPU_ENDIAN=big + ;; + powerpc64le) +- VAR_CPU=ppc64 ++ VAR_CPU=ppc64le + VAR_CPU_ARCH=ppc + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little +diff -r 59d5dc6a0d95 common/autoconf/toolchain.m4 +--- openjdk///common/autoconf/toolchain.m4 Wed May 25 13:42:38 2016 +0100 ++++ openjdk///common/autoconf/toolchain.m4 Thu May 26 04:43:57 2016 +0100 +@@ -1056,6 +1056,9 @@ + else + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" + fi ++ if test "x$OPENJDK_TARGET_CPU" = xppc64le; then ++ CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DABI_ELFv2" ++ fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" + fi diff --git a/java-1.8.0-openjdk-s390-java-opts.patch b/java-1.8.0-openjdk-s390-java-opts.patch new file mode 100644 index 0000000..e2a4313 --- /dev/null +++ b/java-1.8.0-openjdk-s390-java-opts.patch @@ -0,0 +1,46 @@ +--- openjdk.orig/common/autoconf/boot-jdk.m4 2016-01-21 18:33:47.586288044 +0000 ++++ openjdk/common/autoconf/boot-jdk.m4 2016-02-05 15:56:09.012242707 +0000 +@@ -1,5 +1,6 @@ + # + # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. ++# Copyright 2014 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # + # This code is free software; you can redistribute it and/or modify it +@@ -303,6 +323,9 @@ + + AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], + [ ++ # Ensure OPENJDK_TARGET_CPU_ARCH has been setup ++ AC_REQUIRE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET]) ++ + ############################################################################## + # + # Specify options for anything that is run with the Boot JDK. +@@ -325,16 +348,23 @@ + JAVA_FLAGS=$boot_jdk_jvmargs + AC_SUBST(JAVA_FLAGS) + +- + AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) + + # Starting amount of heap memory. +- ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) ++ if test "x$OPENJDK_BUILD_CPU_ARCH" = "xs390"; then ++ ADD_JVM_ARG_IF_OK([-Xms256M],boot_jdk_jvmargs_big,[$JAVA]) ++ else ++ ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) ++ fi + + # Maximum amount of heap memory. + # Maximum stack size. + if test "x$BOOT_JDK_BITS" = x32; then +- JVM_MAX_HEAP=1100M ++ if test "x$OPENJDK_BUILD_CPU_ARCH" = "xs390"; then ++ JVM_MAX_HEAP=768M ++ else ++ JVM_MAX_HEAP=1100M ++ fi + STACK_SIZE=768 + else + # Running Javac on a JVM on a 64-bit machine, takes more space since 64-bit diff --git a/java-1.8.0-openjdk-size_t.patch b/java-1.8.0-openjdk-size_t.patch index b9bf179..c9c6b97 100644 --- a/java-1.8.0-openjdk-size_t.patch +++ b/java-1.8.0-openjdk-size_t.patch @@ -1,7 +1,7 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2013-04-30 11:16:52.049921392 -0400 -@@ -2667,7 +2667,7 @@ void CFLS_LAB::get_from_global_pool(size +--- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -2659,7 +2659,7 @@ void CFLS_LAB::get_from_global_pool(size if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; @@ -11,9 +11,9 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compact assert(n_blks > 0, "Error"); _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl); diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp.size_t 2013-05-03 10:55:50.185800229 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2013-05-03 10:58:09.035801583 -0400 -@@ -950,7 +950,7 @@ void ConcurrentMarkSweepGeneration::comp +--- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -957,7 +957,7 @@ void ConcurrentMarkSweepGeneration::comp if (free_percentage < desired_free_percentage) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity >= capacity(), "invalid expansion size"); @@ -22,7 +22,7 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurr if (PrintGCDetails && Verbose) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); gclog_or_tty->print_cr("\nFrom compute_new_size: "); -@@ -6334,7 +6334,7 @@ void CMSCollector::reset(bool asynch) { +@@ -6575,7 +6575,7 @@ void CMSCollector::reset(bool asynch) { HeapWord* curAddr = _markBitMap.startWord(); while (curAddr < _markBitMap.endWord()) { size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr); @@ -31,7 +31,7 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurr _markBitMap.clear_large_range(chunk); if (ConcurrentMarkSweepThread::should_yield() && !foregroundGCIsActive() && -@@ -6631,7 +6631,7 @@ void CMSMarkStack::expand() { +@@ -6873,7 +6873,7 @@ void CMSMarkStack::expand() { return; } // Double capacity if possible @@ -41,9 +41,9 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurr // get the double capacity that we desired. ReservedSpace rs(ReservedSpace::allocation_align_size_up( diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2013-04-30 11:16:52.049921392 -0400 -@@ -3735,7 +3735,7 @@ void CMTask::drain_local_queue(bool part +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -3902,7 +3902,7 @@ void CMTask::drain_local_queue(bool part // of things to do) or totally (at the very end). size_t target_size; if (partially) { @@ -52,7 +52,7 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.size_ } else { target_size = 0; } -@@ -4566,7 +4566,7 @@ size_t G1PrintRegionLivenessInfoClosure: +@@ -4728,7 +4728,7 @@ size_t G1PrintRegionLivenessInfoClosure: // The > 0 check is to deal with the prev and next live bytes which // could be 0. if (*hum_bytes > 0) { @@ -62,9 +62,9 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp.size_ } return bytes; diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2013-04-30 11:16:52.059921393 -0400 -@@ -1735,7 +1735,7 @@ HeapWord* G1CollectedHeap::expand_and_al +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -1726,7 +1726,7 @@ HeapWord* G1CollectedHeap::expand_and_al verify_region_sets_optional(); @@ -73,34 +73,58 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp.size ergo_verbose1(ErgoHeapSizing, "attempt heap expansion", ergo_format_reason("allocation request failed") -diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp 2013-04-30 11:16:52.059921393 -0400 -@@ -840,7 +840,7 @@ OtherRegionsTable::do_cleanup_work(HRRSC - // This can be done by either mutator threads together with the - // concurrent refinement threads or GC threads. - int HeapRegionRemSet::num_par_rem_sets() { -- return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads); -+ return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), (size_t)ParallelGCThreads); +diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -38,7 +38,7 @@ G1StringDedupQueue::G1StringDedupQueue() + _cancel(false), + _empty(true), + _dropped(0) { +- _nqueues = MAX2(ParallelGCThreads, (size_t)1); ++ _nqueues = MAX2(ParallelGCThreads, (uintx)1); + _queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC); + for (size_t i = 0; i < _nqueues; i++) { + new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size); +diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -110,7 +110,7 @@ public: + }; + + G1StringDedupEntryCache::G1StringDedupEntryCache() { +- _nlists = MAX2(ParallelGCThreads, (size_t)1); ++ _nlists = MAX2(ParallelGCThreads, (uintx)1); + _lists = PaddedArray::create_unfreeable((uint)_nlists); } - HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, -diff -up jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2013-04-30 11:16:52.069921394 -0400 -@@ -69,7 +69,7 @@ ParMarkBitMap::initialize(MemRegion cove - if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) { - _region_start = covered_region.start(); - _region_size = covered_region.word_size(); -- idx_t* map = (idx_t*)_virtual_space->reserved_low_addr(); -+ BitMap::bm_word_t* map = (BitMap::bm_word_t*)_virtual_space->reserved_low_addr(); - _beg_bits.set_map(map); - _beg_bits.set_size(bits / 2); - _end_bits.set_map(map + words / 2); +diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -109,7 +109,7 @@ void HeapRegion::setup_heap_region_size( + if (FLAG_IS_DEFAULT(G1HeapRegionSize)) { + size_t average_heap_size = (initial_heap_size + max_heap_size) / 2; + region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(), +- (uintx) HeapRegionBounds::min_size()); ++ HeapRegionBounds::min_size()); + } + + int region_size_log = log2_long((jlong) region_size); +diff -up jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +--- jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -194,7 +194,7 @@ bool ParScanThreadState::take_from_overf + const size_t num_overflow_elems = of_stack->size(); + const size_t space_available = queue->max_elems() - queue->size(); + const size_t num_take_elems = MIN3(space_available / 4, +- ParGCDesiredObjsFromOverflowList, ++ (size_t)ParGCDesiredObjsFromOverflowList, + num_overflow_elems); + // Transfer the most recent num_take_elems from the overflow + // stack to our work queue. diff -up jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp.size_t 2013-05-03 11:19:28.625892027 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2013-05-03 11:20:15.915892352 -0400 -@@ -874,8 +874,8 @@ void PSParallelCompact::initialize_space +--- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -910,8 +910,8 @@ void PSParallelCompact::initialize_space void PSParallelCompact::initialize_dead_wood_limiter() { const size_t max = 100; @@ -111,22 +135,19 @@ diff -up jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallel _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev); DEBUG_ONLY(_dwl_initialized = true;) _dwl_adjustment = normal_distribution(1.0); -diff -up jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp ---- jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2013-04-30 11:16:52.069921394 -0400 -@@ -188,7 +188,7 @@ bool ParScanThreadState::take_from_overf - const size_t num_overflow_elems = of_stack->size(); - const size_t space_available = queue->max_elems() - queue->size(); - const size_t num_take_elems = MIN3(space_available / 4, -- ParGCDesiredObjsFromOverflowList, -+ (size_t)ParGCDesiredObjsFromOverflowList, - num_overflow_elems); - // Transfer the most recent num_take_elems from the overflow - // stack to our work queue. diff -up jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp.size_t jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp ---- jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp 2013-05-03 10:53:48.105793292 -0400 -@@ -313,7 +313,7 @@ void GenCollectorPolicy::initialize_size +--- jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -385,7 +385,7 @@ void TwoGenerationCollectorPolicy::initi + uintx calculated_size = NewSize + OldSize; + double shrink_factor = (double) MaxHeapSize / calculated_size; + uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment); +- FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size)); ++ FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), (size_t)smaller_new_size)); + _initial_gen0_size = NewSize; + + // OldSize is already aligned because above we aligned MaxHeapSize to +@@ -433,7 +433,7 @@ void GenCollectorPolicy::initialize_size // yield a size that is too small) and bound it by MaxNewSize above. // Ergonomics plays here by previously calculating the desired // NewSize and MaxNewSize. @@ -135,72 +156,58 @@ diff -up jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp.size_t jdk8/hotspo } assert(max_new_size > 0, "All paths should set max_new_size"); -@@ -340,7 +340,7 @@ void GenCollectorPolicy::initialize_size - // generally small compared to the NewRatio calculation. +@@ -455,24 +455,23 @@ void GenCollectorPolicy::initialize_size + // lower limit. _min_gen0_size = NewSize; desired_new_size = NewSize; - max_new_size = MAX2(max_new_size, NewSize); ++ max_new_size = MAX2(max_new_size, (size_t)NewSize); + } else if (FLAG_IS_ERGO(NewSize)) { + // If NewSize is set ergonomically, we should use it as a lower + // limit, but use NewRatio to calculate the initial size. + _min_gen0_size = NewSize; + desired_new_size = +- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); +- max_new_size = MAX2(max_new_size, NewSize); ++ MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize); + max_new_size = MAX2(max_new_size, (size_t)NewSize); } else { // For the case where NewSize is the default, use NewRatio // to size the minimum and initial generation sizes. -@@ -348,10 +348,10 @@ void GenCollectorPolicy::initialize_size + // Use the default NewSize as the floor for these values. If // NewRatio is overly large, the resulting sizes can be too // small. - _min_gen0_size = MAX2(scale_by_NewRatio_aligned(min_heap_byte_size()), -- NewSize); -+ (size_t)NewSize); +- _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize); ++ _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), (size_t)NewSize); desired_new_size = - MAX2(scale_by_NewRatio_aligned(initial_heap_byte_size()), -- NewSize); -+ (size_t)NewSize); - } +- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); +- } ++ MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize); } assert(_min_gen0_size > 0, "Sanity check"); -@@ -407,14 +407,14 @@ bool TwoGenerationCollectorPolicy::adjus - // Adjust gen0 down to accommodate min_gen1_size - *gen0_size_ptr = heap_size - min_gen1_size; - *gen0_size_ptr = -- MAX2((uintx)align_size_down(*gen0_size_ptr, min_alignment()), -+ MAX2((size_t)align_size_down(*gen0_size_ptr, min_alignment()), - min_alignment()); - assert(*gen0_size_ptr > 0, "Min gen0 is too large"); - result = true; - } else { - *gen1_size_ptr = heap_size - *gen0_size_ptr; - *gen1_size_ptr = -- MAX2((uintx)align_size_down(*gen1_size_ptr, min_alignment()), -+ MAX2((size_t)align_size_down(*gen1_size_ptr, min_alignment()), - min_alignment()); - } - } -@@ -438,7 +438,7 @@ void TwoGenerationCollectorPolicy::initi - // for setting the gen1 maximum. - _max_gen1_size = max_heap_byte_size() - _max_gen0_size; - _max_gen1_size = -- MAX2((uintx)align_size_down(_max_gen1_size, min_alignment()), -+ MAX2((size_t)align_size_down(_max_gen1_size, min_alignment()), - min_alignment()); - // If no explicit command line flag has been set for the - // gen1 size, use what is left for gen1. -@@ -452,11 +452,11 @@ void TwoGenerationCollectorPolicy::initi - "gen0 has an unexpected minimum size"); - set_min_gen1_size(min_heap_byte_size() - min_gen0_size()); - set_min_gen1_size( -- MAX2((uintx)align_size_down(_min_gen1_size, min_alignment()), -+ MAX2((size_t)align_size_down(_min_gen1_size, min_alignment()), - min_alignment())); - set_initial_gen1_size(initial_heap_byte_size() - initial_gen0_size()); - set_initial_gen1_size( -- MAX2((uintx)align_size_down(_initial_gen1_size, min_alignment()), -+ MAX2((size_t)align_size_down(_initial_gen1_size, min_alignment()), - min_alignment())); - + _initial_gen0_size = desired_new_size; +@@ -573,7 +572,7 @@ void TwoGenerationCollectorPolicy::initi } else { + // It's been explicitly set on the command line. Use the + // OldSize and then determine the consequences. +- _min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size); ++ _min_gen1_size = MIN2((size_t)OldSize, _min_heap_byte_size - _min_gen0_size); + _initial_gen1_size = OldSize; + + // If the user has explicitly set an OldSize that is inconsistent diff -up jdk8/hotspot/src/share/vm/memory/metaspace.cpp.size_t jdk8/hotspot/src/share/vm/memory/metaspace.cpp ---- jdk8/hotspot/src/share/vm/memory/metaspace.cpp.size_t 2013-05-03 11:11:20.095867337 -0400 -+++ jdk8/hotspot/src/share/vm/memory/metaspace.cpp 2013-05-03 11:13:54.945868245 -0400 -@@ -1164,7 +1164,7 @@ void MetaspaceGC::compute_new_size() { +--- jdk8/hotspot/src/share/vm/memory/metaspace.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/memory/metaspace.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -1455,7 +1455,7 @@ void MetaspaceGC::initialize() { + + void MetaspaceGC::post_initialize() { + // Reset the high-water mark once the VM initialization is done. +- _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize); ++ _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), (size_t)MetaspaceSize); + } + + bool MetaspaceGC::can_expand(size_t word_size, bool is_class) { +@@ -1515,7 +1515,7 @@ void MetaspaceGC::compute_new_size() { (size_t)MIN2(min_tmp, double(max_uintx)); // Don't shrink less than the initial generation size minimum_desired_capacity = MAX2(minimum_desired_capacity, @@ -208,40 +215,48 @@ diff -up jdk8/hotspot/src/share/vm/memory/metaspace.cpp.size_t jdk8/hotspot/src/ + (size_t)MetaspaceSize); if (PrintGCDetails && Verbose) { - const double free_percentage = ((double)free_after_gc) / capacity_until_GC; -@@ -1228,7 +1228,7 @@ void MetaspaceGC::compute_new_size() { + gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); +@@ -1573,7 +1573,7 @@ void MetaspaceGC::compute_new_size() { const double max_tmp = used_after_gc / minimum_used_percentage; size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, - MetaspaceSize); + (size_t)MetaspaceSize); - if (PrintGC && Verbose) { + if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr(" " " maximum_free_percentage: %6.2f" -@@ -2557,7 +2557,7 @@ void Metaspace::global_initialize() { +@@ -3245,7 +3245,7 @@ void Metaspace::global_initialize() { // on the medium chunk list. The next chunk will be small and progress // from there. This size calculated by -version. _first_class_chunk_word_size = MIN2((size_t)MediumChunk*6, -- (ClassMetaspaceSize/BytesPerWord)*2); -+ (size_t)(ClassMetaspaceSize/BytesPerWord)*2); +- (CompressedClassSpaceSize/BytesPerWord)*2); ++ (size_t)(CompressedClassSpaceSize/BytesPerWord)*2); _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size); // Arbitrarily set the initial virtual space to a multiple // of the boot class loader size. diff -up jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp.size_t jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp ---- jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp.size_t 2013-05-03 11:25:27.655916636 -0400 -+++ jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp 2013-05-03 11:26:02.815916940 -0400 -@@ -232,7 +232,7 @@ size_t ThreadLocalAllocBuffer::initial_d - size_t init_sz; +--- jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -238,13 +238,13 @@ size_t ThreadLocalAllocBuffer::initial_d + size_t init_sz = 0; if (TLABSize > 0) { -- init_sz = MIN2(TLABSize / HeapWordSize, max_size()); -+ init_sz = MIN2((size_t)(TLABSize / HeapWordSize), max_size()); - } else if (global_stats() == NULL) { - // Startup issue - main thread initialized before heap initialized. - init_sz = min_size(); +- init_sz = TLABSize / HeapWordSize; ++ init_sz = (size_t)(TLABSize / HeapWordSize); + } else if (global_stats() != NULL) { + // Initial size is a function of the average number of allocating threads. + unsigned nof_threads = global_stats()->allocating_threads_avg(); + +- init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) / +- (nof_threads * target_refills()); ++ init_sz = (size_t)((Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) / ++ (nof_threads * target_refills())); + init_sz = align_object_size(init_sz); + } + init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); diff -up jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.size_t jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp ---- jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp 2013-04-30 11:16:52.069921394 -0400 +--- jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp 2015-06-09 10:21:39.000000000 -0400 @@ -48,7 +48,7 @@ void ObjArrayKlass::objarray_follow_cont const size_t beg_index = size_t(index); assert(beg_index < len || len == 0, "index too large"); @@ -261,9 +276,9 @@ diff -up jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp.size_t jdk8/hot T* const base = (T*)a->base(); T* const beg = base + beg_index; diff -up jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t jdk8/hotspot/src/share/vm/runtime/arguments.cpp ---- jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t 2013-04-23 12:27:07.000000000 -0400 -+++ jdk8/hotspot/src/share/vm/runtime/arguments.cpp 2013-05-03 10:46:37.745763150 -0400 -@@ -1197,7 +1197,7 @@ void Arguments::set_cms_and_parnew_gc_fl +--- jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t 2015-05-19 12:16:26.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/runtime/arguments.cpp 2015-06-09 10:21:39.000000000 -0400 +@@ -1277,7 +1277,7 @@ void Arguments::set_cms_and_parnew_gc_fl // NewSize was set on the command line and it is larger than // preferred_max_new_size. if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line @@ -272,7 +287,7 @@ diff -up jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t jdk8/hotspot/src } else { FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size); } -@@ -1222,8 +1222,8 @@ void Arguments::set_cms_and_parnew_gc_fl +@@ -1302,8 +1302,8 @@ void Arguments::set_cms_and_parnew_gc_fl // Unless explicitly requested otherwise, make young gen // at least min_new, and at most preferred_max_new_size. if (FLAG_IS_DEFAULT(NewSize)) { @@ -283,7 +298,7 @@ diff -up jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t jdk8/hotspot/src if (PrintGCDetails && Verbose) { // Too early to use gclog_or_tty tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); -@@ -1233,7 +1233,7 @@ void Arguments::set_cms_and_parnew_gc_fl +@@ -1313,7 +1313,7 @@ void Arguments::set_cms_and_parnew_gc_fl // so it's NewRatio x of NewSize. if (FLAG_IS_DEFAULT(OldSize)) { if (max_heap > NewSize) { @@ -292,3 +307,15 @@ diff -up jdk8/hotspot/src/share/vm/runtime/arguments.cpp.size_t jdk8/hotspot/src if (PrintGCDetails && Verbose) { // Too early to use gclog_or_tty tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); +diff -up jdk8/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp.size_t jdk8/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp +--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp.size_t 2015-06-09 10:35:04.000000000 -0400 ++++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp 2015-06-09 10:33:21.000000000 -0400 +@@ -117,7 +117,7 @@ size_t G1PageBasedVirtualSpace::uncommit + return reserved_size() - committed_size(); + } + +-size_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const { ++uintptr_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const { + return (addr - _low_boundary) / _page_size; + } + diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 5278556..9a7a5f8 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -1,14 +1,103 @@ -# If debug is 1, OpenJDK is built with all debug info present. -%global debug 0 +# note, parametrised macros are order-senisitve (unlike not-parametrized) even with normal macros +# also necessary when passing it as parameter other macros. If not macro, then it is considered as switch +%global debug_suffix_unquoted -debug +# quoted one for shell operations +%global debug_suffix "%{debug_suffix_unquoted}" +%global normal_suffix "" + +#if you wont only debug build, but providing java, build only normal build, but set normalbuild_parameter +%global debugbuild_parameter slowdebug +%global normalbuild_parameter release +%global debug_warning This package have full debug on. Install only in need, and remove asap. +%global debug_on with full debug on +%global for_debug for packages with debug on + +# by default we build normal build always. +%global include_normal_build 1 +%if %{include_normal_build} +%global build_loop1 %{normal_suffix} +%else +%global build_loop1 %{nil} +%endif + +# by default we build debug build during main build only on intel arches +%ifarch %{ix86} x86_64 +%global include_debug_build 0 +%else +%global include_debug_build 0 +%endif + +# on intels, we build shenandoah htspot +%ifarch x86_64 +%global use_shenandoah_hotspot 1 +%else +%global use_shenandoah_hotspot 0 +%endif + +%if %{include_debug_build} +%global build_loop2 %{debug_suffix} +%else +%global build_loop2 %{nil} +%endif + +# if you disable both builds, then build fails +%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 build +%global rev_build_loop %{build_loop2} %{build_loop1} + +%ifarch %{jit_arches} +%global bootstrap_build 1 +%else +%global bootstrap_build 0 +%endif + +%if %{bootstrap_build} +%global targets bootcycle-images docs +%else +%global targets all +%endif %global aarch64 aarch64 arm64 armv8 -%global multilib_arches %{power64} sparc64 x86_64 %{aarch64} -%global jit_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} - # sometimes we need to distinguish big and little endian PPC64 -# taken from the openjdk-1.7 spec -%global ppc64le ppc64le -%global ppc64be ppc64 ppc64p7 +%global ppc64le ppc64le +%global ppc64be ppc64 ppc64p7 +%global multilib_arches %{power64} sparc64 x86_64 +%global jit_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} + +%ifnarch %{jit_arches} +# Disable hardened build on non-jit arches. Work-around for RHBZ#1290936. +%undefine _hardened_build +%global ourcppflags %{nil} +%global ourldflags %{nil} +%else +%ifarch %{aarch64} +# Disable hardened build on AArch64 as it didn't bootcycle +%undefine _hardened_build +%global ourcppflags "-fstack-protector-strong" +%global ourldflags %{nil} +%else +# Filter out flags from the optflags macro that cause problems with the OpenJDK build +# We filter out -O flags so that the optimisation of HotSpot is not lowered from O3 to O2 +# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) +# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings +# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ +%global ourflags %(echo %{optflags} | sed -e 's|-Wformat|-Wformat -Wno-cpp|') +%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') +%global ourldflags %(echo %{ldflags} | sed -e 's|-Wl,--no-undefined||') +%endif +%endif + +# With diabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path +# the initialisation must be here. LAter the pkg-connfig have bugy behaviour +#looks liekopenjdk RPM specific bug +# Always set this so the nss.cfg file is not broken +%global NSS_LIBDIR %(pkg-config --variable=libdir nss) + +# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 +%global _privatelibs libmawt[.]so.* +%global __noautoprov ^(%{_privatelibs})$ +%global __noautoreq ^(%{_privatelibs})$ %ifarch x86_64 %global archinstall amd64 @@ -16,7 +105,7 @@ %ifarch ppc %global archinstall ppc %endif -%ifarch %{power64} +%ifarch %{ppc64be} %global archinstall ppc64 %endif %ifarch %{ppc64le} @@ -52,13 +141,6 @@ %global archinstall %{_arch} %endif -%if %{debug} -%global debugbuild slowdebug -%else -%global debugbuild release -%endif - -%global buildoutputdir jdk8/build/jdk8.build %{?build_systap}%{?!build_systap:%bcond_without systap} @@ -66,51 +148,47 @@ # specified relative to the directory in which it is installed so that # it will resolve properly within chrooted installations. %global script 'use File::Spec; print File::Spec->abs2rel($ARGV[0], $ARGV[1])' -%global abs2rel %{__perl} -e %{script} +%global abs2rel perl -e %{script} -# Hard-code libdir on 64-bit architectures to make the 64-bit JDK -# simply be another alternative. -%global LIBDIR %{_libdir} -#backuped original one -%ifarch %{multilib_arches} -%global syslibdir %{_prefix}/lib64 -%global _libdir %{_prefix}/lib -%global archname %{name}.%{_arch} -%else -%global syslibdir %{_libdir} -%global archname %{name} -%endif # Standard JPackage naming and versioning defines. %global origin openjdk -%global updatever 60 -%global buildver b16 -%global aarch64_updatever 45 -%global aarch64_buildver b13 -%global aarch64_changesetid aarch64-jdk8u45-b13 -# priority must be 6 digits in total -%global priority 18000%{updatever} +# note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. +%global project aarch64-port +%global repo jdk8u +%global revision aarch64-jdk8u102-b14 +# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) +%global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) +# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 +%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) +# eg jdk8u60-b27 -> b27 +%global buildver %(VERSION=%{revision}; echo ${VERSION##*-}) +# priority must be 7 digits in total. The expression is workarounding tip +%global priority %(TIP=1800%{updatever}; echo ${TIP/tip/999}) + %global javaver 1.8.0 +# parametrized macros are order-sensitive +%global fullversion %{name}-%{version}-%{release} +#images stub +%global j2sdkimage() j2sdk-image +# output dir stub +%global buildoutputdir() %{expand:openjdk/build/jdk8.build%1} +#we can copy the javadoc to not arched dir, or made it not noarch +%global uniquejavadocdir() %{expand:%{fullversion}%1} +#main id and dir of this jdk +%global uniquesuffix() %{expand:%{fullversion}.%{_arch}%1} + # Standard JPackage directories and symbolic links. -# Make 64-bit JDKs just another alternative on 64-bit architectures. -%ifarch %{multilib_arches} -%global sdklnk java-%{javaver}-%{origin}.%{_arch} -%global jrelnk jre-%{javaver}-%{origin}.%{_arch} -%global sdkdir %{name}-%{version}.%{_arch} -%else -%global sdklnk java-%{javaver}-%{origin} -%global jrelnk jre-%{javaver}-%{origin} -%global sdkdir %{name}-%{version} -%endif -%global jredir %{sdkdir}/jre -%global sdkbindir %{_jvmdir}/%{sdklnk}/bin -%global jrebindir %{_jvmdir}/%{jrelnk}/bin -%ifarch %{multilib_arches} -%global jvmjardir %{_jvmjardir}/%{name}-%{version}.%{_arch} -%else -%global jvmjardir %{_jvmjardir}/%{name}-%{version} -%endif +%global sdkdir() %{expand:%{uniquesuffix %%1}} +%global jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%1} + +%global jredir() %{expand:%{sdkdir %%1}/jre} +%global sdkbindir() %{expand:%{_jvmdir}/%{sdkdir %%1}/bin} +%global jrebindir() %{expand:%{_jvmdir}/%{jredir %%1}/bin} +%global jvmjardir() %{expand:%{_jvmjardir}/%{uniquesuffix %%1}} + +%global rpm_state_dir %{_localstatedir}/lib/rpm-state/ %if %{with systap} # Where to install systemtap tapset (links) @@ -125,12 +203,576 @@ %global tapsetdir %{tapsetroot}/tapset/%{_build_cpu} %endif +# not-duplicated scriplets for normal/debug packages +%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%global check_sum_presented_in_spec() %{expand: +md5sum %1 +currentMd5sum=`md5sum %1 | sed "s;\\s.*;;"` +specfile=%{_specdir}/%{name}.spec +grep -e md5sum -A 20 $specfile | grep $currentMd5sum +} + +%global post_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +exit 0 +} + + +%global post_headless() %{expand: +# FIXME: identical binaries are copied, not linked. This needs to be +# fixed upstream. +# The pretrans lua scriptlet prevents an unmodified java.security +# from being replaced via an update. It gets created as +# java.security.rpmnew instead. This invalidates the patch of +# JDK-8061210 of the January 2015 CPU, JDK-8043201 of the +# July 2015 CPU and JDK-8141287 of the January 2016 CPU. We +# fix this via a post scriptlet which runs on updates. +if [ "$1" -gt 1 ]; then + javasecurity="%{_jvmdir}/%{uniquesuffix}/jre/lib/security/java.security" + sum=$(md5sum "${javasecurity}" | cut -d' ' -f1) + # This is the md5sum of an unmodified java.security file + if [ "${sum}" = '1690ac33955594f71dc952c9e83fd396' -o \\ + "${sum}" = 'b138695d0c0ea947e64a21a627d973ba' -o \\ + "${sum}" = 'd17958676bdb9f9d941c8a59655311fb' -o \\ + "${sum}" = '5463aef7dbf0bbcfe79e0336a7f92701' -o \\ + "${sum}" = '400cc64d4dd31f36dc0cc2c701d603db' -o \\ + "${sum}" = '321342219bb130d238ff144b9e5dbfc1' -o \\ + "${sum}" = '134a37a84983b620f4d8d51a550c0c38' -o \\ + "${sum}" = '5ea976e209d0d0b5b6ab148416123e02' ]; then + if [ -f "${javasecurity}.rpmnew" ]; then + mv -f "${javasecurity}.rpmnew" "${javasecurity}" + fi + fi +fi + +%ifarch %{jit_arches} +# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT +%ifnarch %{power64} +#see https://bugzilla.redhat.com/show_bug.cgi?id=513605 +%{jrebindir %%1}/java -Xshare:dump >/dev/null 2>/dev/null +%endif +%endif + +PRIORITY=%{priority} +if [ "%1" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=%{_extension} +alternatives \\ + --install %{_bindir}/java java %{jrebindir %%1}/java $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/jre jre %{_jvmdir}/%{jredir %%1} \\ + --slave %{_jvmjardir}/jre jre_exports %{_jvmjardir}/%{jrelnk %%1} \\ + --slave %{_bindir}/jjs jjs %{jrebindir %%1}/jjs \\ + --slave %{_bindir}/keytool keytool %{jrebindir %%1}/keytool \\ + --slave %{_bindir}/orbd orbd %{jrebindir %%1}/orbd \\ + --slave %{_bindir}/pack200 pack200 %{jrebindir %%1}/pack200 \\ + --slave %{_bindir}/rmid rmid %{jrebindir %%1}/rmid \\ + --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir %%1}/rmiregistry \\ + --slave %{_bindir}/servertool servertool %{jrebindir %%1}/servertool \\ + --slave %{_bindir}/tnameserv tnameserv %{jrebindir %%1}/tnameserv \\ + --slave %{_bindir}/policytool policytool %{jrebindir %%1}/policytool \\ + --slave %{_bindir}/unpack200 unpack200 %{jrebindir %%1}/unpack200 \\ + --slave %{_mandir}/man1/java.1$ext java.1$ext \\ + %{_mandir}/man1/java-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \\ + %{_mandir}/man1/jjs-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\ + %{_mandir}/man1/keytool-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/orbd.1$ext orbd.1$ext \\ + %{_mandir}/man1/orbd-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \\ + %{_mandir}/man1/pack200-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \\ + %{_mandir}/man1/rmid-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\ + %{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/servertool.1$ext servertool.1$ext \\ + %{_mandir}/man1/servertool-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/tnameserv.1$ext tnameserv.1$ext \\ + %{_mandir}/man1/tnameserv-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/policytool.1$ext policytool.1$ext \\ + %{_mandir}/man1/policytool-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\ + %{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1$ext + +for X in %{origin} %{javaver} ; do + alternatives \\ + --install %{_jvmdir}/jre-"$X" \\ + jre_"$X" %{_jvmdir}/%{jredir %%1} $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmjardir}/jre-"$X" \\ + jre_"$X"_exports %{_jvmdir}/%{jredir %%1} +done + +update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1} $PRIORITY --family %{name}.%{_arch} \\ +--slave %{_jvmjardir}/jre-%{javaver} jre_%{javaver}_%{origin}_exports %{jvmjardir %%1} + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +exit 0 +} + +%global postun_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + + +%global postun_headless() %{expand: + alternatives --remove java %{jrebindir %%1}/java + alternatives --remove jre_%{origin} %{_jvmdir}/%{jredir %%1} + alternatives --remove jre_%{javaver} %{_jvmdir}/%{jredir %%1} + alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1} +} + +%global posttrans_script() %{expand: +%{update_desktop_icons} +} + +%global post_devel() %{expand: + +PRIORITY=%{priority} +if [ "%1" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=%{_extension} +alternatives \\ + --install %{_bindir}/javac javac %{sdkbindir %%1}/javac $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir %%1} \\ + --slave %{_jvmjardir}/java java_sdk_exports %{_jvmjardir}/%{sdkdir %%1} \\ + --slave %{_bindir}/appletviewer appletviewer %{sdkbindir %%1}/appletviewer \\ + --slave %{_bindir}/extcheck extcheck %{sdkbindir %%1}/extcheck \\ + --slave %{_bindir}/idlj idlj %{sdkbindir %%1}/idlj \\ + --slave %{_bindir}/jar jar %{sdkbindir %%1}/jar \\ + --slave %{_bindir}/jarsigner jarsigner %{sdkbindir %%1}/jarsigner \\ + --slave %{_bindir}/javadoc javadoc %{sdkbindir %%1}/javadoc \\ + --slave %{_bindir}/javah javah %{sdkbindir %%1}/javah \\ + --slave %{_bindir}/javap javap %{sdkbindir %%1}/javap \\ + --slave %{_bindir}/jcmd jcmd %{sdkbindir %%1}/jcmd \\ + --slave %{_bindir}/jconsole jconsole %{sdkbindir %%1}/jconsole \\ + --slave %{_bindir}/jdb jdb %{sdkbindir %%1}/jdb \\ + --slave %{_bindir}/jdeps jdeps %{sdkbindir %%1}/jdeps \\ + --slave %{_bindir}/jhat jhat %{sdkbindir %%1}/jhat \\ + --slave %{_bindir}/jinfo jinfo %{sdkbindir %%1}/jinfo \\ + --slave %{_bindir}/jmap jmap %{sdkbindir %%1}/jmap \\ + --slave %{_bindir}/jps jps %{sdkbindir %%1}/jps \\ + --slave %{_bindir}/jrunscript jrunscript %{sdkbindir %%1}/jrunscript \\ + --slave %{_bindir}/jsadebugd jsadebugd %{sdkbindir %%1}/jsadebugd \\ + --slave %{_bindir}/jstack jstack %{sdkbindir %%1}/jstack \\ + --slave %{_bindir}/jstat jstat %{sdkbindir %%1}/jstat \\ + --slave %{_bindir}/jstatd jstatd %{sdkbindir %%1}/jstatd \\ + --slave %{_bindir}/native2ascii native2ascii %{sdkbindir %%1}/native2ascii \\ + --slave %{_bindir}/rmic rmic %{sdkbindir %%1}/rmic \\ + --slave %{_bindir}/schemagen schemagen %{sdkbindir %%1}/schemagen \\ + --slave %{_bindir}/serialver serialver %{sdkbindir %%1}/serialver \\ + --slave %{_bindir}/wsgen wsgen %{sdkbindir %%1}/wsgen \\ + --slave %{_bindir}/wsimport wsimport %{sdkbindir %%1}/wsimport \\ + --slave %{_bindir}/xjc xjc %{sdkbindir %%1}/xjc \\ + --slave %{_mandir}/man1/appletviewer.1$ext appletviewer.1$ext \\ + %{_mandir}/man1/appletviewer-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/extcheck.1$ext extcheck.1$ext \\ + %{_mandir}/man1/extcheck-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/idlj.1$ext idlj.1$ext \\ + %{_mandir}/man1/idlj-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\ + %{_mandir}/man1/jar-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\ + %{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\ + %{_mandir}/man1/javac-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\ + %{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/javah.1$ext javah.1$ext \\ + %{_mandir}/man1/javah-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\ + %{_mandir}/man1/javap-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\ + %{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\ + %{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\ + %{_mandir}/man1/jdb-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\ + %{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jhat.1$ext jhat.1$ext \\ + %{_mandir}/man1/jhat-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\ + %{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\ + %{_mandir}/man1/jmap-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\ + %{_mandir}/man1/jps-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\ + %{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jsadebugd.1$ext jsadebugd.1$ext \\ + %{_mandir}/man1/jsadebugd-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\ + %{_mandir}/man1/jstack-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\ + %{_mandir}/man1/jstat-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\ + %{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/native2ascii.1$ext native2ascii.1$ext \\ + %{_mandir}/man1/native2ascii-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\ + %{_mandir}/man1/rmic-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/schemagen.1$ext schemagen.1$ext \\ + %{_mandir}/man1/schemagen-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\ + %{_mandir}/man1/serialver-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/wsgen.1$ext wsgen.1$ext \\ + %{_mandir}/man1/wsgen-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/wsimport.1$ext wsimport.1$ext \\ + %{_mandir}/man1/wsimport-%{uniquesuffix %%1}.1$ext \\ + --slave %{_mandir}/man1/xjc.1$ext xjc.1$ext \\ + %{_mandir}/man1/xjc-%{uniquesuffix %%1}.1$ext + +for X in %{origin} %{javaver} ; do + alternatives \\ + --install %{_jvmdir}/java-"$X" \\ + java_sdk_"$X" %{_jvmdir}/%{sdkdir %%1} $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmjardir}/java-"$X" \\ + java_sdk_"$X"_exports %{_jvmjardir}/%{sdkdir %%1} +done + +update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1} $PRIORITY --family %{name}.%{_arch} \\ +--slave %{_jvmjardir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin}_exports %{_jvmjardir}/%{sdkdir %%1} + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +exit 0 +} + +%global postun_devel() %{expand: + alternatives --remove javac %{sdkbindir %%1}/javac + alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir %%1} + alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir %%1} + alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1} + +update-desktop-database %{_datadir}/applications &> /dev/null || : + +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + +%global posttrans_devel() %{expand: +%{update_desktop_icons} +} + +%global post_javadoc() %{expand: + +PRIORITY=%{priority} +if [ "%1" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api \\ + $PRIORITY --family %{name} +exit 0 +} + +%global postun_javadoc() %{expand: + alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api +exit 0 +} + +%global post_javadoc_zip() %{expand: + +PRIORITY=%{priority} +if [ "%1" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip \\ + $PRIORITY --family %{name} +exit 0 +} + +%global postun_javadoc_zip() %{expand: + alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip +exit 0 +} + +%global files_jre() %{expand: +%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png +%{_datadir}/applications/*policytool%1.desktop +} + + +%global files_jre_headless() %{expand: +%defattr(-,root,root,-) +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/ASSEMBLY_EXCEPTION +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/THIRD_PARTY_README +%dir %{_jvmdir}/%{sdkdir %%1} +%{_jvmdir}/%{jrelnk %%1} +%{_jvmjardir}/%{jrelnk %%1} +%{_jvmprivdir}/* +%{jvmjardir %%1} +%dir %{_jvmdir}/%{jredir %%1}/lib/security +%{_jvmdir}/%{jredir %%1}/lib/security/cacerts +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.security +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/blacklisted.certs +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/logging.properties +%{_mandir}/man1/java-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jjs-%{uniquesuffix %%1}.1* +%{_mandir}/man1/keytool-%{uniquesuffix %%1}.1* +%{_mandir}/man1/orbd-%{uniquesuffix %%1}.1* +%{_mandir}/man1/pack200-%{uniquesuffix %%1}.1* +%{_mandir}/man1/rmid-%{uniquesuffix %%1}.1* +%{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1* +%{_mandir}/man1/servertool-%{uniquesuffix %%1}.1* +%{_mandir}/man1/tnameserv-%{uniquesuffix %%1}.1* +%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1* +%{_mandir}/man1/policytool-%{uniquesuffix %%1}.1* +%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/nss.cfg +%ifarch %{jit_arches} +%ifnarch %{power64} +%attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/classes.jsa +%attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/client/classes.jsa +%endif +%endif +%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/ +%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/client/ +} + +%global files_devel() %{expand: +%defattr(-,root,root,-) +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/ASSEMBLY_EXCEPTION +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/LICENSE +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/THIRD_PARTY_README +%dir %{_jvmdir}/%{sdkdir %%1}/bin +%dir %{_jvmdir}/%{sdkdir %%1}/include +%dir %{_jvmdir}/%{sdkdir %%1}/lib +%{_jvmdir}/%{sdkdir %%1}/bin/* +%{_jvmdir}/%{sdkdir %%1}/include/* +%{_jvmdir}/%{sdkdir %%1}/lib/* +%{_jvmjardir}/%{sdkdir %%1} +%{_datadir}/applications/*jconsole%1.desktop +%{_mandir}/man1/appletviewer-%{uniquesuffix %%1}.1* +%{_mandir}/man1/extcheck-%{uniquesuffix %%1}.1* +%{_mandir}/man1/idlj-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jar-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1* +%{_mandir}/man1/javac-%{uniquesuffix %%1}.1* +%{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1* +%{_mandir}/man1/javah-%{uniquesuffix %%1}.1* +%{_mandir}/man1/javap-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jdb-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jhat-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jmap-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jps-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jsadebugd-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jstack-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jstat-%{uniquesuffix %%1}.1* +%{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1* +%{_mandir}/man1/native2ascii-%{uniquesuffix %%1}.1* +%{_mandir}/man1/rmic-%{uniquesuffix %%1}.1* +%{_mandir}/man1/schemagen-%{uniquesuffix %%1}.1* +%{_mandir}/man1/serialver-%{uniquesuffix %%1}.1* +%{_mandir}/man1/wsgen-%{uniquesuffix %%1}.1* +%{_mandir}/man1/wsimport-%{uniquesuffix %%1}.1* +%{_mandir}/man1/xjc-%{uniquesuffix %%1}.1* +%if %{with systap} +%dir %{tapsetroot} +%dir %{tapsetdir} +%{tapsetdir}/*%{version}-%{release}.%{_arch}%1.stp +%dir %{_jvmdir}/%{sdkdir %%1}/tapset +%{_jvmdir}/%{sdkdir %%1}/tapset/*.stp +%endif +} + +%global files_demo() %{expand: +%defattr(-,root,root,-) +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE +} + +%global files_src() %{expand: +%defattr(-,root,root,-) +%doc README.src +%{_jvmdir}/%{sdkdir %%1}/src.zip +} + +%global files_javadoc() %{expand: +%defattr(-,root,root,-) +%doc %{_javadocdir}/%{uniquejavadocdir %%1} +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE +} + +%global files_javadoc_zip() %{expand: +%defattr(-,root,root,-) +%doc %{_javadocdir}/%{uniquejavadocdir %%1}.zip +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE +} + +%global files_accessibility() %{expand: +%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so +%{_jvmdir}/%{jredir %%1}/lib/ext/java-atk-wrapper.jar +%{_jvmdir}/%{jredir %%1}/lib/accessibility.properties +} + +# not-duplicated requires/provides/obsolate for normal/debug packages +%global java_rpo() %{expand: +Requires: fontconfig +Requires: x11-font-type1 + +# Requires rest of java +Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} + + +# Standard JPackage base provides. +Provides: jre-%{javaver}-%{origin}%1 = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}%1 = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}%1 = %{epoch}:%{version}-%{release} +Provides: jre = %{javaver}%1 +Provides: java-%{origin}%1 = %{epoch}:%{version}-%{release} +Provides: java%1 = %{epoch}:%{javaver} +# Standard JPackage extensions provides. +Provides: java-fonts%1 = %{epoch}:%{version} + +Obsoletes: java-1.7.0-openjdk%1 +} + +%global java_headless_rpo() %{expand: +# Require /etc/pki/java/cacerts. +#Requires: ca-certificates +Requires: rootcerts-java +# Require jpackage-utils for ownership of /usr/lib/jvm/ +Requires: jpackage-utils +# Require zoneinfo data provided by tzdata-java subpackage. +Requires: timezone-java >= 2015d +# libsctp.so.1 is being `dlopen`ed on demand +Requires: lksctp-tools +# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum eforce it, not rpm transaction and so no configs are persisted when pure rpm -u is run. I t may be consiedered as regression +Requires: copy-jdk-configs >= 1.1-1 +#OrderWithRequires: copy-jdk-configs +# Post requires alternatives to install tool alternatives. +Requires(post): update-alternatives +# in version 1.7 and higher for --family switch +Requires(post): chkconfig >= 1.7-3 +# Postun requires alternatives to uninstall tool alternatives. +Requires(postun): update-alternatives +# in version 1.7 and higher for --family switch +Requires(postun): chkconfig >= 1.7-3 + +# Standard JPackage base provides. +Provides: jre-%{javaver}-%{origin}-headless%1 = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}-headless%1 = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} +Provides: jre-headless%1 = %{epoch}:%{javaver} +Provides: java-%{origin}-headless%1 = %{epoch}:%{version}-%{release} +Provides: java-headless%1 = %{epoch}:%{javaver} +# Standard JPackage extensions provides. +Provides: jndi%1 = %{epoch}:%{version} +Provides: jndi-ldap%1 = %{epoch}:%{version} +Provides: jndi-cos%1 = %{epoch}:%{version} +Provides: jndi-rmi%1 = %{epoch}:%{version} +Provides: jndi-dns%1 = %{epoch}:%{version} +Provides: jaas%1 = %{epoch}:%{version} +Provides: jsse%1 = %{epoch}:%{version} +Provides: jce%1 = %{epoch}:%{version} +Provides: jdbc-stdext%1 = 4.1 +Provides: java-sasl%1 = %{epoch}:%{version} + +Obsoletes: java-1.7.0-openjdk-headless%1 +} + +%global java_devel_rpo() %{expand: +# Require base package. +Requires: %{name}%1 = %{epoch}:%{version}-%{release} +#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +# Post requires alternatives to install tool alternatives. +Requires(post): update-alternatives +# in version 1.7 and higher for --family switch +Requires(post): chkconfig >= 1.7-3 +# Postun requires alternatives to uninstall tool alternatives. +Requires(postun): update-alternatives +# in version 1.7 and higher for --family switch +Requires(postun): chkconfig >= 1.7-3 + +# Standard JPackage devel provides. +Provides: java-sdk-%{javaver}-%{origin}%1 = %{epoch}:%{version} +Provides: java-sdk-%{javaver}%1 = %{epoch}:%{version} +Provides: java-sdk-%{origin}%1 = %{epoch}:%{version} +Provides: java-sdk%1 = %{epoch}:%{javaver} +Provides: java-%{javaver}-devel%1 = %{epoch}:%{version} +Provides: java-devel-%{origin}%1 = %{epoch}:%{version} +Provides: java-devel%1 = %{epoch}:%{javaver} + +Obsoletes: java-1.7.0-openjdk-devel%1 +} + + +%global java_demo_rpo() %{expand: +Requires: %{name}%1 = %{epoch}:%{version}-%{release} +#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} + +Obsoletes: java-1.7.0-openjdk-demo%1 +} + +%global java_javadoc_rpo() %{expand: +#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +# Post requires alternatives to install javadoc alternative. +Requires(post): update-alternatives +# in version 1.7 and higher for --family switch +Requires(post): chkconfig >= 1.7-3 +# Postun requires alternatives to uninstall javadoc alternative. +Requires(postun): update-alternatives +# in version 1.7 and higher for --family switch +Requires(postun): chkconfig >= 1.7-3 + +# Standard JPackage javadoc provides. +Provides: java-javadoc%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-javadoc%1 = %{epoch}:%{version}-%{release} + +Obsoletes: java-1.7.0-openjdk-javadoc%1 + +} + +%global java_src_rpo() %{expand: +Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} + +Obsoletes: java-1.7.0-openjdk-src%1 +} + +%global java_accessibility_rpo() %{expand: +Requires: java-atk-wrapper +Requires: %{name}%1 = %{epoch}:%{version}-%{release} +#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} + +Obsoletes: java-1.7.0-openjdk-accessibility%1 +} + # Prevent brp-java-repack-jars from being run. %global __jar_repack 0 Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 1.%{buildver} +Release: 1.%{buildver}.1 # 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 @@ -147,93 +789,152 @@ Group: Development/Java License: ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and MPLv1.1 and Public Domain and W3C URL: http://openjdk.java.net/ -# Source from upstrem OpenJDK8 project. To regenerate, use -# ./generate_source_tarball.sh jdk8u jdk8u jdk8u%{updatever}-%{buildver} -# ./generate_source_tarball.sh aarch64-port jdk8 jdk8u%{aarch64_updatever}-%{aarch64_buildver}-aarch64 -Source0: jdk8u-jdk8u%{updatever}-%{buildver}.tar.xz -Source1: jdk8-jdk8u%{aarch64_updatever}-%{aarch64_buildver}-%{aarch64_changesetid}.tar.xz +# aarch64-port now contains integration forest of both aarch64 and normal jdk +# Source from upstream OpenJDK8 project. To regenerate, use +# VERSION=aarch64-jdk8u101-b14 FILE_NAME_ROOT=aarch64-port-jdk8u-${VERSION} +# REPO_ROOT= generate_source_tarball.sh +# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} +Source0: %{project}-%{repo}-%{revision}.tar.xz + +# Additional source needed to build under Mageia +Source1: e8d009c4e4e7.tar.bz2 # Custom README for -src subpackage Source2: README.src -Source3: java-abrt-launcher.in +# Script to generate Source1 (requires mercurial) +Source3: mga-add-missing-files.sh # Use 'generate_tarballs.sh' to generate the following tarballs # They are based on code contained in the IcedTea7 project. # Systemtap tapsets. Zipped up to keep it small. -Source8: systemtap-tapset.tar.gz +Source8: systemtap-tapset-3.1.0.tar.xz # Desktop files. Adapated from IcedTea. Source9: jconsole.desktop.in Source10: policytool.desktop.in -# Keep this file the same among different openjdk projects (7, 8, etc.) -# or switch to alternatives -Source78: openjdk-java.desktop - # nss configuration file Source11: nss.cfg # Removed libraries that we link instead -Source12: remove-intree-libraries.sh +Source12: %{name}-remove-intree-libraries.sh # Ensure we aren't using the limited crypto policy Source13: TestCryptoLevel.java +# Ensure ECDSA is working +Source14: TestECDSA.java + +Source20: repackReproduciblePolycies.sh + # New versions of config files with aarch64 support. This is not upstream yet. Source100: config.guess Source101: config.sub - -Source200: java-1.8.0-openjdk.rpmlintrc +# shenandoah hotpost +Source999: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u102-b14.tar.xz # RPM/distribution specific patches +# Accessibility patches # Ignore AWTError when assistive technologies are loaded Patch1: %{name}-accessible-toolkit.patch - -# RHBZ 1015432 -Patch2: 1015432.patch # Restrict access to java-atk-wrapper classes Patch3: java-atk-wrapper-security.patch -# RHBZ 808293 -Patch4: PStack-808293.patch -# Allow multiple initialization of PKCS11 libraries +# Upstreamable patches +# PR2737: Allow multiple initialization of PKCS11 libraries Patch5: multiple-pkcs11-library-init.patch -# Disable doclint for compatibility -Patch6: disable-doclint-by-default.patch - -# -# OpenJDK specific patches -# - -# Allow icedtea-web to build -Patch99: applet-hole.patch - -# Recognize s390/s390x -Patch100: %{name}-s390.patch -# Type fixing for s390 -Patch101: %{name}-bitmap.patch -Patch102: %{name}-size_t.patch - -# Patch for PPC/PPC64 -Patch103: %{name}-ppc-zero-hotspot.patch - -Patch201: system-libjpeg.patch -Patch202: system-libpng.patch -Patch203: system-lcms.patch - -Patch302: java-1.8.0-openjdk-giflib5.1.patch - -# Fixed in upstream 9. See upstream bug: -# https://bugs.openjdk.java.net/browse/JDK-8067331 -# Patch402: atomic_linux_zero.inline.hpp.patch -# Fixes StackOverflowError on ARM32 bit Zero. See RHBZ#1206656 -Patch403: rhbz1206656_fix_current_stack_pointer.patch # Rely on nanoTime to get Thread.join working when clock is stopped or set back Patch501: java-1.8.0-openjdk-use-nanoTime_in_thread-join.patch -Patch503: d318d83c4e74.patch + +# PR2095, RH1163501: 2048-bit DH upper bound too small for Fedora infrastructure (sync with IcedTea 2.x) +Patch504: rh1163501.patch +# S4890063, PR2304, RH1214835: HPROF: default text truncated when using doe=n option +Patch511: rh1214835.patch +# Turn off strict overflow on IndicRearrangementProcessor{,2}.cpp following 8140543: Arrange font actions +Patch512: no_strict_overflow.patch +# Support for building the SunEC provider with the system NSS installation +# PR1983: Support using the system installation of NSS with the SunEC provider +# PR2127: SunEC provider crashes when built using system NSS +# PR2815: Race condition in SunEC provider with system NSS +# PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed +# PR2934: SunEC provider throwing KeyException with current NSS +Patch513: pr1983-jdk.patch +Patch514: pr1983-root.patch +Patch515: pr2127.patch +Patch516: pr2815.patch +Patch517: pr2899.patch +Patch518: pr2934.patch +# S8150954, RH1176206, PR2866: Taking screenshots on x11 composite desktop produces wrong result +# In progress: http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010742.html +Patch508: rh1176206-jdk.patch +Patch509: rh1176206-root.patch +# RH1337583, PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings +Patch523: pr2974-rh1337583.patch +# PR3083, RH1346460: Regression in SSL debug output without an ECC provider +Patch528: pr3083-rh1346460.patch + +# Arch-specific upstreamable patches +# PR2415: JVM -Xmx requirement is too high on s390 +Patch100: %{name}-s390-java-opts.patch +# Type fixing for s390 +Patch102: %{name}-size_t.patch +# Use "%z" for size_t on s390 as size_t != intptr_t +Patch103: s390-size_t_format_flags.patch + +# Patches which need backporting to 8u +# S8073139, RH1191652; fix name of ppc64le architecture +Patch601: %{name}-rh1191652-root.patch +Patch602: %{name}-rh1191652-jdk.patch +Patch603: %{name}-rh1191652-hotspot-aarch64.patch +# Include all sources in src.zip +Patch7: include-all-srcs.patch +# 8035341: Allow using a system installed libpng +Patch202: system-libpng.patch +# 8042159: Allow using a system-installed lcms2 +Patch203: system-lcms.patch +# PR2462: Backport "8074839: Resolve disabled warnings for libunpack and the unpack200 binary" +# This fixes printf warnings that lead to build failure with -Werror=format-security from optflags +Patch502: pr2462.patch +# S8148351, PR2842: Only display resolved symlink for compiler, do not change path +Patch506: pr2842-01.patch +Patch507: pr2842-02.patch +# S8154313: Generated javadoc scattered all over the place +Patch400: 8154313.patch +# S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate +Patch526: 6260348-pr3066.patch +# S8157306, PR3121, RH1360863: Random infrequent null pointer exceptions in javac +Patch531: 8157306-pr3121-rh1360863.patch +# S8162384, PR3122, RH1358661: Performance regression: bimorphic inlining may be bypassed by type speculation +Patch532: 8162384-pr3122-rh1358661.patch + +# Patches upstream and appearing in 8u111 +# S8159244, PR3074: Partially initialized string object created by C2's string concat optimization may escape +Patch527: 8159244-pr3074.patch + +# Patches upstream and appearing in 8u112 +# S8044762, PR2960: com/sun/jdi/OptionTest.java test time out +Patch521: 8044762-pr2960.patch +# S8049226, PR2960: com/sun/jdi/OptionTest.java test times out again +Patch522: 8049226-pr2960.patch +# 8154210: Zero: Better byte behaviour +Patch606: 8154210.patch +# S8158260, PR2991, RH1341258: JVM on PPC64 LE crashes due to an illegal instruction in JITed code +Patch524: 8158260-pr2991-rh1341258.patch + +# Patches ineligible for 8u +# 8043805: Allow using a system-installed libjpeg +Patch201: system-libjpeg.patch + +# Local fixes +# PR1834, RH1022017: Reduce curves reported by SSL to those in NSS +Patch525: pr1834-rh1022017.patch +# Temporary fix for typo in CORBA security patch +Patch529: corba_typo_fix.patch + +# Non-OpenJDK fixes BuildRequires: autoconf BuildRequires: automake @@ -255,150 +956,195 @@ BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xtst) +BuildRequires: libxslt-devel +# Requirements for setting up the nss.cfg +BuildRequires: nss-devel BuildRequires: pkgconfig BuildRequires: pkgconfig(xproto) -#BuildRequires: redhat-lsb BuildRequires: zip -# OpenJDK X officially requires OpenJDK (X-1) to build -BuildRequires: java-1.7.0-openjdk-devel +BuildRequires: java-1.8.0-openjdk-devel # Zero-assembler build requirement. %ifnarch %{jit_arches} BuildRequires: pkgconfig(libffi) %endif +BuildRequires: timezone-java >= 2015d +BuildRequires: patch >= 2.7.5 +# Earlier versions have a bug in tree vectorization on PPC +BuildRequires: gcc >= 4.8.3-8 # cacerts build requirement. BuildRequires: openssl -# execstack build requirement. -# no prelink on ARM yet -%ifnarch %{arm} %{aarch64} ppc64le -BuildRequires: prelink -%endif %if %{with systap} BuildRequires: systemtap %endif -# Requires rest of java -Requires: %{name}-headless = %{epoch}:%{version}-%{release} - -# Standard JPackage base provides. -Provides: jre-%{javaver}-%{origin} = %{epoch}:%{version}-%{release} -Provides: jre-%{origin} = %{epoch}:%{version}-%{release} -Provides: jre-%{javaver} = %{epoch}:%{version}-%{release} -Provides: java-%{javaver} = %{epoch}:%{version}-%{release} -Provides: jre = %{javaver} -Provides: java-%{origin} = %{epoch}:%{version}-%{release} -Provides: java = %{epoch}:%{javaver} -# Standard JPackage extensions provides. -Provides: java-fonts = %{epoch}:%{version} +# this is built always, also during debug-only build +# when it is built in debug-only, then this package is just placeholder +%{java_rpo %{nil}} %description The OpenJDK runtime environment. +%if %{include_debug_build} +%package debug +Summary: OpenJDK Runtime Environment %{debug_on} +Group: Development/Java +%{java_rpo %{debug_suffix_unquoted}} +%description debug +The OpenJDK runtime environment. +%{debug_warning} +%endif + +%if %{include_normal_build} %package headless Summary: OpenJDK Runtime Environment Group: Development/Java -# Require /etc/pki/java/cacerts. -Requires: rootcerts-java -# Require jpackage-utils for ownership of /usr/lib/jvm/ -Requires: jpackage-utils -# Require zoneinfo data provided by tzdata-java subpackage. -Requires: tzdata-java -# Post requires alternatives to install tool alternatives. -Requires(post): %{_sbindir}/alternatives -# Postun requires alternatives to uninstall tool alternatives. -Requires(postun): %{_sbindir}/alternatives - -# Standard JPackage base provides. -Provides: jre-%{javaver}-%{origin}-headless = %{epoch}:%{version}-%{release} -Provides: jre-%{origin}-headless = %{epoch}:%{version}-%{release} -Provides: jre-%{javaver}-headless = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}-headless = %{epoch}:%{version}-%{release} -Provides: jre-headless = %{javaver} -Provides: java-%{origin}-headless = %{epoch}:%{version}-%{release} -Provides: java-headless = %{epoch}:%{javaver} -# Standard JPackage extensions provides. -Provides: jndi = %{epoch}:%{version} -Provides: jndi-ldap = %{epoch}:%{version} -Provides: jndi-cos = %{epoch}:%{version} -Provides: jndi-rmi = %{epoch}:%{version} -Provides: jndi-dns = %{epoch}:%{version} -Provides: jaas = %{epoch}:%{version} -Provides: jsse = %{epoch}:%{version} -Provides: jce = %{epoch}:%{version} -Provides: jdbc-stdext = 4.1 -Provides: java-sasl = %{epoch}:%{version} +%{java_headless_rpo %{nil}} %description headless The OpenJDK runtime environment without audio and video support. +%endif +%if %{include_debug_build} +%package headless-debug +Summary: OpenJDK Runtime Environment %{debug_on} +Group: Development/Java +%{java_headless_rpo %{debug_suffix_unquoted}} + +%description headless-debug +The OpenJDK runtime environment without audio and video support. +%{debug_warning} +%endif + +%if %{include_normal_build} %package devel Summary: OpenJDK Development Environment Group: Development/Java -# Require base package. -Requires: %{name} = %{epoch}:%{version}-%{release} -# Post requires alternatives to install tool alternatives. -Requires(post): %{_sbindir}/alternatives -# Postun requires alternatives to uninstall tool alternatives. -Requires(postun): %{_sbindir}/alternatives - -# Standard JPackage devel provides. -Provides: java-sdk-%{javaver}-%{origin} = %{epoch}:%{version} -Provides: java-sdk-%{javaver} = %{epoch}:%{version} -Provides: java-sdk-%{origin} = %{epoch}:%{version} -Provides: java-sdk = %{epoch}:%{javaver} -Provides: java-%{javaver}-devel = %{epoch}:%{version} -Provides: java-devel-%{origin} = %{epoch}:%{version} -Provides: java-devel = %{epoch}:%{javaver} - +%{java_devel_rpo %{nil}} %description devel The OpenJDK development tools. +%endif +%if %{include_debug_build} +%package devel-debug +Summary: OpenJDK Development Environment %{debug_on} +Group: Development/Tools + +%{java_devel_rpo %{debug_suffix_unquoted}} + +%description devel-debug +The OpenJDK development tools. +%{debug_warning} +%endif + +%if %{include_normal_build} %package demo Summary: OpenJDK Demos Group: Development/Java -Requires: %{name} = %{epoch}:%{version}-%{release} +%{java_demo_rpo %{nil}} %description demo The OpenJDK demos. +%endif +%if %{include_debug_build} +%package demo-debug +Summary: OpenJDK Demos %{debug_on} +Group: Development/Java + +%{java_demo_rpo %{debug_suffix_unquoted}} + +%description demo-debug +The OpenJDK demos. +%{debug_warning} +%endif + +%if %{include_normal_build} %package src Summary: OpenJDK Source Bundle Group: Development/Java -Requires: %{name} = %{epoch}:%{version}-%{release} +%{java_src_rpo %{nil}} %description src The OpenJDK source bundle. +%endif +%if %{include_debug_build} +%package src-debug +Summary: OpenJDK Source Bundle %{for_debug} +Group: Development/Java + +%{java_src_rpo %{debug_suffix_unquoted}} + +%description src-debug +The OpenJDK source bundle %{for_debug}. +%endif + +%if %{include_normal_build} %package javadoc Summary: OpenJDK API Documentation -Group: Development/Java +Group: Documentation Requires: jpackage-utils BuildArch: noarch -# Post requires alternatives to install javadoc alternative. -Requires(post): %{_sbindir}/alternatives -# Postun requires alternatives to uninstall javadoc alternative. -Requires(postun): %{_sbindir}/alternatives - -# Standard JPackage javadoc provides. -Provides: java-javadoc = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}-javadoc = %{epoch}:%{version}-%{release} +%{java_javadoc_rpo %{nil}} %description javadoc The OpenJDK API documentation. +%endif + +%if %{include_normal_build} +%package javadoc-zip +Summary: OpenJDK API Documentation compressed in single archive +Group: Documentation +Requires: javapackages-tools +BuildArch: noarch + +%{java_javadoc_rpo %{nil}} + +%description javadoc-zip +The OpenJDK API documentation compressed in single archive. +%endif + +%if %{include_debug_build} +%package javadoc-debug +Summary: OpenJDK API Documentation %{for_debug} +Group: Documentation +Requires: jpackage-utils +BuildArch: noarch + +%{java_javadoc_rpo %{debug_suffix_unquoted}} + +%description javadoc-debug +The OpenJDK API documentation %{for_debug}. +%endif + +%if %{include_debug_build} +%package javadoc-zip-debug +Summary: OpenJDK API Documentation compressed in single archive %{for_debug} +Group: Documentation +Requires: javapackages-tools +BuildArch: noarch + +%{java_javadoc_rpo %{debug_suffix_unquoted}} + +%description javadoc-zip-debug +The OpenJDK API documentation compressed in single archive %{for_debug}. +%endif +%if %{include_normal_build} %package accessibility Summary: OpenJDK accessibility connector -Requires: java-atk-wrapper -Requires: %{name} = %{epoch}:%{version}-%{release} + +%{java_accessibility_rpo %{nil}} %description accessibility Enables accessibility support in OpenJDK by using java-atk-wrapper. This allows @@ -409,24 +1155,64 @@ Please note, the java-atk-wrapper is still in beta, and OpenJDK itself is still being tuned to be working with accessibility features. There are known issues with accessibility on, so please do not install this package unless you really need to. - - -%prep -%ifarch %{aarch64} -%global source_num 1 -%else -%global source_num 0 %endif -%setup -q -c -n %{name} -T -a %{source_num} +%if %{include_debug_build} +%package accessibility-debug +Summary: OpenJDK accessibility connector %{for_debug} + +%{java_accessibility_rpo %{debug_suffix_unquoted}} + +%description accessibility-debug +See normal java-%{version}-openjdk-accessibility description. +%endif + +%prep +if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then + echo "include_normal_build is %{include_normal_build}" +else + echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no" + exit 11 +fi +if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then + echo "include_debug_build is %{include_debug_build}" +else + echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no" + exit 12 +fi +if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then + echo "you have disabled both include_debug_build and include_debug_build. no go." + exit 13 +fi +%setup -q -c -n %{uniquesuffix ""} -T -a 0 +# Add the missing files to be able to build under Mageia +tar xjf %{SOURCE1} -C openjdk/jdk --strip-components=1 --overwrite +# https://bugzilla.redhat.com/show_bug.cgi?id=1189084 +prioritylength=`expr length %{priority}` +if [ $prioritylength -ne 7 ] ; then + echo "priority must be 7 digits in total, violated" + exit 14 +fi +# For old patches +ln -s openjdk jdk8 +%if %{use_shenandoah_hotspot} +#on intels, repalce hotpost by shenandoah-able hotspot +pushd openjdk +tar -xf %{SOURCE999} +rm -rf hotspot +cp -r openjdk/hotspot . +rm -rf openjdk +popd +%endif + cp %{SOURCE2} . # replace outdated configure guess script # # the configure macro will do this too, but it also passes a few flags not # supported by openjdk configure script -cp %{SOURCE100} jdk8/common/autoconf/build-aux/ -cp %{SOURCE101} jdk8/common/autoconf/build-aux/ +cp %{SOURCE100} openjdk/common/autoconf/build-aux/ +cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # OpenJDK patches @@ -438,108 +1224,163 @@ sh %{SOURCE12} %patch203 %patch1 -%patch2 %patch3 -%patch4 %patch5 -%patch6 +%patch7 -%patch99 - -# Type fixes for s390 -%ifarch s390 s390x +# s390 build fixes %patch100 -%patch101 %patch102 -%endif - -%ifarch ppc %{power64} -# PPC fixes %patch103 -%endif - -%patch403 %patch501 -%patch503 + +# ppc64le fixes +%patch524 + +# Zero fixes. +%patch606 + +%patch603 +%patch601 +%patch602 + +%patch502 +%patch504 +%patch506 +%patch507 +%patch508 +%patch509 +%patch511 +%patch512 +#patch513 +#patch514 +#patch515 +#patch516 +#patch517 +%patch400 +%patch521 +%patch522 +%patch523 +%patch525 +%patch526 +%patch527 +%patch528 +%patch529 +%patch531 +%patch532 # Extract systemtap tapsets %if %{with systap} +tar -x -I xz -f %{SOURCE8} +%if %{include_debug_build} +cp -r tapset tapset%{debug_suffix} +%endif -tar xzf %{SOURCE8} -for file in tapset/*.in; do - - OUTPUT_FILE=`echo $file | sed -e s:\.in$::g` - sed -e s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}/server/libjvm.so:g $file > $file.1 -# TODO find out which architectures other than ix86 have a client vm +for suffix in %{build_loop} ; do + for file in "tapset"$suffix/*.in; do + OUTPUT_FILE=`echo $file | sed -e s:%{javaver}\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g` + sed -e s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/server/libjvm.so:g $file > $file.1 +# TODO find out which architectures other than i686 have a client vm %ifarch %{ix86} - sed -e s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}/client/libjvm.so:g $file.1 > $OUTPUT_FILE + sed -e s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/client/libjvm.so:g $file.1 > $OUTPUT_FILE %else sed -e '/@ABS_CLIENT_LIBJVM_SO@/d' $file.1 > $OUTPUT_FILE %endif - sed -i -e s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir}:g $OUTPUT_FILE + sed -i -e s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir $suffix}:g $OUTPUT_FILE sed -i -e s:@INSTALL_ARCH_DIR@:%{archinstall}:g $OUTPUT_FILE - + sed -i -e s:@prefix@:%{_jvmdir}/%{sdkdir $suffix}/:g $OUTPUT_FILE + done done - +# systemtap tapsets ends %endif # Prepare desktop files +for suffix in %{build_loop} ; do for file in %{SOURCE9} %{SOURCE10} ; do - OUTPUT_FILE=`basename $file | sed -e s:\.in$::g` - sed -e s:@JAVA_HOME@:%{_jvmdir}/%{sdkdir}:g $file > $OUTPUT_FILE - sed -i -e s:@VERSION@:%{version}-%{release}.%{_arch}:g $OUTPUT_FILE + FILE=`basename $file | sed -e s:\.in$::g` + EXT="${FILE##*.}" + NAME="${FILE%.*}" + OUTPUT_FILE=$NAME$suffix.$EXT + sed -e s:#JAVA_HOME#:%{sdkbindir $suffix}:g $file > $OUTPUT_FILE + sed -i -e s:#JRE_HOME#:%{jrebindir $suffix}:g $OUTPUT_FILE + sed -i -e s:#ARCH#:%{version}-%{release}.%{_arch}$suffix:g $OUTPUT_FILE done +done + +# this is check which controls, that latest java.security is included in post(_headless) +%{check_sum_presented_in_spec openjdk/jdk/src/share/lib/security/java.security-linux} + %build # How many cpu's do we have? -export NUM_PROC=`/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :` +export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} +%if 0%{?_smp_ncpus_max} +# Honor %%_smp_ncpus_max +[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} +%endif # Build IcedTea and OpenJDK. -%ifarch s390x sparc64 alpha %{power64} +%ifarch s390x sparc64 alpha %{power64} %{aarch64} export ARCH_DATA_MODEL=64 %endif %ifarch alpha export CFLAGS="$CFLAGS -mieee" %endif -(cd jdk8/common/autoconf +# We use ourcppflags because the OpenJDK build seems to +# pass EXTRA_CFLAGS to the HotSpot C++ compiler... +# Explicitly set the C++ standard as the default has changed on GCC >= 6 +EXTRA_CFLAGS="%ourcppflags -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks " +#-fno-lifetime-dse" +EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks " +#-fno-lifetime-dse" +%ifarch %{power64} ppc +# fix rpmlint warnings +EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" +%endif +export EXTRA_CFLAGS + +(cd openjdk/common/autoconf bash ./autogen.sh ) -mkdir -p %{buildoutputdir} +for suffix in %{build_loop} ; do +if [ "$suffix" = "%{debug_suffix}" ] ; then +debugbuild=%{debugbuild_parameter} +else +debugbuild=%{normalbuild_parameter} +fi -pushd %{buildoutputdir} +mkdir -p %{buildoutputdir $suffix} +pushd %{buildoutputdir $suffix} bash ../../configure \ %ifnarch %{jit_arches} --with-jvm-variants=zero \ -%endif -%ifarch %{aarch64} - --with-jvm-variants=client \ - --disable-precompiled-headers \ %endif --disable-zip-debug-info \ --with-milestone="fcs" \ --with-update-version=%{updatever} \ --with-build-number=%{buildver} \ -%ifarch %{aarch64} - --with-user-release-suffix="aarch64-%{aarch64_updatever}-%{aarch64_buildver}" \ -%endif --with-boot-jdk=/usr/lib/jvm/java-openjdk \ - --with-debug-level=%{debugbuild} \ + --with-debug-level=$debugbuild \ --enable-unlimited-crypto \ --with-zlib=system \ --with-libjpeg=system \ --with-giflib=system \ --with-libpng=system \ - --with-lcms=system \ + --with-lcms=bundled \ --with-stdc++lib=dynamic \ - --with-num-cores="$NUM_PROC" \ - --with-extra-cflags="-fno-devirtualize" \ - --with-extra-cxxflags="-fno-devirtualize" + --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \ + --with-extra-cflags="$EXTRA_CFLAGS" \ + --with-extra-ldflags="%{ourldflags}" \ + --with-num-cores="$NUM_PROC" + +cat spec.gmk +cat hotspot-spec.gmk # The combination of FULL_DEBUG_SYMBOLS=0 and ALT_OBJCOPY=/does_not_exist # disables FDS for all build configs and reverts to pre-FDS make logic. @@ -548,82 +1389,133 @@ bash ../../configure \ make \ DEBUG_BINARIES=true \ + JAVAC_FLAGS=-g \ STRIP_POLICY=no_strip \ POST_STRIP_CMD="" \ LOG=trace \ - all + SCTP_WERROR= \ + %{targets} + +make zip-docs # the build (erroneously) removes read permissions from some jars # this is a regression in OpenJDK 7 (our compiler): # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 -find images/j2sdk-image -iname '*.jar' -exec chmod ugo+r {} \; -chmod ugo+r images/j2sdk-image/lib/ct.sym +find images/%{j2sdkimage} -iname '*.jar' -exec chmod ugo+r {} \; +chmod ugo+r images/%{j2sdkimage}/lib/ct.sym # remove redundant *diz and *debuginfo files -find images/j2sdk-image -iname '*.diz' -exec rm {} \; -find images/j2sdk-image -iname '*.debuginfo' -exec rm {} \; +find images/%{j2sdkimage} -iname '*.diz' -exec rm {} \; +find images/%{j2sdkimage} -iname '*.debuginfo' -exec rm {} \; popd >& /dev/null -export JAVA_HOME=$(pwd)/%{buildoutputdir}/images/j2sdk-image +# Install nss.cfg right away as we will be using the JRE above +export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} -# Install java-abrt-luncher -mv $JAVA_HOME/jre/bin/java $JAVA_HOME/jre/bin/java-abrt -cat %{SOURCE3} | sed -e s:@JAVA_PATH@:%{_jvmdir}/%{jredir}/bin/java-abrt:g -e s:@LIB_DIR@:%{LIBDIR}/libabrt-java-connector.so:g > $JAVA_HOME/jre/bin/java -chmod 755 $JAVA_HOME/jre/bin/java +# Install nss.cfg right away as we will be using the JRE above +install -m 644 %{SOURCE11} $JAVA_HOME/jre/lib/security/ +# Use system-wide tzdata +rm $JAVA_HOME/jre/lib/tzdb.dat +ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/jre/lib/tzdb.dat -# Copy tz.properties -echo "sun.zoneinfo.dir=/usr/share/javazi" >> $JAVA_HOME/jre/lib/tz.properties +#build cycles +done + +%check + +# We test debug first as it will give better diagnostics on a crash +for suffix in %{rev_build_loop} ; do + +export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} + +# check java.security in this build is also in this specfile +%{check_sum_presented_in_spec $JAVA_HOME/jre/lib/security/java.security} # Check unlimited policy has been used $JAVA_HOME/bin/javac -d . %{SOURCE13} $JAVA_HOME/bin/java TestCryptoLevel +# Check ECC is working +$JAVA_HOME/bin/javac -d . %{SOURCE14} +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") + # Check debug symbols are present and can identify code -#nm -aCl $JAVA_HOME/jre/lib/%{archinstall}/server/libjvm.so | grep javaCalls.cpp +SERVER_JVM="$JAVA_HOME/jre/lib/%{archinstall}/server/libjvm.so" +if [ -f "$SERVER_JVM" ] ; then + nm -aCl "$SERVER_JVM" | grep javaCalls.cpp +fi +CLIENT_JVM="$JAVA_HOME/jre/lib/%{archinstall}/client/libjvm.so" +if [ -f "$CLIENT_JVM" ] ; then + nm -aCl "$CLIENT_JVM" | grep javaCalls.cpp +fi +ZERO_JVM="$JAVA_HOME/jre/lib/%{archinstall}/zero/libjvm.so" +if [ -f "$ZERO_JVM" ] ; then + nm -aCl "$ZERO_JVM" | grep javaCalls.cpp +fi + +# Check src.zip has all sources. See RHBZ#1130490 +jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe' + +# Check class files include useful debugging information +$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable + +# Check generated class files include useful debugging information +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable +done %install -rm -rf $RPM_BUILD_ROOT STRIP_KEEP_SYMTAB=libjvm* -# Install symlink to default soundfont -install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/audio -pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/audio -ln -s %{_datadir}/soundfonts/default.sf2 -popd +for suffix in %{build_loop} ; do -pushd %{buildoutputdir}/images/j2sdk-image +pushd %{buildoutputdir $suffix}/images/%{j2sdkimage} + +#install jsa directories so we can owe them +mkdir -p %{buildroot}%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/server/ +mkdir -p %{buildroot}%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/client/ # Install main files. - install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir} - cp -a bin include lib src.zip $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir} - install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} - cp -a jre/bin jre/lib $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} + install -d -m 755 %{buildroot}%{_jvmdir}/%{sdkdir $suffix} + cp -a bin include lib src.zip %{buildroot}%{_jvmdir}/%{sdkdir $suffix} + install -d -m 755 %{buildroot}%{_jvmdir}/%{jredir $suffix} + cp -a jre/bin jre/lib %{buildroot}%{_jvmdir}/%{jredir $suffix} %if %{with systap} # Install systemtap support files. - install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/tapset - cp -a $RPM_BUILD_DIR/%{name}/tapset/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/tapset/ - install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir} - pushd $RPM_BUILD_ROOT%{tapsetdir} - RELATIVE=$(%{abs2rel} %{_jvmdir}/%{sdkdir}/tapset %{tapsetdir}) - ln -sf $RELATIVE/*.stp . + install -dm 755 %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/tapset + # note, that uniquesuffix is in BUILD dir in this case + cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/tapset/ + pushd %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/tapset/ + tapsetFiles=`ls *.stp` + popd + install -d -m 755 %{buildroot}%{tapsetdir} + pushd %{buildroot}%{tapsetdir} + RELATIVE=$(%{abs2rel} %{_jvmdir}/%{sdkdir $suffix}/tapset %{tapsetdir}) + for name in $tapsetFiles ; do + targetName=`echo $name | sed "s/.stp/$suffix.stp/"` + ln -sf $RELATIVE/$name $targetName + done popd %endif # Install cacerts symlink. - rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security/cacerts - pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security + rm -f %{buildroot}%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts + pushd %{buildroot}%{_jvmdir}/%{jredir $suffix}/lib/security RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ - %{_jvmdir}/%{jredir}/lib/security) + %{_jvmdir}/%{jredir $suffix}/lib/security) ln -sf $RELATIVE/cacerts . popd # Install extension symlinks. - install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir} - pushd $RPM_BUILD_ROOT%{jvmjardir} - RELATIVE=$(%{abs2rel} %{_jvmdir}/%{jredir}/lib %{jvmjardir}) + install -d -m 755 %{buildroot}%{jvmjardir $suffix} + pushd %{buildroot}%{jvmjardir $suffix} + RELATIVE=$(%{abs2rel} %{_jvmdir}/%{jredir $suffix}/lib %{jvmjardir $suffix}) ln -sf $RELATIVE/jsse.jar jsse-%{version}.jar ln -sf $RELATIVE/jce.jar jce-%{version}.jar ln -sf $RELATIVE/rt.jar jndi-%{version}.jar @@ -645,457 +1537,281 @@ pushd %{buildoutputdir}/images/j2sdk-image popd # Install JCE policy symlinks. - install -d -m 755 $RPM_BUILD_ROOT%{_jvmprivdir}/%{archname}/jce/vanilla + install -d -m 755 %{buildroot}%{_jvmprivdir}/%{uniquesuffix $suffix}/jce/vanilla - # Install versionless symlinks. - pushd $RPM_BUILD_ROOT%{_jvmdir} - ln -sf %{jredir} %{jrelnk} - ln -sf %{sdkdir} %{sdklnk} + # Install versioned symlinks. + pushd %{buildroot}%{_jvmdir} + ln -sf %{jredir $suffix} %{jrelnk $suffix} popd - pushd $RPM_BUILD_ROOT%{_jvmjardir} - ln -sf %{sdkdir} %{jrelnk} - ln -sf %{sdkdir} %{sdklnk} + pushd %{buildroot}%{_jvmjardir} + ln -sf %{sdkdir $suffix} %{jrelnk $suffix} popd # Remove javaws man page rm -f man/man1/javaws* # Install man pages. - install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 + install -d -m 755 %{buildroot}%{_mandir}/man1 for manpage in man/man1/* do # Convert man pages to UTF8 encoding. iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp mv -f $manpage.tmp $manpage - install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \ - $manpage .1)-%{name}.1 + install -m 644 -p $manpage %{buildroot}%{_mandir}/man1/$(basename \ + $manpage .1)-%{uniquesuffix $suffix}.1 done # Install demos and samples. - cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir} + cp -a demo %{buildroot}%{_jvmdir}/%{sdkdir $suffix} mkdir -p sample/rmi - mv bin/java-rmi.cgi sample/rmi - cp -a sample $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir} + if [ ! -e sample/rmi/java-rmi.cgi ] ; then + # hack to allow --short-circuit on install + mv bin/java-rmi.cgi sample/rmi + fi + cp -a sample %{buildroot}%{_jvmdir}/%{sdkdir $suffix} popd -# Install nss.cfg -install -m 644 %{SOURCE11} $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}/%{name} +install -d -m 755 %{buildroot}%{_javadocdir} +cp -a %{buildoutputdir $suffix}/docs %{buildroot}%{_javadocdir}/%{uniquejavadocdir $suffix} +cp -a %{buildoutputdir $suffix}/bundles/jdk-%{javaver}_%{updatever}$suffix-%{buildver}-docs.zip %{buildroot}%{_javadocdir}/%{uniquejavadocdir $suffix}.zip # Install icons and menu entries. for s in 16 24 32 48 ; do install -D -p -m 644 \ - jdk8/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}.png + openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}.png done # Install desktop files. -install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps} -for e in jconsole policytool ; do - desktop-file-install --vendor=%{name} --mode=644 \ - --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop +install -d -m 755 %{buildroot}%{_datadir}/{applications,pixmaps} +for e in jconsole$suffix policytool$suffix ; do + desktop-file-install --vendor=%{uniquesuffix $suffix} --mode=644 \ + --dir=%{buildroot}%{_datadir}/applications $e.desktop done -install -m644 %{SOURCE78} %{buildroot}%{_datadir}/applications/ +# Install /etc/.java/.systemPrefs/ directory +# See https://bugzilla.redhat.com/show_bug.cgi?id=741821 +mkdir -p %{buildroot}%{_sysconfdir}/.java/.systemPrefs # Find JRE directories. -find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} -type d \ +find %{buildroot}%{_jvmdir}/%{jredir $suffix} -type d \ | grep -v jre/lib/security \ - | sed 's|'$RPM_BUILD_ROOT'|%dir |' \ - > %{name}.files-headless + | sed 's|'%{buildroot}'|%dir |' \ + > %{name}.files-headless"$suffix" # Find JRE files. -find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} -type f -o -type l \ +find %{buildroot}%{_jvmdir}/%{jredir $suffix} -type f -o -type l \ | grep -v jre/lib/security \ - | sed 's|'$RPM_BUILD_ROOT'||' \ - > %{name}.files.all -#split %{name}.files to %{name}.files-headless and %{name}.files + | sed 's|'%{buildroot}'||' \ + > %{name}.files.all"$suffix" +#split %%{name}.files to %%{name}.files-headless and %%{name}.files #see https://bugzilla.redhat.com/show_bug.cgi?id=875408 NOT_HEADLESS=\ -"%{_jvmdir}/%{jredir}/lib/%{archinstall}/libjsoundalsa.so -%{_jvmdir}/%{jredir}/lib/%{archinstall}/libpulse-java.so -%{_jvmdir}/%{jredir}/lib/%{archinstall}/libsplashscreen.so -%{_jvmdir}/%{jredir}/lib/%{archinstall}/libawt_xawt.so -%{_jvmdir}/%{jredir}/lib/%{archinstall}/libjawt.so -%{_jvmdir}/%{uniquesuffix}/jre/bin/policytool" -#filter %{name}.files from %{name}.files.all to %{name}.files-headless -ALL=`cat %{name}.files.all` -for file in $ALL ; do - INLCUDE="NO" ; - for blacklist in $NOT_HEADLESS ; do - # we can not match normally, because rpmbuild will evaluate !0 result as script failure +"%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjsoundalsa.so +%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libpulse-java.so +%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libsplashscreen.so +%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libawt_xawt.so +%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjawt.so +%{_jvmdir}/%{uniquesuffix $suffix}/jre/bin/policytool" +#filter %%{name}.files from %%{name}.files.all to %%{name}.files-headless +ALL=`cat %{name}.files.all"$suffix"` +for file in $ALL ; do + INLCUDE="NO" ; + for blacklist in $NOT_HEADLESS ; do +#we can not match normally, because rpmbuild will evaluate !0 result as script failure q=`expr match "$file" "$blacklist"` || : - l=`expr length "$blacklist"` || : - if [ $q -eq $l ]; then - INLCUDE="YES" ; + l=`expr length "$blacklist"` || : + if [ $q -eq $l ]; then + INLCUDE="YES" ; fi; done -if [ "x$INLCUDE" = "xNO" ]; then - echo "$file" >> %{name}.files-headless +if [ "x$INLCUDE" = "xNO" ]; then + echo "$file" >> %{name}.files-headless"$suffix" else - echo "$file" >> %{name}.files + echo "$file" >> %{name}.files"$suffix" fi done # Find demo directories. -find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/demo \ - $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/sample -type d \ - | sed 's|'$RPM_BUILD_ROOT'|%dir |' \ - > %{name}-demo.files +find %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/demo \ + %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/sample -type d \ + | sed 's|'%{buildroot}'|%dir |' \ + > %{name}-demo.files"$suffix" # FIXME: remove SONAME entries from demo DSOs. See # https://bugzilla.redhat.com/show_bug.cgi?id=436497 # Find non-documentation demo files. -find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/demo \ - $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/sample \ +find %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/demo \ + %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/sample \ -type f -o -type l | sort \ | grep -v README \ - | sed 's|'$RPM_BUILD_ROOT'||' \ - >> %{name}-demo.files + | sed 's|'%{buildroot}'||' \ + >> %{name}-demo.files"$suffix" # Find documentation demo files. -find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/demo \ - $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/sample \ +find %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/demo \ + %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/sample \ -type f -o -type l | sort \ | grep README \ - | sed 's|'$RPM_BUILD_ROOT'||' \ + | sed 's|'%{buildroot}'||' \ | sed 's|^|%doc |' \ - >> %{name}-demo.files + >> %{name}-demo.files"$suffix" # intentionally after the files generation, as it goes to separate package # Create links which leads to separately installed java-atk-bridge and allow configuration # links points to java-atk-wrapper - an dependence - pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/lib/%{archinstall} - ln -s %{syslibdir}/java-atk-wrapper/libatk-wrapper.so.0 libatk-wrapper.so + pushd %{buildroot}/%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall} + ln -s %{_libdir}/java-atk-wrapper/libatk-wrapper.so.0 libatk-wrapper.so popd - pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/lib/ext - ln -s %{syslibdir}/java-atk-wrapper/java-atk-wrapper.jar java-atk-wrapper.jar + pushd %{buildroot}/%{_jvmdir}/%{jredir $suffix}/lib/ext + ln -s %{_libdir}/java-atk-wrapper/java-atk-wrapper.jar java-atk-wrapper.jar popd - pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/lib/ + pushd %{buildroot}/%{_jvmdir}/%{jredir $suffix}/lib/ echo "#Config file to enable java-atk-wrapper" > accessibility.properties echo "" >> accessibility.properties echo "assistive_technologies=org.GNOME.Accessibility.AtkWrapper" >> accessibility.properties echo "" >> accessibility.properties popd -%post -update-desktop-database %{_datadir}/applications &> /dev/null || : -/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : -exit 0 +bash %{SOURCE20} %{buildroot}/%{_jvmdir}/%{jredir $suffix} %{javaver} +# https://bugzilla.redhat.com/show_bug.cgi?id=1183793 +touch -t 201401010000 %{buildroot}/%{_jvmdir}/%{jredir $suffix}/lib/security/java.security + +# end, dual install +done + +%if %{include_normal_build} +# intentioanlly only for non-debug +%pretrans headless -p +-- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue +-- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre +-- if copy-jdk-configs is in transaction, it installs in pretrans to temp +-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in tranasction and so is +-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends +-- whether copy-jdk-configs is installed or not. If so, then configs are copied +-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all +local posix = require "posix" +local debug = false + +SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua" +SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua" + +local stat1 = posix.stat(SOURCE1, "type"); +local stat2 = posix.stat(SOURCE2, "type"); + + if (stat1 ~= nil) then + if (debug) then + print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.") + end; + package.path = package.path .. ";" .. SOURCE1 +else + if (stat2 ~= nil) then + if (debug) then + print(SOURCE2 .." exists - copy-jdk-configs alrady installed and NOT in transation. Using.") + end; + package.path = package.path .. ";" .. SOURCE2 + else + if (debug) then + print(SOURCE1 .." does NOT exists") + print(SOURCE2 .." does NOT exists") + print("No config files will be copied") + end + return + end +end +-- run contetn of included file with fake args +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +require "copy_jdk_configs.lua" -# FIXME: identical binaries are copied, not linked. This needs to be -# fixed upstream. %post headless -ext=.xz -alternatives \ - --install %{_bindir}/java java %{jrebindir}/java %{priority} \ - --slave %{_jvmdir}/jre jre %{_jvmdir}/%{jrelnk} \ - --slave %{_jvmjardir}/jre jre_exports %{_jvmjardir}/%{jrelnk} \ - --slave %{_bindir}/jjs jjs %{jrebindir}/jjs \ - --slave %{_bindir}/keytool keytool %{jrebindir}/keytool \ - --slave %{_bindir}/orbd orbd %{jrebindir}/orbd \ - --slave %{_bindir}/pack200 pack200 %{jrebindir}/pack200 \ - --slave %{_bindir}/rmid rmid %{jrebindir}/rmid \ - --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir}/rmiregistry \ - --slave %{_bindir}/servertool servertool %{jrebindir}/servertool \ - --slave %{_bindir}/tnameserv tnameserv %{jrebindir}/tnameserv \ - --slave %{_bindir}/unpack200 unpack200 %{jrebindir}/unpack200 \ - --slave %{_mandir}/man1/java.1$ext java.1$ext \ - %{_mandir}/man1/java-%{name}.1$ext \ - --slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \ - %{_mandir}/man1/jjs-%{name}.1$ext \ - --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \ - %{_mandir}/man1/keytool-%{name}.1$ext \ - --slave %{_mandir}/man1/orbd.1$ext orbd.1$ext \ - %{_mandir}/man1/orbd-%{name}.1$ext \ - --slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \ - %{_mandir}/man1/pack200-%{name}.1$ext \ - --slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \ - %{_mandir}/man1/rmid-%{name}.1$ext \ - --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \ - %{_mandir}/man1/rmiregistry-%{name}.1$ext \ - --slave %{_mandir}/man1/servertool.1$ext servertool.1$ext \ - %{_mandir}/man1/servertool-%{name}.1$ext \ - --slave %{_mandir}/man1/tnameserv.1$ext tnameserv.1$ext \ - %{_mandir}/man1/tnameserv-%{name}.1$ext \ - --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \ - %{_mandir}/man1/unpack200-%{name}.1$ext +%{post_headless %{nil}} -alternatives \ - --install %{_jvmdir}/jre-%{origin} \ - jre_%{origin} %{_jvmdir}/%{jrelnk} %{priority} \ - --slave %{_jvmjardir}/jre-%{origin} \ - jre_%{origin}_exports %{_jvmjardir}/%{jrelnk} - -alternatives \ - --install %{_jvmdir}/jre-%{javaver} \ - jre_%{javaver} %{_jvmdir}/%{jrelnk} %{priority} \ - --slave %{_jvmjardir}/jre-%{javaver} \ - jre_%{javaver}_exports %{_jvmjardir}/%{jrelnk} - -update-desktop-database %{_datadir}/applications &> /dev/null || : - -/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : - -exit 0 %postun headless -if [ $1 -eq 0 ] -then - alternatives --remove java %{jrebindir}/java - alternatives --remove jre_%{origin} %{_jvmdir}/%{jrelnk} - alternatives --remove jre_%{javaver} %{_jvmdir}/%{jrelnk} -fi +%{postun_headless %{nil}} %post devel -ext=.xz -alternatives \ - --install %{_bindir}/javac javac %{sdkbindir}/javac %{priority} \ - --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdklnk} \ - --slave %{_jvmjardir}/java java_sdk_exports %{_jvmjardir}/%{sdklnk} \ - --slave %{_bindir}/appletviewer appletviewer %{sdkbindir}/appletviewer \ - --slave %{_bindir}/extcheck extcheck %{sdkbindir}/extcheck \ - --slave %{_bindir}/idlj idlj %{sdkbindir}/idlj \ - --slave %{_bindir}/jar jar %{sdkbindir}/jar \ - --slave %{_bindir}/jarsigner jarsigner %{sdkbindir}/jarsigner \ - --slave %{_bindir}/javadoc javadoc %{sdkbindir}/javadoc \ - --slave %{_bindir}/javah javah %{sdkbindir}/javah \ - --slave %{_bindir}/javap javap %{sdkbindir}/javap \ - --slave %{_bindir}/jcmd jcmd %{sdkbindir}/jcmd \ - --slave %{_bindir}/jconsole jconsole %{sdkbindir}/jconsole \ - --slave %{_bindir}/jdb jdb %{sdkbindir}/jdb \ - --slave %{_bindir}/jdeps jdeps %{sdkbindir}/jdeps \ - --slave %{_bindir}/jhat jhat %{sdkbindir}/jhat \ - --slave %{_bindir}/jinfo jinfo %{sdkbindir}/jinfo \ - --slave %{_bindir}/jmap jmap %{sdkbindir}/jmap \ - --slave %{_bindir}/jps jps %{sdkbindir}/jps \ - --slave %{_bindir}/jrunscript jrunscript %{sdkbindir}/jrunscript \ - --slave %{_bindir}/jsadebugd jsadebugd %{sdkbindir}/jsadebugd \ - --slave %{_bindir}/jstack jstack %{sdkbindir}/jstack \ - --slave %{_bindir}/jstat jstat %{sdkbindir}/jstat \ - --slave %{_bindir}/jstatd jstatd %{sdkbindir}/jstatd \ - --slave %{_bindir}/native2ascii native2ascii %{sdkbindir}/native2ascii \ - --slave %{_bindir}/policytool policytool %{sdkbindir}/policytool \ - --slave %{_bindir}/rmic rmic %{sdkbindir}/rmic \ - --slave %{_bindir}/schemagen schemagen %{sdkbindir}/schemagen \ - --slave %{_bindir}/serialver serialver %{sdkbindir}/serialver \ - --slave %{_bindir}/wsgen wsgen %{sdkbindir}/wsgen \ - --slave %{_bindir}/wsimport wsimport %{sdkbindir}/wsimport \ - --slave %{_bindir}/xjc xjc %{sdkbindir}/xjc \ - --slave %{_mandir}/man1/appletviewer.1$ext appletviewer.1$ext \ - %{_mandir}/man1/appletviewer-%{name}.1$ext \ - --slave %{_mandir}/man1/extcheck.1$ext extcheck.1$ext \ - %{_mandir}/man1/extcheck-%{name}.1$ext \ - --slave %{_mandir}/man1/idlj.1$ext idlj.1$ext \ - %{_mandir}/man1/idlj-%{name}.1$ext \ - --slave %{_mandir}/man1/jar.1$ext jar.1$ext \ - %{_mandir}/man1/jar-%{name}.1$ext \ - --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \ - %{_mandir}/man1/jarsigner-%{name}.1$ext \ - --slave %{_mandir}/man1/javac.1$ext javac.1$ext \ - %{_mandir}/man1/javac-%{name}.1$ext \ - --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \ - %{_mandir}/man1/javadoc-%{name}.1$ext \ - --slave %{_mandir}/man1/javah.1$ext javah.1$ext \ - %{_mandir}/man1/javah-%{name}.1$ext \ - --slave %{_mandir}/man1/javap.1$ext javap.1$ext \ - %{_mandir}/man1/javap-%{name}.1$ext \ - --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \ - %{_mandir}/man1/jcmd-%{name}.1$ext \ - --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \ - %{_mandir}/man1/jconsole-%{name}.1$ext \ - --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \ - %{_mandir}/man1/jdb-%{name}.1$ext \ - --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \ - %{_mandir}/man1/jdeps-%{name}.1$ext \ - --slave %{_mandir}/man1/jhat.1$ext jhat.1$ext \ - %{_mandir}/man1/jhat-%{name}.1$ext \ - --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \ - %{_mandir}/man1/jinfo-%{name}.1$ext \ - --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \ - %{_mandir}/man1/jmap-%{name}.1$ext \ - --slave %{_mandir}/man1/jps.1$ext jps.1$ext \ - %{_mandir}/man1/jps-%{name}.1$ext \ - --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \ - %{_mandir}/man1/jrunscript-%{name}.1$ext \ - --slave %{_mandir}/man1/jsadebugd.1$ext jsadebugd.1$ext \ - %{_mandir}/man1/jsadebugd-%{name}.1$ext \ - --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \ - %{_mandir}/man1/jstack-%{name}.1$ext \ - --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \ - %{_mandir}/man1/jstat-%{name}.1$ext \ - --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \ - %{_mandir}/man1/jstatd-%{name}.1$ext \ - --slave %{_mandir}/man1/native2ascii.1$ext native2ascii.1$ext \ - %{_mandir}/man1/native2ascii-%{name}.1$ext \ - --slave %{_mandir}/man1/policytool.1$ext policytool.1$ext \ - %{_mandir}/man1/policytool-%{name}.1$ext \ - --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \ - %{_mandir}/man1/rmic-%{name}.1$ext \ - --slave %{_mandir}/man1/schemagen.1$ext schemagen.1$ext \ - %{_mandir}/man1/schemagen-%{name}.1$ext \ - --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \ - %{_mandir}/man1/serialver-%{name}.1$ext \ - --slave %{_mandir}/man1/wsgen.1$ext wsgen.1$ext \ - %{_mandir}/man1/wsgen-%{name}.1$ext \ - --slave %{_mandir}/man1/wsimport.1$ext wsimport.1$ext \ - %{_mandir}/man1/wsimport-%{name}.1$ext \ - --slave %{_mandir}/man1/xjc.1$ext xjc.1$ext \ - %{_mandir}/man1/xjc-%{name}.1$ext - -alternatives \ - --install %{_jvmdir}/java-%{origin} \ - java_sdk_%{origin} %{_jvmdir}/%{sdklnk} %{priority} \ - --slave %{_jvmjardir}/java-%{origin} \ - java_sdk_%{origin}_exports %{_jvmjardir}/%{sdklnk} - -alternatives \ - --install %{_jvmdir}/java-%{javaver} \ - java_sdk_%{javaver} %{_jvmdir}/%{sdklnk} %{priority} \ - --slave %{_jvmjardir}/java-%{javaver} \ - java_sdk_%{javaver}_exports %{_jvmjardir}/%{sdklnk} - -update-desktop-database %{_datadir}/applications &> /dev/null || : -/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : - -exit 0 +%{post_devel %{nil}} %postun devel -if [ $1 -eq 0 ] -then - alternatives --remove javac %{sdkbindir}/javac - alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdklnk} - alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdklnk} -fi - -exit 0 +%{postun_devel %{nil}} %post javadoc -alternatives \ - --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{name}/api \ - %{priority} - -exit 0 +%{post_javadoc %{nil}} %postun javadoc -if [ $1 -eq 0 ] -then - alternatives --remove javadocdir %{_javadocdir}/%{name}/api -fi +%{postun_javadoc %{nil}} -exit 0 +%post javadoc-zip +%{post_javadoc_zip %{nil}} +%postun javadoc-zip +%{postun_javadoc_zip %{nil}} +%endif +%if %{include_normal_build} %files -f %{name}.files -%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png +# main package builds always +%{files_jre %{nil}} +%else +%files +# placeholder +%endif -%files headless -f %{name}.files-headless -%defattr(-,root,root,-) -%doc %{buildoutputdir}/images/j2sdk-image/jre/ASSEMBLY_EXCEPTION -%doc %{buildoutputdir}/images/j2sdk-image/jre/LICENSE -%doc %{buildoutputdir}/images/j2sdk-image/jre/THIRD_PARTY_README - -%dir %{_jvmdir}/%{sdkdir} -%{_jvmdir}/%{jrelnk} -%{_jvmjardir}/%{jrelnk} -%{_jvmprivdir}/* -%{jvmjardir} -%dir %{_jvmdir}/%{jredir}/lib/security -%{_jvmdir}/%{jredir}/lib/security/cacerts -%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.policy -%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.security -%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/blacklisted.certs -%{_mandir}/man1/java-%{name}.1* -%{_mandir}/man1/jjs-%{name}.1* -%{_mandir}/man1/keytool-%{name}.1* -%{_mandir}/man1/orbd-%{name}.1* -%{_mandir}/man1/pack200-%{name}.1* -%{_mandir}/man1/rmid-%{name}.1* -%{_mandir}/man1/rmiregistry-%{name}.1* -%{_mandir}/man1/servertool-%{name}.1* -%{_mandir}/man1/tnameserv-%{name}.1* -%{_mandir}/man1/unpack200-%{name}.1* -%{_jvmdir}/%{jredir}/lib/security/nss.cfg -%{_jvmdir}/%{jredir}/lib/security/US_export_policy.jar -%{_jvmdir}/%{jredir}/lib/security/local_policy.jar -%{_datadir}/applications/openjdk-java.desktop +%if %{include_normal_build} +%files headless -f %{name}.files-headless +# important note, see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue +# all config/norepalce files (and more) have to be declared in pretrans. See pretrans +%{files_jre_headless %{nil}} %files devel -%defattr(-,root,root,-) -%doc %{buildoutputdir}/images/j2sdk-image/ASSEMBLY_EXCEPTION -%doc %{buildoutputdir}/images/j2sdk-image/LICENSE -%doc %{buildoutputdir}/images/j2sdk-image/THIRD_PARTY_README -%dir %{_jvmdir}/%{sdkdir}/bin -%dir %{_jvmdir}/%{sdkdir}/include -%dir %{_jvmdir}/%{sdkdir}/lib -%if %{with systap} -%dir %{_jvmdir}/%{sdkdir}/tapset -%endif -%{_jvmdir}/%{sdkdir}/bin/* -%{_jvmdir}/%{sdkdir}/include/* -%{_jvmdir}/%{sdkdir}/lib/* -%if %{with systap} -%{_jvmdir}/%{sdkdir}/tapset/*.stp -%endif -%{_jvmdir}/%{sdklnk} -%{_jvmjardir}/%{sdklnk} -%{_datadir}/applications/*jconsole.desktop -%{_datadir}/applications/*policytool.desktop -%{_mandir}/man1/appletviewer-%{name}.1* -%{_mandir}/man1/extcheck-%{name}.1* -%{_mandir}/man1/idlj-%{name}.1* -%{_mandir}/man1/jar-%{name}.1* -%{_mandir}/man1/jarsigner-%{name}.1* -%{_mandir}/man1/javac-%{name}.1* -%{_mandir}/man1/javadoc-%{name}.1* -%{_mandir}/man1/javah-%{name}.1* -%{_mandir}/man1/javap-%{name}.1* -%{_mandir}/man1/jconsole-%{name}.1* -%{_mandir}/man1/jcmd-%{name}.1* -%{_mandir}/man1/jdb-%{name}.1* -%{_mandir}/man1/jdeps-%{name}.1* -%{_mandir}/man1/jhat-%{name}.1* -%{_mandir}/man1/jinfo-%{name}.1* -%{_mandir}/man1/jmap-%{name}.1* -%{_mandir}/man1/jps-%{name}.1* -%{_mandir}/man1/jrunscript-%{name}.1* -%{_mandir}/man1/jsadebugd-%{name}.1* -%{_mandir}/man1/jstack-%{name}.1* -%{_mandir}/man1/jstat-%{name}.1* -%{_mandir}/man1/jstatd-%{name}.1* -%{_mandir}/man1/native2ascii-%{name}.1* -%{_mandir}/man1/policytool-%{name}.1* -%{_mandir}/man1/rmic-%{name}.1* -%{_mandir}/man1/schemagen-%{name}.1* -%{_mandir}/man1/serialver-%{name}.1* -%{_mandir}/man1/wsgen-%{name}.1* -%{_mandir}/man1/wsimport-%{name}.1* -%{_mandir}/man1/xjc-%{name}.1* -%if %{with systap} -%{tapsetroot} -%endif +%{files_devel %{nil}} %files demo -f %{name}-demo.files -%defattr(-,root,root,-) -%doc %{buildoutputdir}/images/j2sdk-image/jre/LICENSE +%{files_demo %{nil}} %files src -%defattr(-,root,root,-) -%doc README.src -%{_jvmdir}/%{sdkdir}/src.zip +%{files_src %{nil}} %files javadoc -%defattr(-,root,root,-) -%doc %{_javadocdir}/%{name} -%doc %{buildoutputdir}/images/j2sdk-image/jre/LICENSE +%{files_javadoc %{nil}} + +%files javadoc-zip +%{files_javadoc_zip %{nil}} %files accessibility -%{_jvmdir}/%{jredir}/lib/%{archinstall}/libatk-wrapper.so -%{_jvmdir}/%{jredir}/lib/ext/java-atk-wrapper.jar -%{_jvmdir}/%{jredir}/lib/accessibility.properties +%{files_accessibility %{nil}} +%endif + +%if %{include_debug_build} +%files debug -f %{name}.files-debug +%{files_jre %{debug_suffix_unquoted}} + +%files headless-debug -f %{name}.files-headless-debug +%{files_jre_headless %{debug_suffix_unquoted}} + +%files devel-debug +%{files_devel %{debug_suffix_unquoted}} + +%files demo-debug -f %{name}-demo.files-debug +%{files_demo %{debug_suffix_unquoted}} + +%files src-debug +%{files_src %{debug_suffix_unquoted}} + +%files javadoc-debug +%{files_javadoc %{debug_suffix_unquoted}} + +%files javadoc-zip-debug +%{files_javadoc_zip %{debug_suffix_unquoted}} + +%files accessibility-debug +%{files_accessibility %{debug_suffix_unquoted}} +%endif + + + + diff --git a/jconsole.desktop.in b/jconsole.desktop.in index ffbdd42..a096349 100644 --- a/jconsole.desktop.in +++ b/jconsole.desktop.in @@ -1,8 +1,8 @@ [Desktop Entry] -Name=OpenJDK Monitoring & Management Console -Comment=Monitor and manage OpenJDK applications -Exec=/usr/bin/jconsole -Icon=java +Name=OpenJDK 8 Monitoring & Management Console #ARCH# +Comment=Monitor and manage OpenJDK applications for #ARCH# +Exec=#JAVA_HOME#/jconsole +Icon=java-1.8.0 Terminal=false Type=Application StartupWMClass=sun-tools-jconsole-JConsole diff --git a/mga-add-missing-files.sh b/mga-add-missing-files.sh new file mode 100755 index 0000000..7feca49 --- /dev/null +++ b/mga-add-missing-files.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +revision="$1" + +if [ -z "$(echo \"$revision\" | grep \"aarch64-jdk[89]u[0-9][0-9][0-9]\\?-b[0-9][0-9]\")" ]; then + echo "Revision must be aarch64-jdk[89]u[0-9][0-9][0-9]?-b[0-9][0-9]" + exit 2 +fi + +changetset=$(hg id -r $revision http://hg.openjdk.java.net/aarch64-port/jdk8u/jdk) +wget http://hg.openjdk.java.net/aarch64-port/jdk8u/jdk/archive/$changetset.tar.bz2/src/share/native/sun/security/ec/impl/ -O $changetset.tar.bz2 diff --git a/no_strict_overflow.patch b/no_strict_overflow.patch new file mode 100644 index 0000000..53fa41c --- /dev/null +++ b/no_strict_overflow.patch @@ -0,0 +1,16 @@ +diff -r 1fe56343ecc8 make/lib/Awt2dLibraries.gmk +--- openjdk/jdk/make/lib/Awt2dLibraries.gmk Tue Jan 12 21:01:12 2016 +0000 ++++ openjdk/jdk/make/lib/Awt2dLibraries.gmk Thu Jan 14 00:47:01 2016 +0000 +@@ -904,6 +904,12 @@ + BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing + endif + ++# Turn off strict overflow with GCC for IndicRearrangementProcessor.cpp ++ifeq ($(OPENJDK_TARGET_OS), linux) ++ BUILD_LIBFONTMANAGER_IndicRearrangementProcessor.cpp_CXXFLAGS := -fno-strict-overflow ++ BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow ++endif ++ + $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + LIBRARY := fontmanager, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 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/policytool.desktop.in b/policytool.desktop.in index 702b44a..d38b42d 100644 --- a/policytool.desktop.in +++ b/policytool.desktop.in @@ -1,10 +1,10 @@ [Desktop Entry] -Name=OpenJDK Policy Tool -Comment=Manage OpenJDK policy files -Exec=/usr/bin/policytool -Icon=java +Name=OpenJDK 8 Policy Tool #ARCH# +Comment=Manage OpenJDK policy files #ARCH# +Exec=#JRE_HOME#/policytool +Icon=java-1.8.0 Terminal=false Type=Application StartupWMClass=sun-security-tools-PolicyTool -Categories=Development;Java; +Categories=Settings;Java; Version=1.0 diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch new file mode 100644 index 0000000..1b3c903 --- /dev/null +++ b/pr1834-rh1022017.patch @@ -0,0 +1,44 @@ +diff -r a5c3d9643077 src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +--- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Feb 10 16:24:28 2015 +0000 ++++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Thu May 14 04:01:02 2015 +0100 +@@ -37,25 +37,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); + } + +@@ -150,10 +136,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); + } + diff --git a/pr1983-jdk.patch b/pr1983-jdk.patch new file mode 100644 index 0000000..a0b4e1a --- /dev/null +++ b/pr1983-jdk.patch @@ -0,0 +1,693 @@ +# HG changeset patch +# User andrew +# Date 1453863246 0 +# Wed Jan 27 02:54:06 2016 +0000 +# Node ID 48c15869ecd568263249af4b9a4e98d4e57f9a8f +# Parent afd392dfaed501ac674a7cc3e37353ce300969c7 +PR1983: Support using the system installation of NSS with the SunEC provider +Summary: Apply code changes from PR1699 & PR1742 & forward-port Makefile changes to the new build. + +diff -r afd392dfaed5 -r 48c15869ecd5 make/lib/SecurityLibraries.gmk +--- openjdk/jdk/make/lib/SecurityLibraries.gmk Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/make/lib/SecurityLibraries.gmk Wed Jan 27 02:54:06 2016 +0000 +@@ -218,8 +218,17 @@ + + ifeq ($(ENABLE_INTREE_EC), yes) + +- BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \ ++ BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec ++ ++ ifeq ($(USE_EXTERNAL_NSS), true) ++ BUILD_LIBSUNEC_IMPL_DIR := ++ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC ++ else ++ BUILD_LIBSUNEC_IMPL_DIR := \ ++ $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl ++ BUILD_LIBSUNEC_FLAGS += \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl ++ endif + + # + # On sol-sparc...all libraries are compiled with -xregs=no%appl +@@ -235,8 +244,8 @@ + $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \ + LIBRARY := sunec, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ +- SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec \ +- $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \ ++ SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec/ECC_JNI.cpp \ ++ $(BUILD_LIBSUNEC_IMPL_DIR), \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \ +@@ -248,8 +257,8 @@ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ + LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LIBCXX), \ +- LDFLAGS_SUFFIX_linux := -lc, \ +- LDFLAGS_SUFFIX_solaris := -lc, \ ++ LDFLAGS_SUFFIX_linux := -lc $(NSS_LIBS), \ ++ LDFLAGS_SUFFIX_solaris := -lc $(NSS_LIBS), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=sunec.dll" \ +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 02:54:06 2016 +0000 +@@ -24,7 +24,7 @@ + */ + + #include +-#include "impl/ecc_impl.h" ++#include "ecc_impl.h" + + #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException" + #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \ +@@ -89,7 +89,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; +@@ -190,7 +190,7 @@ + */ + JNIEXPORT jbyteArray + JNICALL Java_sun_security_ec_ECDSASignature_signDigest +- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed) ++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed) + { + jbyte* pDigestBuffer = NULL; + jint jDigestLength = env->GetArrayLength(digest); +@@ -299,7 +299,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; + +@@ -384,7 +384,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; +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/ecc_impl.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Jan 27 02:54:06 2016 +0000 +@@ -0,0 +1,298 @@ ++/* ++ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Use is subject to license terms. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++/* ********************************************************************* ++ * ++ * The Original Code is the Netscape security libraries. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1994-2000 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * Dr Vipul Gupta and ++ * Douglas Stebila , Sun Microsystems Laboratories ++ * ++ * Last Modified Date from the Original Code: November 2013 ++ *********************************************************************** */ ++ ++#ifndef _ECC_IMPL_H ++#define _ECC_IMPL_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++ ++#ifdef SYSTEM_NSS ++#include ++#include ++#include ++#ifdef LEGACY_NSS ++#include ++#else ++#include ++#endif ++#else ++#include "ecl-exp.h" ++#endif ++ ++/* ++ * Multi-platform definitions ++ */ ++#ifdef __linux__ ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++typedef enum { B_FALSE, B_TRUE } boolean_t; ++#endif /* __linux__ */ ++ ++#ifdef _ALLBSD_SOURCE ++#include ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned long ulong_t; ++typedef enum boolean { B_FALSE, B_TRUE } boolean_t; ++#endif /* _ALLBSD_SOURCE */ ++ ++#ifdef AIX ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++#endif /* AIX */ ++ ++#ifdef _WIN32 ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++typedef enum boolean { B_FALSE, B_TRUE } boolean_t; ++#define strdup _strdup /* Replace POSIX name with ISO C++ name */ ++#endif /* _WIN32 */ ++ ++#ifndef _KERNEL ++#include ++#endif /* _KERNEL */ ++ ++#define EC_MAX_DIGEST_LEN 1024 /* max digest that can be signed */ ++#define EC_MAX_POINT_LEN 145 /* max len of DER encoded Q */ ++#define EC_MAX_VALUE_LEN 72 /* max len of ANSI X9.62 private value d */ ++#define EC_MAX_SIG_LEN 144 /* max signature len for supported curves */ ++#define EC_MIN_KEY_LEN 112 /* min key length in bits */ ++#define EC_MAX_KEY_LEN 571 /* max key length in bits */ ++#define EC_MAX_OID_LEN 10 /* max length of OID buffer */ ++ ++/* ++ * 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)) ++#define PORT_ArenaGrow(a, b, c, d) NULL ++#define PORT_ZAlloc(n, f) kmem_zalloc((n), (f)) ++#define PORT_Alloc(n, f) kmem_alloc((n), (f)) ++#else ++#define PORT_ArenaAlloc(a, n, f) malloc((n)) ++#define PORT_ArenaZAlloc(a, n, f) calloc(1, (n)) ++#define PORT_ArenaGrow(a, b, c, d) NULL ++#define PORT_ZAlloc(n, f) calloc(1, (n)) ++#define PORT_Alloc(n, f) malloc((n)) ++#endif ++ ++#define PORT_NewArena(b) (char *)12345 ++#define PORT_ArenaMark(a) NULL ++#define PORT_ArenaUnmark(a, b) ++#define PORT_ArenaRelease(a, m) ++#define PORT_FreeArena(a, b) ++#define PORT_Strlen(s) strlen((s)) ++#define PORT_SetError(e) ++ ++#define PRBool boolean_t ++#define PR_TRUE B_TRUE ++#define PR_FALSE B_FALSE ++ ++#ifdef _KERNEL ++#define PORT_Assert ASSERT ++#define PORT_Memcpy(t, f, l) bcopy((f), (t), (l)) ++#else ++#define PORT_Assert assert ++#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, ++ siCipherDataBuffer = 2, ++ siDERCertBuffer = 3, ++ siEncodedCertBuffer = 4, ++ siDERNameBuffer = 5, ++ siEncodedNameBuffer = 6, ++ siAsciiNameString = 7, ++ siAsciiString = 8, ++ siDEROID = 9, ++ siUnsignedInteger = 10, ++ siUTCTime = 11, ++ siGeneralizedTime = 12 ++} SECItemType; ++ ++typedef struct SECItemStr SECItem; ++ ++struct SECItemStr { ++ SECItemType type; ++ unsigned char *data; ++ unsigned int len; ++}; ++ ++typedef SECItem SECKEYECParams; ++ ++typedef enum { ec_params_explicit, ++ ec_params_named ++} ECParamsType; ++ ++typedef enum { ec_field_GFp = 1, ++ ec_field_GF2m ++} ECFieldType; ++ ++struct ECFieldIDStr { ++ int size; /* field size in bits */ ++ ECFieldType type; ++ union { ++ SECItem prime; /* prime p for (GFp) */ ++ SECItem poly; /* irreducible binary polynomial for (GF2m) */ ++ } u; ++ int k1; /* first coefficient of pentanomial or ++ * the only coefficient of trinomial ++ */ ++ int k2; /* two remaining coefficients of pentanomial */ ++ int k3; ++}; ++typedef struct ECFieldIDStr ECFieldID; ++ ++struct ECCurveStr { ++ SECItem a; /* contains octet stream encoding of ++ * field element (X9.62 section 4.3.3) ++ */ ++ SECItem b; ++ SECItem seed; ++}; ++typedef struct ECCurveStr ECCurve; ++ ++typedef void PRArenaPool; ++ ++struct ECParamsStr { ++ PRArenaPool * arena; ++ ECParamsType type; ++ ECFieldID fieldID; ++ ECCurve curve; ++ SECItem base; ++ SECItem order; ++ int cofactor; ++ SECItem DEREncoding; ++ ECCurveName name; ++ SECItem curveOID; ++}; ++typedef struct ECParamsStr ECParams; ++ ++struct ECPublicKeyStr { ++ ECParams ecParams; ++ SECItem publicValue; /* elliptic curve point encoded as ++ * octet stream. ++ */ ++}; ++typedef struct ECPublicKeyStr ECPublicKey; ++ ++struct ECPrivateKeyStr { ++ ECParams ecParams; ++ SECItem publicValue; /* encoded ec point */ ++ SECItem privateValue; /* private big integer */ ++ SECItem version; /* As per SEC 1, Appendix C, Section C.4 */ ++}; ++typedef struct ECPrivateKeyStr ECPrivateKey; ++ ++typedef enum _SECStatus { ++ SECBufferTooSmall = -3, ++ SECWouldBlock = -2, ++ SECFailure = -1, ++ SECSuccess = 0 ++} SECStatus; ++#endif ++ ++#ifdef _KERNEL ++#define RNG_GenerateGlobalRandomBytes(p,l) ecc_knzero_random_generator((p), (l)) ++#else ++/* ++ This function is no longer required because the random bytes are now ++ supplied by the caller. Force a failure. ++*/ ++#define RNG_GenerateGlobalRandomBytes(p,l) SECFailure ++#endif ++#define CHECK_MPI_OK(func) if (MP_OKAY > (err = func)) goto cleanup ++#define MP_TO_SEC_ERROR(err) ++ ++#define SECITEM_TO_MPINT(it, mp) \ ++ CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len)) ++ ++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 EC_NewKey(a,b,c,d,e) EC_NewKeyFromSeed(a,b,c,d) ++#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigestWithSeed(a,b,c,d,e) ++#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); ++/* This function has been modified to accept an array of random bytes */ ++extern SECStatus ECDSA_SignDigest(ECPrivateKey *, SECItem *, const SECItem *, ++ const unsigned char* random, int randomlen, int); ++extern SECStatus ECDSA_VerifyDigest(ECPublicKey *, const SECItem *, ++ const SECItem *, int); ++extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, ++ SECItem *, int); ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _ECC_IMPL_H */ +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/impl/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h Tue Jan 26 22:26:26 2016 +0000 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,271 +0,0 @@ +-/* +- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +- * Use is subject to license terms. +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public License +- * along with this library; if not, write to the Free Software Foundation, +- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +- * +- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +- * or visit www.oracle.com if you need additional information or have any +- * questions. +- */ +- +-/* ********************************************************************* +- * +- * The Original Code is the Netscape security libraries. +- * +- * The Initial Developer of the Original Code is +- * Netscape Communications Corporation. +- * Portions created by the Initial Developer are Copyright (C) 1994-2000 +- * the Initial Developer. All Rights Reserved. +- * +- * Contributor(s): +- * Dr Vipul Gupta and +- * Douglas Stebila , Sun Microsystems Laboratories +- * +- * Last Modified Date from the Original Code: November 2013 +- *********************************************************************** */ +- +-#ifndef _ECC_IMPL_H +-#define _ECC_IMPL_H +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-#include +-#include "ecl-exp.h" +- +-/* +- * Multi-platform definitions +- */ +-#ifdef __linux__ +-#define B_FALSE FALSE +-#define B_TRUE TRUE +-typedef unsigned char uint8_t; +-typedef unsigned long ulong_t; +-typedef enum { B_FALSE, B_TRUE } boolean_t; +-#endif /* __linux__ */ +- +-#ifdef _ALLBSD_SOURCE +-#include +-#define B_FALSE FALSE +-#define B_TRUE TRUE +-typedef unsigned long ulong_t; +-typedef enum boolean { B_FALSE, B_TRUE } boolean_t; +-#endif /* _ALLBSD_SOURCE */ +- +-#ifdef AIX +-#define B_FALSE FALSE +-#define B_TRUE TRUE +-typedef unsigned char uint8_t; +-typedef unsigned long ulong_t; +-#endif /* AIX */ +- +-#ifdef _WIN32 +-typedef unsigned char uint8_t; +-typedef unsigned long ulong_t; +-typedef enum boolean { B_FALSE, B_TRUE } boolean_t; +-#define strdup _strdup /* Replace POSIX name with ISO C++ name */ +-#endif /* _WIN32 */ +- +-#ifndef _KERNEL +-#include +-#endif /* _KERNEL */ +- +-#define EC_MAX_DIGEST_LEN 1024 /* max digest that can be signed */ +-#define EC_MAX_POINT_LEN 145 /* max len of DER encoded Q */ +-#define EC_MAX_VALUE_LEN 72 /* max len of ANSI X9.62 private value d */ +-#define EC_MAX_SIG_LEN 144 /* max signature len for supported curves */ +-#define EC_MIN_KEY_LEN 112 /* min key length in bits */ +-#define EC_MAX_KEY_LEN 571 /* max key length in bits */ +-#define EC_MAX_OID_LEN 10 /* max length of OID buffer */ +- +-/* +- * Various structures and definitions from NSS are here. +- */ +- +-#ifdef _KERNEL +-#define PORT_ArenaAlloc(a, n, f) kmem_alloc((n), (f)) +-#define PORT_ArenaZAlloc(a, n, f) kmem_zalloc((n), (f)) +-#define PORT_ArenaGrow(a, b, c, d) NULL +-#define PORT_ZAlloc(n, f) kmem_zalloc((n), (f)) +-#define PORT_Alloc(n, f) kmem_alloc((n), (f)) +-#else +-#define PORT_ArenaAlloc(a, n, f) malloc((n)) +-#define PORT_ArenaZAlloc(a, n, f) calloc(1, (n)) +-#define PORT_ArenaGrow(a, b, c, d) NULL +-#define PORT_ZAlloc(n, f) calloc(1, (n)) +-#define PORT_Alloc(n, f) malloc((n)) +-#endif +- +-#define PORT_NewArena(b) (char *)12345 +-#define PORT_ArenaMark(a) NULL +-#define PORT_ArenaUnmark(a, b) +-#define PORT_ArenaRelease(a, m) +-#define PORT_FreeArena(a, b) +-#define PORT_Strlen(s) strlen((s)) +-#define PORT_SetError(e) +- +-#define PRBool boolean_t +-#define PR_TRUE B_TRUE +-#define PR_FALSE B_FALSE +- +-#ifdef _KERNEL +-#define PORT_Assert ASSERT +-#define PORT_Memcpy(t, f, l) bcopy((f), (t), (l)) +-#else +-#define PORT_Assert assert +-#define PORT_Memcpy(t, f, l) memcpy((t), (f), (l)) +-#endif +- +-#define CHECK_OK(func) if (func == NULL) goto cleanup +-#define CHECK_SEC_OK(func) if (SECSuccess != (rv = func)) goto cleanup +- +-typedef enum { +- siBuffer = 0, +- siClearDataBuffer = 1, +- siCipherDataBuffer = 2, +- siDERCertBuffer = 3, +- siEncodedCertBuffer = 4, +- siDERNameBuffer = 5, +- siEncodedNameBuffer = 6, +- siAsciiNameString = 7, +- siAsciiString = 8, +- siDEROID = 9, +- siUnsignedInteger = 10, +- siUTCTime = 11, +- siGeneralizedTime = 12 +-} SECItemType; +- +-typedef struct SECItemStr SECItem; +- +-struct SECItemStr { +- SECItemType type; +- unsigned char *data; +- unsigned int len; +-}; +- +-typedef SECItem SECKEYECParams; +- +-typedef enum { ec_params_explicit, +- ec_params_named +-} ECParamsType; +- +-typedef enum { ec_field_GFp = 1, +- ec_field_GF2m +-} ECFieldType; +- +-struct ECFieldIDStr { +- int size; /* field size in bits */ +- ECFieldType type; +- union { +- SECItem prime; /* prime p for (GFp) */ +- SECItem poly; /* irreducible binary polynomial for (GF2m) */ +- } u; +- int k1; /* first coefficient of pentanomial or +- * the only coefficient of trinomial +- */ +- int k2; /* two remaining coefficients of pentanomial */ +- int k3; +-}; +-typedef struct ECFieldIDStr ECFieldID; +- +-struct ECCurveStr { +- SECItem a; /* contains octet stream encoding of +- * field element (X9.62 section 4.3.3) +- */ +- SECItem b; +- SECItem seed; +-}; +-typedef struct ECCurveStr ECCurve; +- +-typedef void PRArenaPool; +- +-struct ECParamsStr { +- PRArenaPool * arena; +- ECParamsType type; +- ECFieldID fieldID; +- ECCurve curve; +- SECItem base; +- SECItem order; +- int cofactor; +- SECItem DEREncoding; +- ECCurveName name; +- SECItem curveOID; +-}; +-typedef struct ECParamsStr ECParams; +- +-struct ECPublicKeyStr { +- ECParams ecParams; +- SECItem publicValue; /* elliptic curve point encoded as +- * octet stream. +- */ +-}; +-typedef struct ECPublicKeyStr ECPublicKey; +- +-struct ECPrivateKeyStr { +- ECParams ecParams; +- SECItem publicValue; /* encoded ec point */ +- SECItem privateValue; /* private big integer */ +- SECItem version; /* As per SEC 1, Appendix C, Section C.4 */ +-}; +-typedef struct ECPrivateKeyStr ECPrivateKey; +- +-typedef enum _SECStatus { +- SECBufferTooSmall = -3, +- SECWouldBlock = -2, +- SECFailure = -1, +- SECSuccess = 0 +-} SECStatus; +- +-#ifdef _KERNEL +-#define RNG_GenerateGlobalRandomBytes(p,l) ecc_knzero_random_generator((p), (l)) +-#else +-/* +- This function is no longer required because the random bytes are now +- supplied by the caller. Force a failure. +-*/ +-#define RNG_GenerateGlobalRandomBytes(p,l) SECFailure +-#endif +-#define CHECK_MPI_OK(func) if (MP_OKAY > (err = func)) goto cleanup +-#define MP_TO_SEC_ERROR(err) +- +-#define SECITEM_TO_MPINT(it, mp) \ +- CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len)) +- +-extern int ecc_knzero_random_generator(uint8_t *, size_t); +-extern ulong_t soft_nzero_random_generator(uint8_t *, ulong_t); +- +-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); +-/* This function has been modified to accept an array of random bytes */ +-extern SECStatus ECDSA_SignDigest(ECPrivateKey *, SECItem *, const SECItem *, +- const unsigned char* random, int randomlen, int); +-extern SECStatus ECDSA_VerifyDigest(ECPublicKey *, const SECItem *, +- const SECItem *, int); +-extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, +- SECItem *, int); +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif /* _ECC_IMPL_H */ +diff -r afd392dfaed5 -r 48c15869ecd5 src/solaris/javavm/export/jni_md.h +--- openjdk/jdk/src/solaris/javavm/export/jni_md.h Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/src/solaris/javavm/export/jni_md.h Wed Jan 27 02:54:06 2016 +0000 +@@ -36,6 +36,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/pr1983-root.patch b/pr1983-root.patch new file mode 100644 index 0000000..100472b --- /dev/null +++ b/pr1983-root.patch @@ -0,0 +1,89 @@ +# HG changeset patch +# User andrew +# Date 1453863007 0 +# Wed Jan 27 02:50:07 2016 +0000 +# Node ID f0635543beb309c4da1bb88c906a76ee4b75e16d +# Parent 4a5a0d4e1ae0feec2f47d17be380d6fcd5eff126 +PR1983: Support using the system installation of NSS with the SunEC provider +Summary: Add new configure option --enable-system-nss + +diff -r 92af9369869f common/autoconf/jdk-options.m4 +--- openjdk/common/autoconf/jdk-options.m4 Thu Jan 21 22:17:02 2016 +0000 ++++ openjdk/common/autoconf/jdk-options.m4 Wed Jan 27 05:32:12 2016 +0000 +@@ -414,9 +414,10 @@ + # + AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], + [ +- AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) ++ AC_REQUIRE([LIB_SETUP_MISC_LIBS]) ++ AC_MSG_CHECKING([if the elliptic curve crypto implementation is present]) + +- if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then ++ if test "x${system_nss}" = "xyes" -o -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then + ENABLE_INTREE_EC=yes + AC_MSG_RESULT([yes]) + else +diff -r 92af9369869f common/autoconf/libraries.m4 +--- openjdk/common/autoconf/libraries.m4 Thu Jan 21 22:17:02 2016 +0000 ++++ openjdk/common/autoconf/libraries.m4 Wed Jan 27 05:32:12 2016 +0000 +@@ -731,6 +731,47 @@ + LIBDL="$LIBS" + 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, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no]) ++ if test "x${NSS_SOFTOKN_FOUND}" = "xyes"; then ++ NSS_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) ++ + ]) + + AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], +diff -r 92af9369869f common/autoconf/spec.gmk.in +--- openjdk/common/autoconf/spec.gmk.in Thu Jan 21 22:17:02 2016 +0000 ++++ openjdk/common/autoconf/spec.gmk.in Wed Jan 27 05:32:12 2016 +0000 +@@ -647,6 +647,9 @@ + # Read-only single-machine data + INSTALL_SYSCONFDIR=@sysconfdir@ + ++USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@ ++NSS_LIBS:=@NSS_LIBS@ ++NSS_CFLAGS:=@NSS_CFLAGS@ + + #################################################### + # diff --git a/pr2127.patch b/pr2127.patch new file mode 100644 index 0000000..b08822a --- /dev/null +++ b/pr2127.patch @@ -0,0 +1,178 @@ +# HG changeset patch +# User andrew +# Date 1453866306 0 +# Wed Jan 27 03:45:06 2016 +0000 +# Node ID 0ff7720931e8dbf7de25720bdc93b18527ab89e8 +# Parent 48c15869ecd568263249af4b9a4e98d4e57f9a8f +PR2127: SunEC provider crashes when built using system NSS +Summary: Use NSS memory management functions + +diff -r 48c15869ecd5 -r 0ff7720931e8 src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 02:54:06 2016 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 03:45:06 2016 +0000 +@@ -32,6 +32,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" { + +@@ -49,8 +56,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 + +@@ -64,6 +76,7 @@ + SECITEM_FreeItem(&ecparams->curveOID, B_FALSE); + if (freeStruct) + free(ecparams); ++#endif + } + + jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem) +@@ -108,6 +121,13 @@ + goto cleanup; + } + ++#ifdef SYSTEM_NSS ++ if (SECOID_Init() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ goto cleanup; ++ } ++#endif ++ + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -163,16 +183,26 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); ++#ifdef SYSTEM_NSS ++ if (SECOID_Shutdown() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif + } + if (ecparams) { + FreeECParams(ecparams, true); + } + 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) { +@@ -223,6 +253,13 @@ + goto cleanup; + } + ++#ifdef SYSTEM_NSS ++ if (SECOID_Init() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ goto cleanup; ++ } ++#endif ++ + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -270,6 +307,11 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); ++#ifdef SYSTEM_NSS ++ if (SECOID_Shutdown() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif + } + if (privKey.privateValue.data) { + env->ReleaseByteArrayElements(privateKey, +@@ -336,6 +378,13 @@ + goto cleanup; + } + ++#ifdef SYSTEM_NSS ++ if (SECOID_Init() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ goto cleanup; ++ } ++#endif ++ + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -356,9 +405,15 @@ + + cleanup: + { +- if (params_item.data) ++ if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); ++#ifdef SYSTEM_NSS ++ if (SECOID_Shutdown() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif ++ } + + if (pubKey.publicValue.data) + env->ReleaseByteArrayElements(publicKey, +@@ -419,6 +474,13 @@ + goto cleanup; + } + ++#ifdef SYSTEM_NSS ++ if (SECOID_Init() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ goto cleanup; ++ } ++#endif ++ + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -460,9 +522,15 @@ + 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); ++#ifdef SYSTEM_NSS ++ if (SECOID_Shutdown() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif ++ } + + if (ecparams) + FreeECParams(ecparams, true); diff --git a/pr2462.patch b/pr2462.patch new file mode 100644 index 0000000..17e1f69 --- /dev/null +++ b/pr2462.patch @@ -0,0 +1,302 @@ +# HG changeset patch +# User mikael +# Date 1426870964 25200 +# Fri Mar 20 10:02:44 2015 -0700 +# Node ID ee13ce369705a700b867f8c77423580b7b22cc13 +# Parent 7847ccfb240b35ed0dd328f0404b713b20e0905a +8074839: Resolve disabled warnings for libunpack and the unpack200 binary +Reviewed-by: dholmes, ksrini + +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; +- assert(res.len == 0 || inBounds(res.ptr) && inBounds(res.limit()-1)); ++ assert(res.len == 0 || (inBounds(res.ptr) && inBounds(res.limit()-1))); + return res; + } + // building C strings inside byte buffers: +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()); +- return false; ++ return null; + } + + // We have fetched all the files. +@@ -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(env, pObj, uPtr); + 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); ++ CHECK_EXCEPTION_RETURN_VALUE(uPtr, false); + const char* prop = env->GetStringUTFChars(pProp, JNI_FALSE); + CHECK_EXCEPTION_RETURN_VALUE(prop, false); + const char* value = env->GetStringUTFChars(pValue, JNI_FALSE); +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; + } + +-static const char* usage_lines[] = { +- "Usage: %s [-opt... | --option=value]... x.pack[.gz] y.jar\n", +- "\n", +- "Unpacking Options\n", +- " -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)\n", +- " -r, --remove-pack-file remove input file after unpacking\n", +- " -v, --verbose increase program verbosity\n", +- " -q, --quiet set verbosity to lowest level\n", +- " -l{F}, --log-file={F} output to the given log file, or '-' for standard output (default)\n", +- " -?, -h, --help print this message\n", +- " -V, --version print program version\n", +- " -J{X} Java VM argument (ignored)\n", +- null +-}; ++#define USAGE_HEADER "Usage: %s [-opt... | --option=value]... x.pack[.gz] y.jar\n" ++#define USAGE_OPTIONS \ ++ "\n" \ ++ "Unpacking Options\n" \ ++ " -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)\n" \ ++ " -r, --remove-pack-file remove input file after unpacking\n" \ ++ " -v, --verbose increase program verbosity\n" \ ++ " -q, --quiet set verbosity to lowest level\n" \ ++ " -l{F}, --log-file={F} output to the given log file, or '-' for standard output (default)\n" \ ++ " -?, -h, --help print this message\n" \ ++ " -V, --version print program version\n" \ ++ " -J{X} Java VM argument (ignored)\n" + + static void usage(unpacker* u, const char* progname, bool full = false) { + // WinMain does not set argv[0] to the progrname + progname = (progname != null) ? nbasename(progname) : "unpack200"; +- for (int i = 0; usage_lines[i] != null; i++) { +- fprintf(u->errstrm, usage_lines[i], progname); +- if (!full) { +- fprintf(u->errstrm, +- "(For more information, run %s --help .)\n", progname); +- break; +- } ++ ++ fprintf(u->errstrm, USAGE_HEADER, progname); ++ if (full) { ++ fprintf(u->errstrm, USAGE_OPTIONS); ++ } else { ++ fprintf(u->errstrm, "(For more information, run %s --help .)\n", progname); + } + } + +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 +- char* string() { return 0; } ++ const char* string() { return NULL; } + #else +- char* string(); // see far below ++ const char* string(); // see far below + #endif + }; + +@@ -715,13 +715,13 @@ + // Now we can size the whole archive. + // Read everything else into a mega-buffer. + rp = hdr.rp; +- int header_size_0 = (int)(rp - input.base()); // used-up header (4byte + 3int) +- int header_size_1 = (int)(rplimit - rp); // buffered unused initial fragment +- int header_size = header_size_0+header_size_1; ++ size_t header_size_0 = (rp - input.base()); // used-up header (4byte + 3int) ++ size_t header_size_1 = (rplimit - rp); // buffered unused initial fragment ++ size_t header_size = header_size_0 + header_size_1; + unsized_bytes_read = header_size_0; + CHECK; + if (foreign_buf) { +- if (archive_size > (size_t)header_size_1) { ++ if (archive_size > header_size_1) { + abort("EOF reading fixed input buffer"); + return; + } +@@ -735,7 +735,7 @@ + return; + } + input.set(U_NEW(byte, add_size(header_size_0, archive_size, C_SLOP)), +- (size_t) header_size_0 + archive_size); ++ header_size_0 + archive_size); + CHECK; + assert(input.limit()[0] == 0); + // Move all the bytes we read initially into the real buffer. +@@ -958,13 +958,13 @@ + nentries = next_entry; + + // place a limit on future CP growth: +- int generous = 0; ++ size_t generous = 0; + generous = add_size(generous, u->ic_count); // implicit name + generous = add_size(generous, u->ic_count); // outer + generous = add_size(generous, u->ic_count); // outer.utf8 + generous = add_size(generous, 40); // WKUs, misc + generous = add_size(generous, u->class_count); // implicit SourceFile strings +- maxentries = add_size(nentries, generous); ++ maxentries = (uint)add_size(nentries, generous); + + // Note that this CP does not include "empty" entries + // for longs and doubles. Those are introduced when +@@ -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; + +-static bytes& getbuf(int len) { // for debugging only! ++static bytes& getbuf(size_t len) { // for debugging only! + static int bn = 0; + static bytes bufs[8]; + bytes& buf = bufs[bn++ & 7]; +- while ((int)buf.len < len+10) ++ while (buf.len < len + 10) { + buf.realloc(buf.len ? buf.len * 2 : 1000); ++ } + buf.ptr[0] = 0; // for the sake of strcat + return buf; + } + +-char* entry::string() { ++const char* entry::string() { + bytes buf; + switch (tag) { + case CONSTANT_None: +- return (char*)""; ++ return ""; + case CONSTANT_Signature: + if (value.b.ptr == null) + return ref(0)->string(); +@@ -3711,26 +3713,28 @@ + break; + default: + if (nrefs == 0) { +- buf = getbuf(20); +- sprintf((char*)buf.ptr, TAG_NAME[tag]); ++ return TAG_NAME[tag]; + } else if (nrefs == 1) { + return refs[0]->string(); + } else { +- char* s1 = refs[0]->string(); +- char* s2 = refs[1]->string(); +- buf = getbuf((int)strlen(s1) + 1 + (int)strlen(s2) + 4 + 1); ++ const char* s1 = refs[0]->string(); ++ const char* s2 = refs[1]->string(); ++ buf = getbuf(strlen(s1) + 1 + strlen(s2) + 4 + 1); + buf.strcat(s1).strcat(" ").strcat(s2); + if (nrefs > 2) buf.strcat(" ..."); + } + } +- return (char*)buf.ptr; ++ return (const char*)buf.ptr; + } + + void print_cp_entry(int i) { + entry& e = debug_u->cp.entries[i]; +- char buf[30]; +- sprintf(buf, ((uint)e.tag < CONSTANT_Limit)? TAG_NAME[e.tag]: "%d", e.tag); +- printf(" %d\t%s %s\n", i, buf, e.string()); ++ ++ if ((uint)e.tag < CONSTANT_Limit) { ++ printf(" %d\t%s %s\n", i, TAG_NAME[e.tag], e.string()); ++ } else { ++ printf(" %d\t%d %s\n", i, e.tag, e.string()); ++ } + } + + void print_cp_entries(int beg, int end) { +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; +- int unsized_bytes_read; ++ size_t unsized_bytes_read; + + // 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 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); +- fprintf(stdout, 1+message); ++ fprintf(stdout, "%s", 1+message); + breakpoint(); + unpack_abort(message); + return 0; +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. +-void jar::write_data(void* buff, int len) { ++void jar::write_data(void* buff, size_t len) { + while (len > 0) { + int rc = (int)fwrite(buff, 1, len, jarfp); + if (rc <= 0) { +@@ -323,12 +323,12 @@ + // Total number of disks (int) + header64[36] = (ushort)SWAP_BYTES(1); + header64[37] = 0; +- write_data(header64, (int)sizeof(header64)); ++ write_data(header64, sizeof(header64)); + } + + // Write the End of Central Directory structure. + PRINTCR((2, "end-of-directory at %d\n", output_file_offset)); +- write_data(header, (int)sizeof(header)); ++ write_data(header, sizeof(header)); + + PRINTCR((2, "writing zip comment\n")); + // Write the comment. +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 +- void write_data(void* ptr, int len); +- void write_data(bytes& b) { write_data(b.ptr, (int)b.len); } ++ void write_data(void* ptr, size_t len); ++ void write_data(bytes& b) { write_data(b.ptr, b.len); } + void add_to_jar_directory(const char* fname, bool store, int modtime, + int len, int clen, uLong crc); + void write_jar_header(const char* fname, bool store, int modtime, diff --git a/pr2815.patch b/pr2815.patch new file mode 100644 index 0000000..db14f10 --- /dev/null +++ b/pr2815.patch @@ -0,0 +1,189 @@ +# HG changeset patch +# User andrew +# Date 1453867347 0 +# Wed Jan 27 04:02:27 2016 +0000 +# Node ID 26e2e029ee256e9815fdc324831a03d8582255e1 +# Parent 0ff7720931e8dbf7de25720bdc93b18527ab89e8 +PR2815: Race condition in SunEC provider with system NSS +Summary: Perform initialisation and shutdown only when library is loaded or SunEC is finalized respectively + +diff -r 0ff7720931e8 -r 26e2e029ee25 make/mapfiles/libsunec/mapfile-vers +--- openjdk/jdk/make/mapfiles/libsunec/mapfile-vers Wed Jan 27 03:45:06 2016 +0000 ++++ openjdk/jdk/make/mapfiles/libsunec/mapfile-vers Wed Jan 27 04:02:27 2016 +0000 +@@ -31,6 +31,8 @@ + Java_sun_security_ec_ECDSASignature_signDigest; + Java_sun_security_ec_ECDSASignature_verifySignedDigest; + Java_sun_security_ec_ECDHKeyAgreement_deriveKey; ++ Java_sun_security_ec_SunEC_initialize; ++ Java_sun_security_ec_SunEC_cleanup; + local: + *; + }; +diff -r 0ff7720931e8 -r 26e2e029ee25 src/share/classes/sun/security/ec/SunEC.java +--- openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java Wed Jan 27 03:45:06 2016 +0000 ++++ openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java Wed Jan 27 04:02:27 2016 +0000 +@@ -58,6 +58,7 @@ + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + System.loadLibrary("sunec"); // check for native library ++ initialize(); + return null; + } + }); +@@ -81,4 +82,22 @@ + } + } + ++ /** ++ * Cleanup native resources during finalisation. ++ */ ++ @Override ++ protected void finalize() { ++ cleanup(); ++ } ++ ++ /** ++ * Initialize the native code. ++ */ ++ private static native void initialize(); ++ ++ /** ++ * Cleanup in the native layer. ++ */ ++ private static native void cleanup(); ++ + } +diff -r 0ff7720931e8 -r 26e2e029ee25 src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 03:45:06 2016 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 04:02:27 2016 +0000 +@@ -121,13 +121,6 @@ + goto cleanup; + } + +-#ifdef SYSTEM_NSS +- if (SECOID_Init() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- goto cleanup; +- } +-#endif +- + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -183,11 +176,6 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); +-#ifdef SYSTEM_NSS +- if (SECOID_Shutdown() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- } +-#endif + } + if (ecparams) { + FreeECParams(ecparams, true); +@@ -253,13 +241,6 @@ + goto cleanup; + } + +-#ifdef SYSTEM_NSS +- if (SECOID_Init() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- goto cleanup; +- } +-#endif +- + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -307,11 +288,6 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); +-#ifdef SYSTEM_NSS +- if (SECOID_Shutdown() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- } +-#endif + } + if (privKey.privateValue.data) { + env->ReleaseByteArrayElements(privateKey, +@@ -378,13 +354,6 @@ + goto cleanup; + } + +-#ifdef SYSTEM_NSS +- if (SECOID_Init() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- goto cleanup; +- } +-#endif +- + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -408,11 +377,6 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); +-#ifdef SYSTEM_NSS +- if (SECOID_Shutdown() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- } +-#endif + } + + if (pubKey.publicValue.data) +@@ -474,13 +438,6 @@ + goto cleanup; + } + +-#ifdef SYSTEM_NSS +- if (SECOID_Init() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- goto cleanup; +- } +-#endif +- + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ +@@ -525,11 +482,6 @@ + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); +-#ifdef SYSTEM_NSS +- if (SECOID_Shutdown() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- } +-#endif + } + + if (ecparams) +@@ -539,4 +491,26 @@ + 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); ++ } ++#endif ++} ++ ++JNIEXPORT void ++JNICALL Java_sun_security_ec_SunEC_cleanup ++ (JNIEnv *env, jclass UNUSED(clazz)) ++{ ++#ifdef SYSTEM_NSS ++ if (SECOID_Shutdown() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif ++} ++ + } /* extern "C" */ diff --git a/pr2842-01.patch b/pr2842-01.patch new file mode 100644 index 0000000..4ee4c55 --- /dev/null +++ b/pr2842-01.patch @@ -0,0 +1,22 @@ +# HG changeset patch +# User mduigou +# Date 1389723922 28800 +# Tue Jan 14 10:25:22 2014 -0800 +# Node ID 842cc183c9f6d29270ff002238248978c08f0a66 +# Parent f0635543beb309c4da1bb88c906a76ee4b75e16d +8031668, PR2842: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links +Reviewed-by: erikj, ihse + +diff -r f0635543beb3 -r 842cc183c9f6 common/autoconf/toolchain.m4 +--- openjdk/./common/autoconf/toolchain.m4 Wed Jan 27 02:50:07 2016 +0000 ++++ openjdk/./common/autoconf/toolchain.m4 Tue Jan 14 10:25:22 2014 -0800 +@@ -188,8 +188,8 @@ + $1="$PROPER_COMPILER_$1" + else + AC_MSG_RESULT([no, keeping $1]) +- $1="$TEST_COMPILER" + fi ++ + TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) + ]) + diff --git a/pr2842-02.patch b/pr2842-02.patch new file mode 100644 index 0000000..f5268fc --- /dev/null +++ b/pr2842-02.patch @@ -0,0 +1,65 @@ +# HG changeset patch +# User ihse +# Date 1454642639 0 +# Fri Feb 05 03:23:59 2016 +0000 +# Node ID 61798573efe5a9efa67e268a52cf61263abb4396 +# Parent 842cc183c9f6d29270ff002238248978c08f0a66 +8148351, PR2842: Only display resolved symlink for compiler, do not change path +Reviewed-by: erikj + +diff -r 5096b6468914 common/autoconf/toolchain.m4 +--- openjdk/./common/autoconf/toolchain.m4 Tue Jan 14 10:25:22 2014 -0800 ++++ openjdk/./common/autoconf/toolchain.m4 Fri Feb 05 20:02:15 2016 +0000 +@@ -147,38 +147,22 @@ + fi + BASIC_FIXUP_EXECUTABLE($1) + TEST_COMPILER="[$]$1" +- # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links +- # to 'xlc' but it is crucial that we invoke the compiler with the right name! +- if test "x$OPENJDK_BUILD_OS" != xaix; then +- AC_MSG_CHECKING([resolved symbolic links for $1]) +- BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) +- AC_MSG_RESULT([$TEST_COMPILER]) +- fi +- AC_MSG_CHECKING([if $1 is disguised ccache]) + +- COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` +- if test "x$COMPILER_BASENAME" = "xccache"; then +- AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) +- # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. +- # We want to control ccache invocation ourselves, so ignore this cc and try +- # searching again. ++ AC_MSG_CHECKING([resolved symbolic links for $1]) ++ SYMLINK_ORIGINAL="$TEST_COMPILER" ++ BASIC_REMOVE_SYMBOLIC_LINKS(SYMLINK_ORIGINAL) ++ if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then ++ AC_MSG_RESULT([no symlink]) ++ else ++ AC_MSG_RESULT([$SYMLINK_ORIGINAL]) + +- # Remove the path to the fake ccache cc from the PATH +- RETRY_COMPILER_SAVED_PATH="$PATH" +- COMPILER_DIRNAME=`$DIRNAME [$]$1` +- PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" +- +- # Try again looking for our compiler +- AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) +- BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) +- PATH="$RETRY_COMPILER_SAVED_PATH" +- +- AC_MSG_CHECKING([for resolved symbolic links for $1]) +- BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) +- AC_MSG_RESULT([$PROPER_COMPILER_$1]) +- $1="$PROPER_COMPILER_$1" +- else +- AC_MSG_RESULT([no, keeping $1]) ++ # We can't handle ccache by gcc wrappers, since we need to know if we're ++ # using ccache. Instead ccache usage must be controlled by a configure option. ++ COMPILER_BASENAME=`$BASENAME "$SYMLINK_ORIGINAL"` ++ if test "x$COMPILER_BASENAME" = "xccache"; then ++ AC_MSG_NOTICE([Please use --enable-ccache instead of providing a wrapped compiler.]) ++ AC_MSG_ERROR([$TEST_COMPILER is a symbolic link to ccache. This is not supported.]) ++ fi + fi + + TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) diff --git a/pr2899.patch b/pr2899.patch new file mode 100644 index 0000000..58fb3c8 --- /dev/null +++ b/pr2899.patch @@ -0,0 +1,23 @@ +# HG changeset patch +# User andrew +# Date 1459313680 -3600 +# Wed Mar 30 05:54:40 2016 +0100 +# Node ID 9dc0eca5fa8926e6a952fa4f1931e78aa1f52443 +# Parent 8957aff589013e671f02d38023d5ff245ef27e87 +PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed +Contributed-by: Alex Kashchenko + +diff -r 8957aff58901 -r 9dc0eca5fa89 src/share/native/sun/security/ec/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Mar 30 04:48:56 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Mar 30 05:54:40 2016 +0100 +@@ -267,8 +267,8 @@ + + #ifdef SYSTEM_NSS + #define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) +-#define EC_NewKey(a,b,c,d,e) EC_NewKeyFromSeed(a,b,c,d) +-#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigestWithSeed(a,b,c,d,e) ++#define EC_NewKey(a,b,c,d,e) EC_NewKey(a,b) ++#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigest(a,b,c) + #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 diff --git a/pr2934.patch b/pr2934.patch new file mode 100644 index 0000000..21e769d --- /dev/null +++ b/pr2934.patch @@ -0,0 +1,90 @@ +# HG changeset patch +# User andrew +# Date 1461349033 -3600 +# Fri Apr 22 19:17:13 2016 +0100 +# Node ID dab76de2f91cf1791c03560a3f45aaa69f8351fd +# Parent 3fa42705acab6d69b6141f47ebba4f85739a338c +PR2934: SunEC provider throwing KeyException with current NSS +Summary: Initialise the random number generator and feed the seed to it. + +diff -r 3fa42705acab -r dab76de2f91c src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Apr 20 03:39:11 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Fri Apr 22 19:17:13 2016 +0100 +@@ -134,8 +134,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; + } +@@ -267,8 +276,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) != SECSuccess) { ++#endif + ThrowException(env, KEY_EXCEPTION); + goto cleanup; + } +@@ -499,6 +518,9 @@ + if (SECOID_Init() != SECSuccess) { + ThrowException(env, INTERNAL_ERROR); + } ++ if (RNG_RNGInit() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } + #endif + } + +@@ -507,6 +529,7 @@ + (JNIEnv *env, jclass UNUSED(clazz)) + { + #ifdef SYSTEM_NSS ++ RNG_RNGShutdown(); + if (SECOID_Shutdown() != SECSuccess) { + ThrowException(env, INTERNAL_ERROR); + } +diff -r 3fa42705acab -r dab76de2f91c src/share/native/sun/security/ec/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Apr 20 03:39:11 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Fri Apr 22 19:17:13 2016 +0100 +@@ -254,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) + +@@ -267,8 +269,6 @@ + + #ifdef SYSTEM_NSS + #define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) +-#define EC_NewKey(a,b,c,d,e) EC_NewKey(a,b) +-#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigest(a,b,c) + #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 diff --git a/pr2974-rh1337583.patch b/pr2974-rh1337583.patch new file mode 100644 index 0000000..5c00050 --- /dev/null +++ b/pr2974-rh1337583.patch @@ -0,0 +1,148 @@ +# HG changeset patch +# User andrew +# Date 1464316115 -3600 +# Fri May 27 03:28:35 2016 +0100 +# Node ID 794541fbbdc323f7da8a5cee75611f977eee66ee +# Parent 0be28a33e12dfc9ae1e4be381530643f691d351a +PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings +Summary: Add -systemlineendings option to keytool to allow system line endings to be used again. + +diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/pkcs10/PKCS10.java +--- openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java Tue Dec 29 10:40:43 2015 -0500 ++++ openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java Fri May 27 03:28:35 2016 +0100 +@@ -30,6 +30,7 @@ + import java.io.IOException; + import java.math.BigInteger; + ++import java.security.AccessController; + import java.security.cert.CertificateException; + import java.security.NoSuchAlgorithmException; + import java.security.InvalidKeyException; +@@ -39,6 +40,7 @@ + + import java.util.Base64; + ++import sun.security.action.GetPropertyAction; + import sun.security.util.*; + import sun.security.x509.AlgorithmId; + import sun.security.x509.X509Key; +@@ -76,6 +78,14 @@ + * @author Hemma Prafullchandra + */ + public class PKCS10 { ++ ++ private static final byte[] sysLineEndings; ++ ++ static { ++ sysLineEndings = ++ AccessController.doPrivileged(new GetPropertyAction("line.separator")).getBytes(); ++ } ++ + /** + * Constructs an unsigned PKCS #10 certificate request. Before this + * request may be used, it must be encoded and signed. Then it +@@ -286,13 +296,39 @@ + */ + public void print(PrintStream out) + throws IOException, SignatureException { ++ print(out, false); ++ } ++ ++ /** ++ * Prints an E-Mailable version of the certificate request on the print ++ * stream passed. The format is a common base64 encoded one, supported ++ * by most Certificate Authorities because Netscape web servers have ++ * used this for some time. Some certificate authorities expect some ++ * more information, in particular contact information for the web ++ * server administrator. ++ * ++ * @param out the print stream where the certificate request ++ * will be printed. ++ * @param systemLineEndings true if the request should be terminated ++ * using the system line endings. ++ * @exception IOException when an output operation failed ++ * @exception SignatureException when the certificate request was ++ * not yet signed. ++ */ ++ public void print(PrintStream out, boolean systemLineEndings) ++ throws IOException, SignatureException { ++ byte[] lineEndings; ++ + if (encoded == null) + throw new SignatureException("Cert request was not signed"); + ++ if (systemLineEndings) ++ lineEndings = sysLineEndings; ++ else ++ lineEndings = new byte[] {'\r', '\n'}; // CRLF + +- byte[] CRLF = new byte[] {'\r', '\n'}; + out.println("-----BEGIN NEW CERTIFICATE REQUEST-----"); +- out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(encoded)); ++ out.println(Base64.getMimeEncoder(64, lineEndings).encodeToString(encoded)); + out.println("-----END NEW CERTIFICATE REQUEST-----"); + } + +diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Main.java +--- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java Tue Dec 29 10:40:43 2015 -0500 ++++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java Fri May 27 03:28:35 2016 +0100 +@@ -117,6 +117,7 @@ + private String infilename = null; + private String outfilename = null; + private String srcksfname = null; ++ private boolean systemLineEndings = false; + + // User-specified providers are added before any command is called. + // However, they are not removed before the end of the main() method. +@@ -163,7 +164,7 @@ + CERTREQ("Generates.a.certificate.request", + ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME, + STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, +- PROVIDERARG, PROVIDERPATH, V, PROTECTED), ++ PROVIDERARG, PROVIDERPATH, SYSTEMLINEENDINGS, V, PROTECTED), + CHANGEALIAS("Changes.an.entry.s.alias", + ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS, + STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, +@@ -296,6 +297,7 @@ + STARTDATE("startdate", "", "certificate.validity.start.date.time"), + STOREPASS("storepass", "", "keystore.password"), + STORETYPE("storetype", "", "keystore.type"), ++ SYSTEMLINEENDINGS("systemlineendings", null, "system.line.endings"), + TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"), + V("v", null, "verbose.output"), + VALIDITY("validity", "", "validity.number.of.days"); +@@ -537,6 +539,8 @@ + protectedPath = true; + } else if (collator.compare(flags, "-srcprotected") == 0) { + srcprotectedPath = true; ++ } else if (collator.compare(flags, "-systemlineendings") == 0) { ++ systemLineEndings = true; + } else { + System.err.println(rb.getString("Illegal.option.") + flags); + tinyHelp(); +@@ -1335,7 +1339,7 @@ + + // Sign the request and base-64 encode it + request.encodeAndSign(subject, signature); +- request.print(out); ++ request.print(out, systemLineEndings); + } + + /** +@@ -4191,4 +4195,3 @@ + return new Pair<>(a,b); + } + } +- +diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Resources.java +--- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java Tue Dec 29 10:40:43 2015 -0500 ++++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java Fri May 27 03:28:35 2016 +0100 +@@ -168,6 +168,8 @@ + "keystore password"}, //-storepass + {"keystore.type", + "keystore type"}, //-storetype ++ {"system.line.endings", ++ "use system line endings rather than CRLF to terminate output"}, //-systemlineendings + {"trust.certificates.from.cacerts", + "trust certificates from cacerts"}, //-trustcacerts + {"verbose.output", diff --git a/pr3083-rh1346460.patch b/pr3083-rh1346460.patch new file mode 100644 index 0000000..d44ed1d --- /dev/null +++ b/pr3083-rh1346460.patch @@ -0,0 +1,152 @@ +# HG changeset patch +# User andrew +# Date 1467652889 -3600 +# Mon Jul 04 18:21:29 2016 +0100 +# Node ID a4541d1d8609cadb08d3e31b40b9184ff32dd6c3 +# Parent bc6eab2038c603afb2eb2b4644f3b900c8fd0c46 +PR3083, RH1346460: Regression in SSL debug output without an ECC provider +Summary: Return null rather than throwing an exception when there's no ECC provider. + +diff -r bc6eab2038c6 -r a4541d1d8609 src/share/classes/sun/security/util/Debug.java +--- openjdk/jdk/src/share/classes/sun/security/util/Debug.java Mon Jul 04 17:08:12 2016 +0100 ++++ openjdk/jdk/src/share/classes/sun/security/util/Debug.java Mon Jul 04 18:21:29 2016 +0100 +@@ -73,6 +73,7 @@ + System.err.println("certpath PKIX CertPathBuilder and"); + System.err.println(" CertPathValidator debugging"); + System.err.println("combiner SubjectDomainCombiner debugging"); ++ System.err.println("ecc Elliptic Curve Cryptography debugging"); + System.err.println("gssloginconfig"); + System.err.println(" GSS LoginConfigImpl debugging"); + System.err.println("configfile JAAS ConfigFile loading"); +diff -r bc6eab2038c6 -r a4541d1d8609 src/share/classes/sun/security/util/ECUtil.java +--- openjdk/jdk/src/share/classes/sun/security/util/ECUtil.java Mon Jul 04 17:08:12 2016 +0100 ++++ openjdk/jdk/src/share/classes/sun/security/util/ECUtil.java Mon Jul 04 18:21:29 2016 +0100 +@@ -41,6 +41,9 @@ + + public class ECUtil { + ++ /* Are we debugging ? */ ++ private static final Debug debug = Debug.getInstance("ecc"); ++ + // Used by SunPKCS11 and SunJSSE. + public static ECPoint decodePoint(byte[] data, EllipticCurve curve) + throws IOException { +@@ -90,6 +93,10 @@ + } + + private static AlgorithmParameters getECParameters(Provider p) { ++ return getECParameters(p, false); ++ } ++ ++ private static AlgorithmParameters getECParameters(Provider p, boolean throwException) { + try { + if (p != null) { + return AlgorithmParameters.getInstance("EC", p); +@@ -97,13 +104,21 @@ + + return AlgorithmParameters.getInstance("EC"); + } catch (NoSuchAlgorithmException nsae) { +- throw new RuntimeException(nsae); ++ if (throwException) { ++ throw new RuntimeException(nsae); ++ } else { ++ // ECC provider is optional so just return null ++ if (debug != null) { ++ debug.println("Provider unavailable: " + nsae); ++ } ++ return null; ++ } + } + } + + public static byte[] encodeECParameterSpec(Provider p, + ECParameterSpec spec) { +- AlgorithmParameters parameters = getECParameters(p); ++ AlgorithmParameters parameters = getECParameters(p, true); + + try { + parameters.init(spec); +@@ -122,11 +137,16 @@ + public static ECParameterSpec getECParameterSpec(Provider p, + ECParameterSpec spec) { + AlgorithmParameters parameters = getECParameters(p); ++ if (parameters == null) ++ return null; + + try { + parameters.init(spec); + return parameters.getParameterSpec(ECParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { ++ if (debug != null) { ++ debug.println("Invalid parameter specification: " + ipse); ++ } + return null; + } + } +@@ -135,34 +155,49 @@ + byte[] params) + throws IOException { + AlgorithmParameters parameters = getECParameters(p); ++ if (parameters == null) ++ return null; + + parameters.init(params); + + try { + return parameters.getParameterSpec(ECParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { ++ if (debug != null) { ++ debug.println("Invalid parameter specification: " + ipse); ++ } + return null; + } + } + + public static ECParameterSpec getECParameterSpec(Provider p, String name) { + AlgorithmParameters parameters = getECParameters(p); ++ if (parameters == null) ++ return null; + + try { + parameters.init(new ECGenParameterSpec(name)); + return parameters.getParameterSpec(ECParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { ++ if (debug != null) { ++ debug.println("Invalid parameter specification: " + ipse); ++ } + return null; + } + } + + public static ECParameterSpec getECParameterSpec(Provider p, int keySize) { + AlgorithmParameters parameters = getECParameters(p); ++ if (parameters == null) ++ return null; + + try { + parameters.init(new ECKeySizeParameterSpec(keySize)); + return parameters.getParameterSpec(ECParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { ++ if (debug != null) { ++ debug.println("Invalid parameter specification: " + ipse); ++ } + return null; + } + +@@ -171,11 +206,16 @@ + public static String getCurveName(Provider p, ECParameterSpec spec) { + ECGenParameterSpec nameSpec; + AlgorithmParameters parameters = getECParameters(p); ++ if (parameters == null) ++ return null; + + try { + parameters.init(spec); + nameSpec = parameters.getParameterSpec(ECGenParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { ++ if (debug != null) { ++ debug.println("Invalid parameter specification: " + ipse); ++ } + return null; + } + diff --git a/repackReproduciblePolycies.sh b/repackReproduciblePolycies.sh new file mode 100755 index 0000000..271cb74 --- /dev/null +++ b/repackReproduciblePolycies.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# https://bugzilla.redhat.com/show_bug.cgi?id=1142153 +M=META-INF/MANIFEST.MF +#P=/usr/lib/jvm/java/jre/lib/security +P=$1/lib/security +for f in local_policy.jar US_export_policy.jar ; do +ORIG=$P/$f +echo "processing $f ($ORIG)" +if [ ! -f $ORIG ]; then + echo "File not found! $ORIG" + continue +fi +d=`mktemp -d` +NW=$d/$f + pushd $d + jar xf $ORIG + cat $M +# sed -i "s/Created-By.*/Created-By: 1.7.0/g" $M + sed -i "s/Created-By.*/Created-By: $2/g" $M + cat $M + find . -exec touch -t 201401010000 {} + + zip -rX $f * + popd + echo "replacing $ORIG" + touch -t 201401010000 $ORIG + md5sum $ORIG + sha256sum $ORIG + echo "by $NW" + md5sum $NW + sha256sum $NW + touch -t 201401010000 $NW + cp $NW $ORIG + md5sum $ORIG + sha256sum $ORIG + touch -t 201401010000 $ORIG + rm -rfv $d +done diff --git a/rh1163501.patch b/rh1163501.patch new file mode 100644 index 0000000..51cd4b9 --- /dev/null +++ b/rh1163501.patch @@ -0,0 +1,114 @@ +--- jdk8/jdk/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java Tue Mar 17 00:09:12 2015 +0300 ++++ jdk8/jdk/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java Wed Apr 08 14:25:54 2015 +0100 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2014 Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -80,10 +81,10 @@ + * @param random the source of randomness + */ + public void initialize(int keysize, SecureRandom random) { +- if ((keysize < 512) || (keysize > 2048) || (keysize % 64 != 0)) { ++ if ((keysize < 512) || (keysize > 4096) || (keysize % 64 != 0)) { + throw new InvalidParameterException("Keysize must be multiple " + + "of 64, and can only range " +- + "from 512 to 2048 " ++ + "from 512 to 4096 " + + "(inclusive)"); + } + this.pSize = keysize; +@@ -115,11 +116,11 @@ + + params = (DHParameterSpec)algParams; + pSize = params.getP().bitLength(); +- if ((pSize < 512) || (pSize > 2048) || ++ if ((pSize < 512) || (pSize > 4096) || + (pSize % 64 != 0)) { + throw new InvalidAlgorithmParameterException + ("Prime size must be multiple of 64, and can only range " +- + "from 512 to 2048 (inclusive)"); ++ + "from 512 to 4096 (inclusive)"); + } + + // exponent size is optional, could be 0 +--- jdk8/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java Tue Mar 17 00:09:12 2015 +0300 ++++ jdk8/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java Wed Apr 08 14:25:54 2015 +0100 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2014 Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -60,11 +61,11 @@ + + private static void checkKeySize(int keysize) + throws InvalidAlgorithmParameterException { +- if ((keysize != 2048) && ++ if ((keysize != 2048) && (keysize != 4096) && + ((keysize < 512) || (keysize > 1024) || (keysize % 64 != 0))) { + throw new InvalidAlgorithmParameterException( + "Keysize must be multiple of 64 ranging from " +- + "512 to 1024 (inclusive), or 2048"); ++ + "512 to 1024 (inclusive), or 2048, or 4096"); + } + } + +--- jdk8/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java Tue Mar 17 00:09:12 2015 +0300 ++++ jdk8/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java Wed Apr 08 14:25:54 2015 +0100 +@@ -278,11 +278,11 @@ + // this restriction is in the spec for DSA + // since we currently use DSA parameters for DH as well, + // it also applies to DH if no parameters are specified +- if ((keySize != 2048) && ++ if ((keySize != 2048) && (keySize != 4096) && + ((keySize > 1024) || ((keySize & 0x3f) != 0))) { + throw new InvalidAlgorithmParameterException(algorithm + + " key must be multiples of 64 if less than 1024 bits" + +- ", or 2048 bits"); ++ ", or 2048 bits, or 4096 bits"); + } + } + } +--- jdk8/jdk/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java Tue Mar 17 00:09:12 2015 +0300 ++++ jdk8/jdk/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java Wed Apr 08 14:25:54 2015 +0100 +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2014 Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -58,7 +59,7 @@ + */ + private enum Sizes { + two56(256), three84(384), five12(512), seven68(768), ten24(1024), +- twenty48(2048); ++ twenty48(2048), forty96(4096); + + private final int intSize; + private final BigInteger bigIntValue; +@@ -130,6 +131,19 @@ + kp = kpg.generateKeyPair(); + checkKeyPair(kp, Sizes.twenty48, Sizes.five12); + ++ kpg.initialize(Sizes.forty96.getIntSize()); ++ kp = kpg.generateKeyPair(); ++ checkKeyPair(kp, Sizes.forty96, Sizes.twenty48); ++ ++ publicKey = (DHPublicKey)kp.getPublic(); ++ p = publicKey.getParams().getP(); ++ g = publicKey.getParams().getG(); ++ ++ // test w/ all values specified ++ kpg.initialize(new DHParameterSpec(p, g, Sizes.ten24.getIntSize())); ++ kp = kpg.generateKeyPair(); ++ checkKeyPair(kp, Sizes.forty96, Sizes.ten24); ++ + System.out.println("OK"); + } + + diff --git a/rh1176206-jdk.patch b/rh1176206-jdk.patch new file mode 100644 index 0000000..23b8e52 --- /dev/null +++ b/rh1176206-jdk.patch @@ -0,0 +1,67 @@ +--- openjdk/jdk/make/lib/Awt2dLibraries.gmk 2016-02-29 17:11:00.497484904 +0100 ++++ openjdk/jdk/make/lib/Awt2dLibraries.gmk 2016-02-29 17:11:00.402486574 +0100 +@@ -618,7 +618,7 @@ + XRSurfaceData.c \ + XRBackendNative.c + +- LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc ++ LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender -lXcomposite $(LIBDL) -lXtst -lXi -ljava -ljvm -lc + + ifeq ($(OPENJDK_TARGET_OS), linux) + # To match old build, add this to LDFLAGS instead of suffix. +--- openjdk/jdk/src/solaris/native/sun/awt/awt_Robot.c 2016-02-29 17:11:00.777479982 +0100 ++++ openjdk/jdk/src/solaris/native/sun/awt/awt_Robot.c 2016-02-29 17:11:00.677481740 +0100 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include "robot_common.h" +@@ -88,6 +89,32 @@ + return isXTestAvailable; + } + ++static Bool hasXCompositeOverlayExtension(Display *display) { ++ ++ int xoverlay = False; ++ int eventBase, errorBase; ++ if (XCompositeQueryExtension(display, &eventBase, &errorBase)) { ++ int major = 0; ++ int minor = 0; ++ ++ XCompositeQueryVersion(display, &major, &minor); ++ if (major > 0 || minor >= 3) ++ xoverlay = True; ++ } ++ ++ return xoverlay; ++} ++ ++static jboolean isXCompositeDisplay(Display *display, int screenNumber) { ++ ++ char NET_WM_CM_Sn[25]; ++ snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber); ++ ++ Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0); ++ Window owner = XGetSelectionOwner(display, managerSelection); ++ ++ return owner != 0; ++} + + static XImage *getWindowImage(Display * display, Window window, + int32_t x, int32_t y, +@@ -232,6 +259,12 @@ + DASSERT(adata != NULL); + + rootWindow = XRootWindow(awt_display, adata->awt_visInfo.screen); ++ if (isXCompositeDisplay(awt_display, adata->awt_visInfo.screen) && ++ hasXCompositeOverlayExtension(awt_display)) ++ { ++ rootWindow = XCompositeGetOverlayWindow(awt_display, rootWindow); ++ } ++ + image = getWindowImage(awt_display, rootWindow, x, y, width, height); + + /* Array to use to crunch around the pixel values */ diff --git a/rh1176206-root.patch b/rh1176206-root.patch new file mode 100644 index 0000000..db1061c --- /dev/null +++ b/rh1176206-root.patch @@ -0,0 +1,31 @@ +--- openjdk/common/autoconf/help.m4 2016-02-29 17:10:45.542747800 +0100 ++++ openjdk/common/autoconf/help.m4 2016-02-29 17:10:45.500748539 +0100 +@@ -112,7 +112,7 @@ + pulse) + PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; + x11) +- PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; ++ PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libXcomposite-dev" ;; + ccache) + PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; + esac +--- openjdk/common/autoconf/libraries.m4 2016-02-29 17:10:45.716744742 +0100 ++++ openjdk/common/autoconf/libraries.m4 2016-02-29 17:10:45.675745462 +0100 +@@ -153,7 +153,7 @@ + CFLAGS="$CFLAGS $X_CFLAGS" + + # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 +- AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], ++ AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h X11/extensions/Xcomposite.h], + [X11_A_OK=yes], + [X11_A_OK=no; break], + [ +@@ -167,7 +167,7 @@ + + if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then + HELP_MSG_MISSING_DEPENDENCY([x11]) +- AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) ++ AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h Xcomposite.h). $HELP_MSG]) + fi + + AC_SUBST(X_CFLAGS) diff --git a/rh1214835.patch b/rh1214835.patch new file mode 100644 index 0000000..eba79a6 --- /dev/null +++ b/rh1214835.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User andrew +# Date 1429893959 -3600 +# Fri Apr 24 17:45:59 2015 +0100 +# Node ID 6e3f4784affc0de360d763ad69979690b2650a98 +# Parent 75acb9c0991bc118463debed137d38ce40358bc0 +4890063, PR2304, RH1214835: HPROF: default text truncated when using doe=n option + +diff -r 75acb9c0991b -r 6e3f4784affc src/share/demo/jvmti/hprof/hprof_init.c +--- openjdk/jdk/src/share/demo/jvmti/hprof/hprof_init.c Thu Jun 04 18:00:35 2015 +0100 ++++ openjdk/jdk/src/share/demo/jvmti/hprof/hprof_init.c Fri Apr 24 17:45:59 2015 +0100 +@@ -1361,7 +1361,7 @@ + } rawMonitorExit(gdata->dump_lock); + + /* Dump everything if we need to */ +- if (gdata->dump_on_exit && need_to_dump) { ++ if (gdata->dump_on_exit || need_to_dump) { + + dump_all_data(env); + } diff --git a/s390-size_t_format_flags.patch b/s390-size_t_format_flags.patch new file mode 100644 index 0000000..b9ae9ab --- /dev/null +++ b/s390-size_t_format_flags.patch @@ -0,0 +1,143 @@ +diff -r cf43a852f486 src/share/vm/asm/codeBuffer.cpp +--- openjdk/hotspot/src/share/vm/asm/codeBuffer.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/asm/codeBuffer.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -977,7 +977,7 @@ + for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) { + CodeSection* sect = code_section(n); + if (!sect->is_allocated() || sect->is_empty()) continue; +- xtty->print_cr("", ++ xtty->print_cr("", + n, sect->limit() - sect->start(), sect->limit() - sect->end()); + } + xtty->print_cr(""); +diff -r cf43a852f486 src/share/vm/code/codeCache.cpp +--- openjdk/hotspot/src/share/vm/code/codeCache.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/code/codeCache.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -191,7 +191,7 @@ + } + if (PrintCodeCacheExtension) { + ResourceMark rm; +- tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)", ++ tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" INTX_FORMAT " bytes)", + (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(), + (address)_heap->high() - (address)_heap->low_boundary()); + } +diff -r cf43a852f486 src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -556,7 +556,7 @@ + " [Table]\n" + " [Memory Usage: "G1_STRDEDUP_BYTES_FORMAT_NS"]\n" + " [Size: "SIZE_FORMAT", Min: "SIZE_FORMAT", Max: "SIZE_FORMAT"]\n" +- " [Entries: "UINTX_FORMAT", Load: "G1_STRDEDUP_PERCENT_FORMAT_NS", Cached: " UINTX_FORMAT ", Added: "UINTX_FORMAT", Removed: "UINTX_FORMAT"]\n" ++ " [Entries: "UINTX_FORMAT", Load: "G1_STRDEDUP_PERCENT_FORMAT_NS", Cached: " SIZE_FORMAT ", Added: "UINTX_FORMAT", Removed: "UINTX_FORMAT"]\n" + " [Resize Count: "UINTX_FORMAT", Shrink Threshold: "UINTX_FORMAT"("G1_STRDEDUP_PERCENT_FORMAT_NS"), Grow Threshold: "UINTX_FORMAT"("G1_STRDEDUP_PERCENT_FORMAT_NS")]\n" + " [Rehash Count: "UINTX_FORMAT", Rehash Threshold: "UINTX_FORMAT", Hash Seed: 0x%x]\n" + " [Age Threshold: "UINTX_FORMAT"]", +diff -r cf43a852f486 src/share/vm/memory/blockOffsetTable.cpp +--- openjdk/hotspot/src/share/vm/memory/blockOffsetTable.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/blockOffsetTable.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -57,7 +57,7 @@ + gclog_or_tty->print_cr("BlockOffsetSharedArray::BlockOffsetSharedArray: "); + gclog_or_tty->print_cr(" " + " rs.base(): " INTPTR_FORMAT +- " rs.size(): " INTPTR_FORMAT ++ " rs.size(): " SIZE_FORMAT + " rs end(): " INTPTR_FORMAT, + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); + gclog_or_tty->print_cr(" " +diff -r cf43a852f486 src/share/vm/runtime/arguments.cpp +--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -1285,14 +1285,14 @@ + } + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); ++ tty->print_cr("CMS ergo set MaxNewSize: " UINTX_FORMAT, MaxNewSize); + } + + // Code along this path potentially sets NewSize and OldSize + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT +- " initial_heap_size: " SIZE_FORMAT ++ tty->print_cr("CMS set min_heap_size: " UINTX_FORMAT ++ " initial_heap_size: " UINTX_FORMAT + " max_heap: " SIZE_FORMAT, + min_heap_size(), InitialHeapSize, max_heap); + } +@@ -1308,7 +1308,7 @@ + FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t)NewSize)); + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); ++ tty->print_cr("CMS ergo set NewSize: " UINTX_FORMAT, NewSize); + } + } + // Unless explicitly requested otherwise, size old gen +@@ -1318,7 +1318,7 @@ + FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize)); + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); ++ tty->print_cr("CMS ergo set OldSize: " UINTX_FORMAT, OldSize); + } + } + } +@@ -1834,7 +1834,7 @@ + + if (PrintGCDetails && Verbose) { + // Cannot use gclog_or_tty yet. +- tty->print_cr(" Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial); ++ tty->print_cr(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); + } + FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial); + } +@@ -1844,7 +1844,7 @@ + set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize)); + if (PrintGCDetails && Verbose) { + // Cannot use gclog_or_tty yet. +- tty->print_cr(" Minimum heap size " SIZE_FORMAT, min_heap_size()); ++ tty->print_cr(" Minimum heap size " UINTX_FORMAT, min_heap_size()); + } + } + } +diff -r cf43a852f486 src/share/vm/utilities/globalDefinitions.hpp +--- openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Jan 13 05:30:26 2016 +0000 +@@ -1382,12 +1382,21 @@ + + #define INTPTR_FORMAT_W(width) "%" #width PRIxPTR + ++#if defined(S390) && !defined(_LP64) ++#define SSIZE_FORMAT "%z" PRIdPTR ++#define SIZE_FORMAT "%z" PRIuPTR ++#define SIZE_FORMAT_HEX "0x%z" PRIxPTR ++#define SSIZE_FORMAT_W(width) "%" #width "z" PRIdPTR ++#define SIZE_FORMAT_W(width) "%" #width "z" PRIuPTR ++#define SIZE_FORMAT_HEX_W(width) "0x%" #width "z" PRIxPTR ++#else // !S390 + #define SSIZE_FORMAT "%" PRIdPTR + #define SIZE_FORMAT "%" PRIuPTR + #define SIZE_FORMAT_HEX "0x%" PRIxPTR + #define SSIZE_FORMAT_W(width) "%" #width PRIdPTR + #define SIZE_FORMAT_W(width) "%" #width PRIuPTR + #define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR ++#endif // S390 + + #define INTX_FORMAT "%" PRIdPTR + #define UINTX_FORMAT "%" PRIuPTR +diff -r 388e9d0905e6 src/share/vm/memory/collectorPolicy.cpp +--- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Apr 11 11:33:18 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Tue Apr 12 04:12:50 2016 +0100 +@@ -1056,7 +1056,8 @@ + size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size); + assert(msp.initial_gen0_size() == expected, err_msg("%zu != %zu", msp.initial_gen0_size(), expected)); + assert(FLAG_IS_ERGO(NewSize) && NewSize == expected, +- err_msg("NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize)); ++ err_msg("NewSize should have been set ergonomically to " SIZE_FORMAT ", but was " UINTX_FORMAT, ++ expected, NewSize)); + } + + private: diff --git a/system-lcms.patch b/system-lcms.patch index c098f3a..6f39b57 100644 --- a/system-lcms.patch +++ b/system-lcms.patch @@ -1,6 +1,6 @@ diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4 ---- jdk8/common/autoconf/libraries.m4 2013-11-14 22:04:38.039440136 -0500 -+++ jdk8/common/autoconf/libraries.m4 2013-11-14 22:05:11.474356424 -0500 +--- openjdk/common/autoconf/libraries.m4 2013-11-14 22:04:38.039440136 -0500 ++++ openjdk/common/autoconf/libraries.m4 2013-11-14 22:05:11.474356424 -0500 @@ -676,6 +676,46 @@ ############################################################################### @@ -49,54 +49,70 @@ diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4 # diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk ---- jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:04:38.040440133 -0500 -+++ jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:05:11.475356411 -0500 -@@ -661,8 +661,8 @@ +--- openjdk/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:04:38.040440133 -0500 ++++ openjdk/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:05:11.475356411 -0500 +@@ -666,18 +666,35 @@ + ########################################################################################## ++LIBLCMS_DIR := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms ++ ++ifeq ($(USE_EXTERNAL_LCMS), true) ++ # If we're using an external library, we'll just need the wrapper part. ++ # By including it explicitely, all other files will be excluded. ++ BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c ++ BUILD_LIBLCMS_HEADERS := ++else ++ BUILD_LIBLCMS_INCLUDE_FILES := ++ # If we're using the bundled library, we'll need to include it in the ++ # include path explicitly. Otherwise the system headers will be used. ++ BUILD_LIBLCMS_HEADERS := -I$(LIBLCMS_DIR) ++endif ++ # TODO: Update awt lib path when awt is converted --$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ -- LIBRARY := lcms, \ -+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVALCMS, \ -+ LIBRARY := javalcms, \ + $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ + LIBRARY := lcms, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ - SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \ +- SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \ ++ SRC := $(LIBLCMS_DIR), \ ++ INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \ LANG := C, \ -@@ -680,19 +680,19 @@ + OPTIMIZATION := HIGHEST, \ + CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \ + -DCMS_DONT_USE_FAST_FLOOR \ + $(SHARED_LIBRARY_FLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ +- -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \ ++ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ ++ $(BUILD_LIBLCMS_HEADERS) \ ++ $(LCMS_CFLAGS), \ + CFLAGS_solaris := -xc99=no_lib, \ + CFLAGS_windows := -DCMS_IS_WINDOWS_, \ + MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \ +@@ -685,10 +702,10 @@ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \ LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \ - LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \ - LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \ +- LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \ +- LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \ - LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \ -+ LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm -llcms2, \ - LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\ +- LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\ ++ LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \ ++ LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm $(LCMS_LIBS), \ ++ LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm $(LCMS_LIBS), \ ++ LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm $(LCMS_LIBS),\ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -- -D "JDK_FNAME=lcms.dll" \ -- -D "JDK_INTERNAL_NAME=lcms" \ -+ -D "JDK_FNAME=javalcms.dll" \ -+ -D "JDK_INTERNAL_NAME=javalcms" \ - -D "JDK_FTYPE=0x2L", \ -- OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \ -+ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavalcms, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + -D "JDK_FNAME=lcms.dll" \ +diff -r 3d1c3b0b73a3 src/share/native/sun/java2d/cmm/lcms/LCMS.c +--- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Tue Sep 08 22:31:26 2015 +0300 ++++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Thu Oct 15 05:29:28 2015 +0100 +@@ -30,7 +30,7 @@ + #include "jni_util.h" + #include "Trace.h" + #include "Disposer.h" +-#include "lcms2.h" ++#include + #include "jlong.h" --BUILD_LIBRARIES += $(BUILD_LIBLCMS) -+BUILD_LIBRARIES += $(BUILD_LIBJAVALCMS) --$(BUILD_LIBLCMS): $(BUILD_LIBAWT) -+$(BUILD_LIBJAVALCMS): $(BUILD_LIBAWT) - - ########################################################################################## - -diff -ruN jdk8/jdk/src/share/classes/sun/cmm/lcms/LCMS.java jdk8/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java ---- jdk8/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java 2013-10-31 19:44:18.000000000 -0400 -+++ jdk8/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java 2013-11-14 22:05:11.476356403 -0500 -@@ -207,7 +207,7 @@ - * disposer frameworks - */ - System.loadLibrary("awt"); -- System.loadLibrary("lcms"); -+ System.loadLibrary("javalcms"); - return null; - } - }); diff --git a/system-libjpeg.patch b/system-libjpeg.patch index fa01115..c910b91 100644 --- a/system-libjpeg.patch +++ b/system-libjpeg.patch @@ -51,7 +51,7 @@ diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4 diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk --- jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-10-31 19:44:18.000000000 -0400 +++ jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 21:56:01.020796703 -0500 -@@ -696,17 +696,17 @@ +@@ -704,17 +704,17 @@ ########################################################################################## ifdef OPENJDK @@ -75,7 +75,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. endif endif -@@ -721,37 +721,37 @@ +@@ -729,37 +729,37 @@ # $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \ # \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) ) # ifeq ($(CC_43_OR_NEWER), 1) @@ -99,12 +99,12 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. + $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \ -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \ - MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \ -- LDFLAGS := $(LDFLAGS_JDKLIB) \ + MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \ -+ LDFLAGS := $(LDFLAGS_JDKLIB) -ljpeg \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \ - LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ +- LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ ++ LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) -ljpeg, \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ - -D "JDK_FNAME=jpeg.dll" \ @@ -126,7 +126,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. ########################################################################################## -@@ -1183,7 +1183,6 @@ +@@ -1188,7 +1188,6 @@ ifndef BUILD_HEADLESS_ONLY LIBSPLASHSCREEN_DIRS := \ @@ -134,7 +134,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \ $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen -@@ -1194,6 +1193,13 @@ +@@ -1199,6 +1199,13 @@ GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib endif @@ -148,7 +148,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. ifneq ($(OPENJDK_TARGET_OS), macosx) LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen else -@@ -1256,11 +1262,13 @@ +@@ -1259,11 +1265,13 @@ EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \ LANG := C, \ OPTIMIZATION := LOW, \