Architecture specific change in rpms/nodejs-immutable.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-immutable.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-immutable.git/commit/?id=3....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 3f197951447363aaa0d1969124ae5b9f9b8b02fe
Author: Jared Smith <jsmith(a)fedoraproject.org>
Date: Tue Apr 24 13:14:03 2018 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9126e7d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/immutable-3.8.2.tgz
diff --git a/README.md b/README.md
deleted file mode 100644
index 651880a..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# nodejs-immutable
-
-'Immutable Data Collections'
\ No newline at end of file
diff --git a/nodejs-immutable.spec b/nodejs-immutable.spec
new file mode 100644
index 0000000..cf1b8d7
--- /dev/null
+++ b/nodejs-immutable.spec
@@ -0,0 +1,61 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename immutable
+
+# Tests disabled, as the npm(jest) test suite isn't in Fedora yet
+%global enable_tests 0
+
+Name: nodejs-immutable
+Version: 3.8.2
+Release: 1%{?dist}
+Summary: Immutable Data Collections
+
+License: MIT
+URL: https://github.com/facebook/immutable-js.git
+Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+
+
+BuildArch: noarch
+ExclusiveArch: %{nodejs_arches} noarch
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+BuildRequires: npm(jest)
+%endif
+
+%description
+Immutable Data Collections
+
+
+%prep
+%autosetup -n package
+
+
+%build
+# nothing to do
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json dist/ contrib/ \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+NODE_ENV=test %{_bindir}/jest
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc *.md
+%license LICENSE
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Mon Apr 23 2018 Jared K. Smith <jsmith(a)fedoraproject.org> - 3.8.2-1
+- Initial packaging
diff --git a/sources b/sources
new file mode 100644
index 0000000..38d2ed2
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (immutable-3.8.2.tgz) = d79819a10dfc7988c48f1928adf6dc8012812fa47b4f8e7d3ae2be0a9716b7b3b7285e2e3c2c76b43d2e1444e5503232a3ed7bf3d72b6cc853bd0052479c8132
6 years
Architecture specific change in rpms/nodejs-jest-mock.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-jest-mock.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-jest-mock.git/commit/?id=b....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit b23ee78e3aa00cdc1510505f0e02e7f213ee800b
Author: Jared Smith <jsmith(a)fedoraproject.org>
Date: Tue Apr 24 12:54:27 2018 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..115af08
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/jest-mock-22.4.3.tgz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..10e779c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+MIT License
+
+For Jest software
+
+Copyright (c) 2014-present, Facebook, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
deleted file mode 100644
index 8611d91..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# nodejs-jest-mock
-
-'Mock testing API'
\ No newline at end of file
diff --git a/nodejs-jest-mock.spec b/nodejs-jest-mock.spec
new file mode 100644
index 0000000..f64a533
--- /dev/null
+++ b/nodejs-jest-mock.spec
@@ -0,0 +1,62 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename jest-mock
+%global enable_tests 1
+
+Name: nodejs-jest-mock
+Version: 22.4.3
+Release: 1%{?dist}
+Summary: Mock testing API
+
+License: MIT
+URL: https://github.com/facebook/jest/tree/master/packages/jest-mock
+Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# license
+Source1: https://raw.githubusercontent.com/facebook/jest/master/LICENSE
+
+
+BuildArch: noarch
+ExclusiveArch: %{nodejs_arches} noarch
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+#BuildRequires:
+%endif
+
+%description
+Mock testing API for Jest
+
+
+%prep
+%autosetup -n package
+# license
+cp -p %{SOURCE1} .
+
+%build
+# nothing to do
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json build/ \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+%{_bindir}/echo -e "\e[103m -=#=- There are no tests -=#=- \e[0m"
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc *.md
+%license LICENSE
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Wed Apr 18 2018 Jared K. Smith <jsmith(a)fedoraproject.org> - 22.4.3-1
+- Initial packaging
diff --git a/sources b/sources
new file mode 100644
index 0000000..b836cd5
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (jest-mock-22.4.3.tgz) = fb847a987e4cd46e0d2b5e822a0f4dd43b426859aec61708a85e2540afd0d42228b6a32cfd705e99fa433de559045a30ea2c9436ee84053f6e81d34e4d3e68e5
6 years
Architecture specific change in rpms/nodejs-add-stream.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-add-stream.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-add-stream.git/commit/?id=....
Change:
+ExclusiveArch: %{ix86} x86_64 %{arm} noarch
Thanks.
Full change:
============
commit 8c25873b32e3857d5570d2ef328689bf8fd95bd5
Author: Jared Smith <jsmith(a)fedoraproject.org>
Date: Tue Apr 24 12:35:52 2018 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fce75ac
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/add-stream-1.0.0.tgz
diff --git a/README.md b/README.md
index a538d74..d172004 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,46 @@
-# nodejs-add-stream
+# add-stream [![Build Status](https://travis-ci.org/wilsonjackson/add-stream.svg?branch=master)...
-'Append the contents of one stream onto another'
\ No newline at end of file
+> Append the contents of one stream onto another.
+
+## Usage
+
+```js
+var fs = require('fs');
+var es = require('event-stream');
+var addStream = require('add-stream');
+
+// Append strings/buffers
+fs.createReadStream('1.txt') // 1.txt contains: number1
+ .pipe(addStream(fs.createReadStream('2.txt'))) // 2.txt contains: number2
+ .pipe(fs.createWriteStream('appended.txt')); // appended.txt contains: number1number2
+
+// Append object streams
+es.readArray([1, 2, 3])
+ .pipe(addStream.obj(es.readArray([4, 5, 6])))
+ .pipe(es.writeArray(function (err, array) {
+ console.log(array); // [ 1, 2, 3, 4, 5, 6 ]
+ }));
+```
+
+## API
+
+### var transformStream = addStream(stream, opts = {})
+
+Create a transform stream that appends the contents of `stream` onto whatever
+is piped into it. Options are passed to the transform stream's constructor.
+
+### var transformStream = addStream.obj(stream, opts = {})
+
+A convenient shortcut for `addStream(stream, {objectMode: true})`.
+
+## License
+
+MIT
+
+Copyright (c) 2017 Majid Burney
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nodejs-add-stream.spec b/nodejs-add-stream.spec
new file mode 100644
index 0000000..fa5e56c
--- /dev/null
+++ b/nodejs-add-stream.spec
@@ -0,0 +1,67 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename add-stream
+%global enable_tests 1
+
+Name: nodejs-add-stream
+Version: 1.0.0
+Release: 1%{?dist}
+Summary: Append the contents of one stream onto another
+
+License: MIT
+URL: https://github.com/wilsonjackson/add-stream
+Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# License text is in README.md on master branch
+Source1: https://raw.githubusercontent.com/wilsonjackson/add-stream/master/README.md
+
+
+BuildArch: noarch
+ExclusiveArch: %{ix86} x86_64 %{arm} noarch
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+BuildRequires: mocha
+BuildRequires: npm(chai)
+BuildRequires: npm(event-stream)
+%endif
+
+%description
+Append the contents of one stream onto another.
+
+
+%prep
+%autosetup -n package
+cp -p %{SOURCE1} temp.md
+sed -n '/## License/,$p' temp.md > LICENSE.md
+rm temp.md
+
+
+%build
+# nothing to do
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json index.js \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+NODE_ENV=test %{_bindir}/mocha -R spec -u exports
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%{!?_licensedir:%global license %doc}
+%doc README.md
+%license LICENSE.md
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Wed Feb 21 2018 Jared Smith <jsmith(a)fedoraproject.org> - 1.0.0-1
+- Initial packaging
diff --git a/sources b/sources
new file mode 100644
index 0000000..54bf084
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (add-stream-1.0.0.tgz) = a902ccafef28d160b81591904dc262281542e7d27295c3d2ad3b64eaeb2f9880c550e08a7a06a9cb554743045b14c385c9bfe29f3515a87b3e78c60a0ccd5879
6 years
Architecture specific change in rpms/nodejs-conventional-changelog-jscs.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-conventional-changelog-jscs.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-conventional-changelog-jsc....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit d8e8bb64c0bf784da8ccc9abc8b016991ce42123
Author: Jared Smith <jsmith(a)fedoraproject.org>
Date: Tue Apr 24 11:32:18 2018 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7edf7b8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/conventional-changelog-jscs-0.1.0.tgz
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..7d82383
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,15 @@
+### ISC License
+
+Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/README.md b/README.md
deleted file mode 100644
index 82737bf..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# nodejs-conventional-changelog-jscs
-
-'conventional-changelog jscs preset'
\ No newline at end of file
diff --git a/nodejs-conventional-changelog-jscs.spec b/nodejs-conventional-changelog-jscs.spec
new file mode 100644
index 0000000..317fe7a
--- /dev/null
+++ b/nodejs-conventional-changelog-jscs.spec
@@ -0,0 +1,67 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename conventional-changelog-jscs
+
+# tests fail in mock/koji
+%global enable_tests 0
+
+Name: nodejs-conventional-changelog-jscs
+Version: 0.1.0
+Release: 1%{?dist}
+Summary: conventional-changelog jscs preset
+
+License: ISC
+URL: https://github.com/stevemao/conventional-changelog-jscs.git
+Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# license file
+Source1: https://raw.githubusercontent.com/conventional-changelog/conventional-cha...
+
+
+BuildArch: noarch
+ExclusiveArch: %{nodejs_arches} noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(q)
+
+%if 0%{?enable_tests}
+BuildRequires: mocha
+BuildRequires: npm(chai)
+BuildRequires: npm(conventional-changelog-core)
+BuildRequires: npm(shelljs)
+%endif
+
+%description
+conventional-changelog jscs preset
+
+
+%prep
+%autosetup -n package
+cp -p %{SOURCE1} .
+
+%build
+# nothing to do
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json index.js templates/ \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+NODE_ENV=test %{_bindir}/mocha -R spec
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc *.md
+%license LICENSE.md
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Wed Apr 4 2018 Jared K. Smith <jsmith(a)fedoraproject.org> - 0.1.0-1
+- Initial packaging
diff --git a/sources b/sources
new file mode 100644
index 0000000..d7926f1
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (conventional-changelog-jscs-0.1.0.tgz) = 57cb1ecb8b44d272549561a2d8f64a0cc7dac182dfffe175eb9c618438dc2284c4243c6cb155793cc5734d0ce34ba53f7445fce5f5a4babf9bb3a8a63aa9089e
6 years
Architecture specific change in rpms/java-1.8.0-openjdk.git
by githook-noreply@fedoraproject.org
The package rpms/java-1.8.0-openjdk.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/java-1.8.0-openjdk.git/commit/?id....
Change:
-%ifarch %{aarch64}
Thanks.
Full change:
============
commit 46da88238559c35dabb1105b97c89f86e26c8f79
Author: Severin Gehwolf <sgehwolf(a)redhat.com>
Date: Fri Apr 20 18:10:18 2018 +0200
Enable hardened build for aarch64.
diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec
index 9506495..710c005 100644
--- a/java-1.8.0-openjdk.spec
+++ b/java-1.8.0-openjdk.spec
@@ -72,12 +72,6 @@
%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)
@@ -87,7 +81,6 @@
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||')
%global ourldflags %{__global_ldflags}
%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
@@ -941,7 +934,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%{?1}
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}
-Release: 2.%{buildver}%{?dist}
+Release: 3.%{buildver}%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@@ -2148,6 +2141,9 @@ require "copy_jdk_configs.lua"
%endif
%changelog
+* Tue Apr 24 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:1.8.0.171-3.b10
+- Enable hardened build for Aarch64.
+
* Tue Apr 24 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:1.8.0.171-2.b10
- Update rhbz1548475-LDFLAGSusage.patch to also set linker
flags for libsaproc.so and libjsig.so.
6 years
Architecture specific change in rpms/java-openjdk.git
by githook-noreply@fedoraproject.org
The package rpms/java-openjdk.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/java-openjdk.git/commit/?id=eb6f5....
Change:
-%ifarch s390
Thanks.
Full change:
============
commit eb6f5c2dfb1f2297be4b550b70c8a4a832642f96
Author: Severin Gehwolf <sgehwolf(a)redhat.com>
Date: Fri Apr 20 14:02:54 2018 +0200
Clean up patches.
- Remove unneeded ones.
- Rename patches for clarity. Update JDK-8201788
from upstream.
- Add patches needed to build on more arches (Zero).
diff --git a/JDK-8200556-aarch64-slowdebug-crash.patch b/JDK-8200556-aarch64-slowdebug-crash.patch
new file mode 100644
index 0000000..bb5453e
--- /dev/null
+++ b/JDK-8200556-aarch64-slowdebug-crash.patch
@@ -0,0 +1,14 @@
+diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
+--- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
++++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
+@@ -343,7 +343,7 @@
+ CodeBuffer cb(code_pos, instruction_size);
+ MacroAssembler a(&cb);
+
+- a.mov(rscratch1, entry);
++ a.movptr(rscratch1, (uintptr_t)entry);
+ a.br(rscratch1);
+
+ ICache::invalidate_range(code_pos, instruction_size);
+
+
diff --git a/JDK-8201495-s390-java-opts.patch b/JDK-8201495-s390-java-opts.patch
new file mode 100644
index 0000000..a16db0c
--- /dev/null
+++ b/JDK-8201495-s390-java-opts.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1523874036 -7200
+# Mon Apr 16 12:20:36 2018 +0200
+# Node ID fc3a72e286e0d5bf9b994d1b778b39f3b080c686
+# Parent 69bae761600bdbc97953500ac51a396d31f54ee9
+8201495: [Zero] Reduce limits of max heap size for boot JDK on s390
+Reviewed-by: ihse, aph, simonis
+
+diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4
+--- a/make/autoconf/boot-jdk.m4
++++ b/make/autoconf/boot-jdk.m4
+@@ -405,7 +405,7 @@
+ BOOTCYCLE_JVM_ARGS_BIG=-Xms64M
+
+ # Maximum amount of heap memory and stack size.
+- JVM_HEAP_LIMIT_32="1024"
++ JVM_HEAP_LIMIT_32="768"
+ # Running a 64 bit JVM allows for and requires a bigger heap
+ JVM_HEAP_LIMIT_64="1600"
+ STACK_SIZE_32=768
diff --git a/JDK-8201509-s390-atomic_store.patch b/JDK-8201509-s390-atomic_store.patch
new file mode 100644
index 0000000..ba7f748
--- /dev/null
+++ b/JDK-8201509-s390-atomic_store.patch
@@ -0,0 +1,18 @@
+diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
++++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+@@ -50,10 +50,10 @@
+ : "Q"(*(volatile long*)src));
+ #elif defined(S390) && !defined(_LP64)
+ double tmp;
+- asm volatile ("ld %0, 0(%1)\n"
+- "std %0, 0(%2)\n"
+- : "=r"(tmp)
+- : "a"(src), "a"(dst));
++ asm volatile ("ld %0, %2\n"
++ "std %0, %1\n"
++ : "=&f"(tmp), "=Q"(*(volatile double*)dst)
++ : "Q"(*(volatile double*)src));
+ #else
+ *(jlong *) dst = *(const jlong *) src;
+ #endif
diff --git a/JDK-8201788-bootcycle-images-jobs.patch b/JDK-8201788-bootcycle-images-jobs.patch
new file mode 100644
index 0000000..05d1a39
--- /dev/null
+++ b/JDK-8201788-bootcycle-images-jobs.patch
@@ -0,0 +1,27 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1524152606 -7200
+# Thu Apr 19 17:43:26 2018 +0200
+# Node ID f7a3ca673e9cc831848fc890a2df3ae9acb447e4
+# Parent dd26184768b0a1c4103a2e9eaa8b4d852a9eca1b
+8201788: Number of make jobs wrong for bootcycle-images target
+Reviewed-by: erikj, ihse
+
+diff --git a/make/Init.gmk b/make/Init.gmk
+--- a/make/Init.gmk
++++ b/make/Init.gmk
+@@ -310,9 +310,13 @@
+ ifneq ($(PARALLEL_TARGETS), )
+ $(call StartGlobalTimer)
+ $(call PrepareSmartJavac)
++ # JOBS will only be empty for a bootcycle-images recursive call
++ # or if specified via a make argument directly. In those cases
++ # treat it as NOT using jobs at all.
+ ( cd $(TOPDIR) && \
+ $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
+- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
++ $(if $(JOBS), -j $(JOBS)) \
++ -f make/Main.gmk $(USER_MAKE_VARS) \
+ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
+ ( exitcode=$$? && \
+ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
diff --git a/PStack-808293.patch b/PStack-808293.patch
deleted file mode 100644
index fc5fe4e..0000000
--- a/PStack-808293.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:33.322164601 +0200
-+++ openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:57.958514071 +0200
-@@ -84,7 +85,8 @@
- if (jthread != null) {
- jthread.printThreadInfoOn(out);
- }
-- while (f != null) {
-+ int maxStack = 256;
-+ while (f != null && maxStack-- > 0) {
- ClosestSymbol sym = f.closestSymbolToPC();
- Address pc = f.pc();
- out.print(pc + "\t");
-@@ -158,10 +160,19 @@
- }
- }
- }
-+ Address oldPC = f.pc();
-+ Address oldFP = f.localVariableBase();
- f = f.sender(th);
-+ if (f != null
-+ && oldPC.equals(f.pc())
-+ && oldFP.equals(f.localVariableBase())) {
-+ // We didn't make any progress
-+ f = null;
-+ }
- }
- } catch (Exception exp) {
-- exp.printStackTrace();
-+ // exp.printStackTrace();
-+ out.println("bad stack: " + exp);
- // continue, may be we can do a better job for other threads
- }
- if (concurrentLocks) {
diff --git a/RHBZ-1249083-system-crypto-policy-PR3183.patch b/RHBZ-1249083-system-crypto-policy-PR3183.patch
new file mode 100644
index 0000000..4efbe9a
--- /dev/null
+++ b/RHBZ-1249083-system-crypto-policy-PR3183.patch
@@ -0,0 +1,88 @@
+
+# HG changeset patch
+# User andrew
+# Date 1478057514 0
+# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
+# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
+PR3183: Support Fedora/RHEL system crypto policy
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
+--- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
+@@ -43,6 +43,9 @@
+ * implementation-specific location, which is typically the properties file
+ * {@code conf/security/java.security} in the Java installation directory.
+ *
++ * <p>Additional default values of security properties are read from a
++ * system-specific location, if available.</p>
++ *
+ * @author Benjamin Renaud
+ * @since 1.1
+ */
+@@ -52,6 +55,10 @@
+ private static final Debug sdebug =
+ Debug.getInstance("properties");
+
++ /* System property file*/
++ private static final String SYSTEM_PROPERTIES =
++ "/etc/crypto-policies/back-ends/java.config";
++
+ /* The java.security properties */
+ private static Properties props;
+
+@@ -93,6 +100,7 @@
+ if (sdebug != null) {
+ sdebug.println("reading security properties file: " +
+ propFile);
++ sdebug.println(props.toString());
+ }
+ } catch (IOException e) {
+ if (sdebug != null) {
+@@ -114,6 +122,31 @@
+ }
+
+ if ("true".equalsIgnoreCase(props.getProperty
++ ("security.useSystemPropertiesFile"))) {
++
++ // now load the system file, if it exists, so its values
++ // will win if they conflict with the earlier values
++ try (BufferedInputStream bis =
++ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
++ props.load(bis);
++ loadedProps = true;
++
++ if (sdebug != null) {
++ sdebug.println("reading system security properties file " +
++ SYSTEM_PROPERTIES);
++ sdebug.println(props.toString());
++ }
++ } catch (IOException e) {
++ if (sdebug != null) {
++ sdebug.println
++ ("unable to load security properties from " +
++ SYSTEM_PROPERTIES);
++ e.printStackTrace();
++ }
++ }
++ }
++
++ if ("true".equalsIgnoreCase(props.getProperty
+ ("security.overridePropertiesFile"))) {
+
+ String extraPropFile = System.getProperty
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
+--- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
+@@ -276,6 +276,13 @@
+ security.overridePropertiesFile=true
+
+ #
++# Determines whether this properties file will be appended to
++# using the system properties file stored at
++# /etc/crypto-policies/back-ends/java.config
++#
++security.useSystemPropertiesFile=true
++
++#
+ # Determines the default key and trust manager factory algorithms for
+ # the javax.net.ssl package.
+ #
diff --git a/RHBZ-1565658-system-nss-SunEC.patch b/RHBZ-1565658-system-nss-SunEC.patch
new file mode 100644
index 0000000..7b1d4aa
--- /dev/null
+++ b/RHBZ-1565658-system-nss-SunEC.patch
@@ -0,0 +1,654 @@
+diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
+--- openjdk/make/autoconf/jdk-options.m4
++++ openjdk/make/autoconf/jdk-options.m4
+@@ -264,9 +264,10 @@
+ #
+ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
+ [
++ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
+ AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
+
+- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
++ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
+ ENABLE_INTREE_EC=true
+ AC_MSG_RESULT([yes])
+ else
+diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
+--- openjdk/make/autoconf/libraries.m4
++++ openjdk/make/autoconf/libraries.m4
+@@ -175,6 +175,48 @@
+ AC_SUBST(LIBDL)
+ LIBS="$save_LIBS"
+
++ ###############################################################################
++ #
++ # Check for the NSS libraries
++ #
++
++ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
++
++ # default is bundled
++ DEFAULT_SYSTEM_NSS=no
++
++ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
++ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
++ [
++ case "${enableval}" in
++ yes)
++ system_nss=yes
++ ;;
++ *)
++ system_nss=no
++ ;;
++ esac
++ ],
++ [
++ system_nss=${DEFAULT_SYSTEM_NSS}
++ ])
++ AC_MSG_RESULT([$system_nss])
++
++ if test "x${system_nss}" = "xyes"; then
++ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
++ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
++ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
++ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
++ USE_EXTERNAL_NSS=true
++ else
++ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
++ fi
++ else
++ USE_EXTERNAL_NSS=false
++ fi
++ AC_SUBST(USE_EXTERNAL_NSS)
++
++
+ # Deprecated libraries, keep the flags for backwards compatibility
+ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ BASIC_DEPRECATED_ARG_WITH([dxsdk])
+diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
+--- openjdk/make/autoconf/spec.gmk.in
++++ openjdk/make/autoconf/spec.gmk.in
+@@ -764,6 +764,10 @@
+ # Libraries
+ #
+
++USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
++NSS_LIBS:=@NSS_LIBS@
++NSS_CFLAGS:=@NSS_CFLAGS@
++
+ USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
+ LCMS_CFLAGS:=@LCMS_CFLAGS@
+ LCMS_LIBS:=@LCMS_LIBS@
+diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+--- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
++++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+@@ -29,9 +29,15 @@
+
+ ifeq ($(ENABLE_INTREE_EC), true)
+
+- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
+ BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
+
++ ifeq ($(USE_EXTERNAL_NSS), true)
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
++ else
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
++ endif
++
+ #
+ # On sol-sparc...all libraries are compiled with -xregs=no%appl
+ # (set in CFLAGS_REQUIRED_sparc)
+@@ -60,7 +66,7 @@
+ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
+ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LIBS := $(LIBCXX), \
+- LIBS_linux := -lc, \
++ LIBS_linux := -lc $(NSS_LIBS), \
+ LIBS_solaris := -lc, \
+ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
+ RC_FLAGS := $(RC_FLAGS) \
+diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
+--- openjdk/make/mapfiles/libsunec/mapfile-vers
++++ openjdk/make/mapfiles/libsunec/mapfile-vers
+@@ -31,6 +31,7 @@
+ Java_sun_security_ec_ECDSASignature_signDigest;
+ Java_sun_security_ec_ECDSASignature_verifySignedDigest;
+ Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
++ Java_sun_security_ec_SunEC_initialize;
+ local:
+ *;
+ };
+diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
+--- openjdk/src/java.base/unix/native/include/jni_md.h
++++ openjdk/src/java.base/unix/native/include/jni_md.h
+@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+--- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
++++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+@@ -61,6 +61,7 @@
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ System.loadLibrary("sunec"); // check for native library
++ initialize();
+ return null;
+ }
+ });
+@@ -272,4 +273,9 @@
+ putService(new ProviderService(this, "KeyAgreement",
+ "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
+ }
++
++ /**
++ * Initialize the native code.
++ */
++ private static native void initialize();
+ }
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+--- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+@@ -25,7 +25,11 @@
+
+ #include <jni.h>
+ #include "jni_util.h"
++#ifdef SYSTEM_NSS
++#include "ecc_impl.h"
++#else
+ #include "impl/ecc_impl.h"
++#endif
+
+ #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
+ #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
+@@ -33,6 +37,13 @@
+ #define INVALID_PARAMETER_EXCEPTION \
+ "java/security/InvalidParameterException"
+ #define KEY_EXCEPTION "java/security/KeyException"
++#define INTERNAL_ERROR "java/lang/InternalError"
++
++#ifdef SYSTEM_NSS
++#define SYSTEM_UNUSED(x) UNUSED(x)
++#else
++#define SYSTEM_UNUSED(x) x
++#endif
+
+ extern "C" {
+
+@@ -55,8 +66,13 @@
+ /*
+ * Deep free of the ECParams struct
+ */
+-void FreeECParams(ECParams *ecparams, jboolean freeStruct)
++void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
+ {
++#ifdef SYSTEM_NSS
++ // Needs to be freed using the matching method to the one
++ // that allocated it. PR_TRUE means the memory is zeroed.
++ PORT_FreeArena(ecparams->arena, PR_TRUE);
++#else
+ // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
+ // Use B_TRUE to free both
+
+@@ -70,6 +86,7 @@
+ SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
+ if (freeStruct)
+ free(ecparams);
++#endif
+ }
+
+ jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
+@@ -95,7 +112,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;
+@@ -127,8 +144,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;
+ }
+@@ -175,10 +201,15 @@
+ }
+ if (privKey) {
+ FreeECParams(&privKey->ecParams, false);
++#ifndef SYSTEM_NSS
++ // The entire ECPrivateKey is allocated in the arena
++ // when using system NSS, so only the in-tree version
++ // needs to clear these manually.
+ SECITEM_FreeItem(&privKey->version, B_FALSE);
+ SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
+ SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
+ free(privKey);
++#endif
+ }
+
+ if (pSeedBuffer) {
+@@ -196,7 +227,7 @@
+ */
+ JNIEXPORT jbyteArray
+ JNICALL Java_sun_security_ec_ECDSASignature_signDigest
+- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
+ {
+ jbyte* pDigestBuffer = NULL;
+ jint jDigestLength = env->GetArrayLength(digest);
+@@ -255,8 +286,18 @@
+ env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
+
+ // Sign the digest (using the supplied seed)
++#ifdef SYSTEM_NSS
++ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
++ != SECSuccess) {
++ ThrowException(env, KEY_EXCEPTION);
++ goto cleanup;
++ }
++ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
++ != SECSuccess) {
++#else
+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
+ (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
++#endif
+ ThrowException(env, KEY_EXCEPTION);
+ goto cleanup;
+ }
+@@ -305,7 +346,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;
+
+@@ -362,9 +403,10 @@
+
+ cleanup:
+ {
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (pubKey.publicValue.data)
+ env->ReleaseByteArrayElements(publicKey,
+@@ -390,7 +432,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;
+@@ -466,9 +508,10 @@
+ env->ReleaseByteArrayElements(publicKey,
+ (jbyte *) publicValue_item.data, JNI_ABORT);
+
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (ecparams)
+ FreeECParams(ecparams, true);
+@@ -477,4 +520,28 @@
+ return jSecret;
+ }
+
++JNIEXPORT void
++JNICALL Java_sun_security_ec_SunEC_initialize
++ (JNIEnv *env, jclass UNUSED(clazz))
++{
++#ifdef SYSTEM_NSS
++ if (SECOID_Init() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++ if (RNG_RNGInit() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++#endif
++}
++
++JNIEXPORT void
++JNICALL JNI_OnUnload
++ (JavaVM *vm, void *reserved)
++{
++#ifdef SYSTEM_NSS
++ RNG_RNGShutdown();
++ SECOID_Shutdown();
++#endif
++}
++
+ } /* extern "C" */
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+new file mode 100644
+--- /dev/null
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+@@ -0,0 +1,298 @@
++/*
++ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
++ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
++ *
++ * Last Modified Date from the Original Code: May 2017
++ *********************************************************************** */
++
++#ifndef _ECC_IMPL_H
++#define _ECC_IMPL_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/types.h>
++
++#ifdef SYSTEM_NSS
++#include <secitem.h>
++#include <secerr.h>
++#include <keythi.h>
++#ifdef LEGACY_NSS
++#include <softoken.h>
++#else
++#include <blapi.h>
++#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 <stdint.h>
++#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 <stdlib.h>
++#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.
++*/
++#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)
++
++#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 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, int timing);
++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 --git a/aarch64BuildFailure.patch b/aarch64BuildFailure.patch
deleted file mode 100644
index bb5453e..0000000
--- a/aarch64BuildFailure.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
---- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
-+++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
-@@ -343,7 +343,7 @@
- CodeBuffer cb(code_pos, instruction_size);
- MacroAssembler a(&cb);
-
-- a.mov(rscratch1, entry);
-+ a.movptr(rscratch1, (uintptr_t)entry);
- a.br(rscratch1);
-
- ICache::invalidate_range(code_pos, instruction_size);
-
-
diff --git a/bootcycle_jobs.patch b/bootcycle_jobs.patch
deleted file mode 100644
index 05cae9d..0000000
--- a/bootcycle_jobs.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -r 21b063d75b3e make/Init.gmk
---- openjdk/make/Init.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ oepnjdk/make/Init.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -303,7 +303,8 @@
- $(call PrepareSmartJavac)
- ( cd $(TOPDIR) && \
- $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
-- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
-+ $(if $(DISABLE_JOBS),, -j $(JOBS)) \
-+ -f make/Main.gmk $(USER_MAKE_VARS) \
- $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
- ( exitcode=$$? && \
- $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
-diff -r 21b063d75b3e make/Main.gmk
---- jdk9/make/Main.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ jdk9/make/Main.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -320,7 +320,7 @@
- ifneq ($(COMPILE_TYPE), cross)
- $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
- +$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
-- JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
-+ DISABLE_JOBS=true SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
- else
- $(call LogWarn, Boot cycle build disabled when cross compiling)
- endif
diff --git a/hotspot-min-max-macros.patch b/hotspot-min-max-macros.patch
deleted file mode 100644
index 3b2909c..0000000
--- a/hotspot-min-max-macros.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r b515beb3b4ad openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp
---- openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Jul 07 18:40:53 2016 +0100
-+++ openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Jul 12 19:13:51 2016 +0100
-@@ -1163,8 +1163,10 @@
- #undef min
- #endif
-
-+#ifndef _GLIBCXX_STDLIB_H
- #define max(a,b) Do_not_use_max_use_MAX2_instead
- #define min(a,b) Do_not_use_min_use_MIN2_instead
-+#endif
-
- // It is necessary to use templates here. Having normal overloaded
- // functions does not work because it is necessary to provide both 32-
diff --git a/java-openjdk-s390-size_t.patch b/java-openjdk-s390-size_t.patch
new file mode 100644
index 0000000..920624c
--- /dev/null
+++ b/java-openjdk-s390-size_t.patch
@@ -0,0 +1,134 @@
+diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
+--- a/src/hotspot/share/code/codeCache.cpp
++++ b/src/hotspot/share/code/codeCache.cpp
+@@ -405,7 +405,7 @@
+ add_heap(heap);
+
+ // Reserve Space
+- size_t size_initial = MIN2(InitialCodeCacheSize, rs.size());
++ size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
+ size_initial = align_up(size_initial, os::vm_page_size());
+ if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
+ vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
+diff --git a/src/hotspot/share/gc/cms/parNewGeneration.cpp b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp
++++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+@@ -200,7 +200,7 @@
+ 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 --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+@@ -2296,7 +2296,7 @@
+ // of things to do) or totally (at the very end).
+ size_t target_size;
+ if (partially) {
+- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
++ target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t)GCDrainStackTargetSize);
+ } else {
+ target_size = 0;
+ }
+diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+@@ -31,7 +31,7 @@
+ }
+
+ size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
+- size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
++ size_t words_to_scan = MIN2(remaining, (size_t)ObjArrayMarkingStride);
+
+ if (remaining > ObjArrayMarkingStride) {
+ push_array_slice(start_from + ObjArrayMarkingStride);
+diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
++++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+@@ -100,7 +100,7 @@
+ 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/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
++++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+@@ -115,7 +115,7 @@
+ const size_t beg_index = size_t(index);
+ assert(beg_index < len || len == 0, "index too large");
+
+- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
++ const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
+ const size_t end_index = beg_index + stride;
+ T* const base = (T*)obj->base();
+ T* const beg = base + beg_index;
+diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
++++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+@@ -905,8 +905,8 @@
+ void PSParallelCompact::initialize_dead_wood_limiter()
+ {
+ const size_t max = 100;
+- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
++ _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
++ _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+ _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 --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
+--- a/src/hotspot/share/gc/shared/plab.cpp
++++ b/src/hotspot/share/gc/shared/plab.cpp
+@@ -32,7 +32,7 @@
+
+ size_t PLAB::min_size() {
+ // Make sure that we return something that is larger than AlignmentReserve
+- return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
++ return align_object_size(MAX2(MinTLABSize / HeapWordSize, (size_t)oopDesc::header_size())) + AlignmentReserve;
+ }
+
+ size_t PLAB::max_size() {
+diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp
+--- a/src/hotspot/share/prims/whitebox.cpp
++++ b/src/hotspot/share/prims/whitebox.cpp
+@@ -1096,7 +1096,7 @@
+ WB_END
+
+ WB_ENTRY(jobject, WB_GetSizeTVMFlag(JNIEnv* env, jobject o, jstring name))
+- uintx result;
++ size_t result;
+ if (GetVMFlag <size_t> (thread, env, name, &result, &CommandLineFlags::size_tAt)) {
+ ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
+ return longBox(thread, env, result);
+diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
+--- a/src/hotspot/share/runtime/arguments.cpp
++++ b/src/hotspot/share/runtime/arguments.cpp
+@@ -1586,7 +1586,7 @@
+ // Increase the code cache size - tiered compiles a lot more.
+ if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
+ FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
+- MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
++ MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)(ReservedCodeCacheSize * 5)));
+ }
+ // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
+ if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
+diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
+--- a/src/hotspot/share/runtime/arguments.hpp
++++ b/src/hotspot/share/runtime/arguments.hpp
+@@ -328,7 +328,7 @@
+ // Value of the conservative maximum heap alignment needed
+ static size_t _conservative_max_heap_alignment;
+
+- static uintx _min_heap_size;
++ static size_t _min_heap_size;
+
+ // -Xrun arguments
+ static AgentLibraryList _libraryList;
diff --git a/java-openjdk.spec b/java-openjdk.spec
index d095e6a..53e037b 100644
--- a/java-openjdk.spec
+++ b/java-openjdk.spec
@@ -825,7 +825,7 @@ Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{origin}
Version: %{newjavaver}.%{buildver}
-Release: 1%{?dist}
+Release: 2%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@@ -866,38 +866,48 @@ Source13: TestCryptoLevel.java
# Ensure ECDSA is working
Source14: TestECDSA.java
+############################################
#
# RPM/distribution specific patches
#
+############################################
+
+# NSS via SunPKCS11 Provider (disabled comment
+# due to memory leak).
+Patch1000: enableCommentedOutSystemNss.patch
# Ignore AWTError when assistive technologies are loaded
-Patch1: accessible-toolkit.patch
+Patch1: accessible-toolkit.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
-Patch5: multiple-pkcs11-library-init.patch
-Patch12: system-nss-ec-rh1565658.patch
-Patch13: libjpeg-turbo-1.4-compat.patch
-# follow system wide crypto policy RHBZ#1249083
-Patch14: systemCryptoPolicyPR3183.patch
-
+Patch2: java-atk-wrapper-security.patch
+Patch3: libjpeg-turbo-1.4-compat.patch
+# Follow system wide crypto policy RHBZ#1249083
+Patch4: RHBZ-1249083-system-crypto-policy-PR3183.patch
+# System NSS via SunEC Provider
+Patch5: RHBZ-1565658-system-nss-SunEC.patch
+
+#############################################
#
# OpenJDK specific patches
#
-
-# JVM heap size changes for s390 (thanks to aph)
-Patch101: sorted-diff.patch
-Patch104: bootcycle_jobs.patch
-
-
-Patch400: ppc_stack_overflow_fix.patch
-Patch401: aarch64BuildFailure.patch
-
-
-# Non-OpenJDK fixes
-Patch1000: enableCommentedOutSystemNss.patch
+#############################################
+
+# s390 (Zero) build does not bootcycle without this patch
+# Already in JDK-11. Missing backports.
+Patch100: JDK-8201495-s390-java-opts.patch
+# See JDK-8198844. This won't be needed any more in
+# JDK 11+
+Patch101: sorted-diff.patch
+# Type fixing for s390 (Zero). Not upstream.
+Patch102: java-openjdk-s390-size_t.patch
+# bootcycle-images target may run out of ressources
+# due to bad jobs config. Missing backports.
+Patch103: JDK-8201788-bootcycle-images-jobs.patch
+# s390 (Zero) build fix. Pending upstream.
+Patch104: JDK-8201509-s390-atomic_store.patch
+
+# aarch64 slowdebug build fix. Pending upstream
+Patch400: JDK-8200556-aarch64-slowdebug-crash.patch
BuildRequires: autoconf
BuildRequires: automake
@@ -1154,26 +1164,18 @@ fi
sh %{SOURCE12}
pushd %{top_level_dir_name}
%patch1 -p1
+%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-
-# s390 build fixes
-%ifarch s390
-
-%endif
%patch101 -p1
+%patch102 -p1
+%patch103 -p1
%patch104 -p1
-# Zero PPC fixes
-# TODO: propose them upstream
%patch400 -p1
-%patch401 -p1
popd # openjdk
%patch1000
@@ -1728,6 +1730,20 @@ require "copy_jdk_configs.lua"
%changelog
+* Fri Apr 20 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-2
+- Removed unneeded patches:
+ PStack-808293.patch
+ multiple-pkcs11-library-init.patch
+ ppc_stack_overflow_fix.patch
+- Added patches for s390 Zero builds:
+ JDK-8201495-s390-java-opts.patch
+ JDK-8201509-s390-atomic_store.patch
+- Renamed patches for clarity:
+ aarch64BuildFailure.patch => JDK-8200556-aarch64-slowdebug-crash.patch
+ systemCryptoPolicyPR3183.patch => RHBZ-1249083-system-crypto-policy-PR3183.patch
+ bootcycle_jobs.patch => JDK-8201788-bootcycle-images-jobs.patch
+ system-nss-ec-rh1565658.patch => RHBZ-1565658-system-nss-SunEC.patch
+
* Fri Apr 20 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.1.10-1
- updated to security update 1
- jexec unlinked from path
diff --git a/multiple-pkcs11-library-init.patch b/multiple-pkcs11-library-init.patch
deleted file mode 100644
index ade94ee..0000000
--- a/multiple-pkcs11-library-init.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-# HG changeset patch
-# User andrew
-# Date 1352129932 0
-# Node ID e9c857dcb964dbfa5eef3a3590244cb4d999cf7a
-# Parent 1406789608b76d0906881979335d685855f44190
-Allow multiple PKCS11 library initialisation to be a non-critical error.
-
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/Config.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Mon Nov 05 15:38:52 2012 +0000
-@@ -52,6 +52,7 @@
- static final int ERR_HALT = 1;
- static final int ERR_IGNORE_ALL = 2;
- static final int ERR_IGNORE_LIB = 3;
-+ static final int ERR_IGNORE_MULTI_INIT = 4;
-
- // same as allowSingleThreadedModules but controlled via a system property
- // and applied to all providers. if set to false, no SunPKCS11 instances
-@@ -980,6 +981,8 @@
- handleStartupErrors = ERR_IGNORE_LIB;
- } else if (val.equals("halt")) {
- handleStartupErrors = ERR_HALT;
-+ } else if (val.equals("ignoreMultipleInitialisation")) {
-+ handleStartupErrors = ERR_IGNORE_MULTI_INIT;
- } else {
- throw excToken("Invalid value for handleStartupErrors:");
- }
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/SunPKCS11.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Mon Nov 05 15:38:52 2012 +0000
-@@ -168,26 +168,37 @@
- String nssLibraryDirectory = config.getNssLibraryDirectory();
- String nssSecmodDirectory = config.getNssSecmodDirectory();
- boolean nssOptimizeSpace = config.getNssOptimizeSpace();
-+ int errorHandling = config.getHandleStartupErrors();
-
- if (secmod.isInitialized()) {
- if (nssSecmodDirectory != null) {
- String s = secmod.getConfigDir();
- if ((s != null) &&
- (s.equals(nssSecmodDirectory) == false)) {
-- throw new ProviderException("Secmod directory "
-- + nssSecmodDirectory
-- + " invalid, NSS already initialized with "
-- + s);
-+ String msg = "Secmod directory " + nssSecmodDirectory
-+ + " invalid, NSS already initialized with " + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- if (nssLibraryDirectory != null) {
- String s = secmod.getLibDir();
- if ((s != null) &&
- (s.equals(nssLibraryDirectory) == false)) {
-- throw new ProviderException("NSS library directory "
-+ String msg = "NSS library directory "
- + nssLibraryDirectory
- + " invalid, NSS already initialized with "
-- + s);
-+ + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- } else {
diff --git a/ppc_stack_overflow_fix.patch b/ppc_stack_overflow_fix.patch
deleted file mode 100644
index d1b6184..0000000
--- a/ppc_stack_overflow_fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --git a/src/cpu/zero/vm/stack_zero.hpp b/src/cpu/zero/vm/stack_zero.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-@@ -99,7 +99,7 @@
- int shadow_pages_size() const {
- return _shadow_pages_size;
- }
-- int abi_stack_available(Thread *thread) const;
-+ ssize_t abi_stack_available(Thread *thread) const;
-
- public:
- void overflow_check(int required_words, TRAPS);
-diff --git a/src/cpu/zero/vm/stack_zero.inline.hpp b/src/cpu/zero/vm/stack_zero.inline.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-@@ -47,12 +47,12 @@
- // This method returns the amount of ABI stack available for us
- // to use under normal circumstances. Note that the returned
- // value can be negative.
--inline int ZeroStack::abi_stack_available(Thread *thread) const {
-+inline ssize_t ZeroStack::abi_stack_available(Thread *thread) const {
- guarantee(Thread::current() == thread, "should run in the same thread");
-- int stack_used = thread->stack_base() - (address) &stack_used
-+ ssize_t stack_used = thread->stack_base() - (address) &stack_used
- + (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size());
-- int stack_free = thread->stack_size() - stack_used;
-+ ssize_t stack_free = thread->stack_size() - stack_used;
- return stack_free;
- }
-
- #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
-diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
---- openjdk/src/hotspot/os/posix/os_posix.cpp
-+++ openjdk/src/hotspot/os/posix/os_posix.cpp
-@@ -4791,6 +4791,13 @@
-
- _java_thread_min_stack_allowed = align_up(_java_thread_min_stack_allowed, vm_page_size());
- _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed, os_min_stack_allowed);
-+#ifdef ZERO
-+ // If this is Zero, allow at the very minimum one page each for the
-+ // Zero stack and the native stack. This won't make any difference
-+ // for 4k pages, but is significant for large pages.
-+ _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed,
-+ align_size_up((size_t)(JavaThread::stack_guard_zone_size()+JavaThread::stack_shadow_zone_size()+2) * vm_page_size(), vm_page_size());
-+#endif
-
- size_t stack_size_in_bytes = ThreadStackSize * K;
- if (stack_size_in_bytes != 0 &&
diff --git a/system-nss-ec-rh1565658.patch b/system-nss-ec-rh1565658.patch
deleted file mode 100644
index 7b1d4aa..0000000
--- a/system-nss-ec-rh1565658.patch
+++ /dev/null
@@ -1,654 +0,0 @@
-diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
---- openjdk/make/autoconf/jdk-options.m4
-+++ openjdk/make/autoconf/jdk-options.m4
-@@ -264,9 +264,10 @@
- #
- AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
- [
-+ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
- AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
-
-- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
-+ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
- ENABLE_INTREE_EC=true
- AC_MSG_RESULT([yes])
- else
-diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
---- openjdk/make/autoconf/libraries.m4
-+++ openjdk/make/autoconf/libraries.m4
-@@ -175,6 +175,48 @@
- AC_SUBST(LIBDL)
- LIBS="$save_LIBS"
-
-+ ###############################################################################
-+ #
-+ # Check for the NSS libraries
-+ #
-+
-+ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
-+
-+ # default is bundled
-+ DEFAULT_SYSTEM_NSS=no
-+
-+ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
-+ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
-+ [
-+ case "${enableval}" in
-+ yes)
-+ system_nss=yes
-+ ;;
-+ *)
-+ system_nss=no
-+ ;;
-+ esac
-+ ],
-+ [
-+ system_nss=${DEFAULT_SYSTEM_NSS}
-+ ])
-+ AC_MSG_RESULT([$system_nss])
-+
-+ if test "x${system_nss}" = "xyes"; then
-+ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
-+ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
-+ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
-+ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
-+ USE_EXTERNAL_NSS=true
-+ else
-+ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
-+ fi
-+ else
-+ USE_EXTERNAL_NSS=false
-+ fi
-+ AC_SUBST(USE_EXTERNAL_NSS)
-+
-+
- # Deprecated libraries, keep the flags for backwards compatibility
- if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
- BASIC_DEPRECATED_ARG_WITH([dxsdk])
-diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
---- openjdk/make/autoconf/spec.gmk.in
-+++ openjdk/make/autoconf/spec.gmk.in
-@@ -764,6 +764,10 @@
- # Libraries
- #
-
-+USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
-+NSS_LIBS:=@NSS_LIBS@
-+NSS_CFLAGS:=@NSS_CFLAGS@
-+
- USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
- LCMS_CFLAGS:=@LCMS_CFLAGS@
- LCMS_LIBS:=@LCMS_LIBS@
-diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
---- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-+++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-@@ -29,9 +29,15 @@
-
- ifeq ($(ENABLE_INTREE_EC), true)
-
-- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
- BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
-
-+ ifeq ($(USE_EXTERNAL_NSS), true)
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
-+ else
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
-+ endif
-+
- #
- # On sol-sparc...all libraries are compiled with -xregs=no%appl
- # (set in CFLAGS_REQUIRED_sparc)
-@@ -60,7 +66,7 @@
- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
- LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
- LIBS := $(LIBCXX), \
-- LIBS_linux := -lc, \
-+ LIBS_linux := -lc $(NSS_LIBS), \
- LIBS_solaris := -lc, \
- VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
- RC_FLAGS := $(RC_FLAGS) \
-diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
---- openjdk/make/mapfiles/libsunec/mapfile-vers
-+++ openjdk/make/mapfiles/libsunec/mapfile-vers
-@@ -31,6 +31,7 @@
- Java_sun_security_ec_ECDSASignature_signDigest;
- Java_sun_security_ec_ECDSASignature_verifySignedDigest;
- Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
-+ Java_sun_security_ec_SunEC_initialize;
- local:
- *;
- };
-diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
---- openjdk/src/java.base/unix/native/include/jni_md.h
-+++ openjdk/src/java.base/unix/native/include/jni_md.h
-@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
---- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-+++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-@@ -61,6 +61,7 @@
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- System.loadLibrary("sunec"); // check for native library
-+ initialize();
- return null;
- }
- });
-@@ -272,4 +273,9 @@
- putService(new ProviderService(this, "KeyAgreement",
- "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
- }
-+
-+ /**
-+ * Initialize the native code.
-+ */
-+ private static native void initialize();
- }
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
---- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-@@ -25,7 +25,11 @@
-
- #include <jni.h>
- #include "jni_util.h"
-+#ifdef SYSTEM_NSS
-+#include "ecc_impl.h"
-+#else
- #include "impl/ecc_impl.h"
-+#endif
-
- #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
- #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
-@@ -33,6 +37,13 @@
- #define INVALID_PARAMETER_EXCEPTION \
- "java/security/InvalidParameterException"
- #define KEY_EXCEPTION "java/security/KeyException"
-+#define INTERNAL_ERROR "java/lang/InternalError"
-+
-+#ifdef SYSTEM_NSS
-+#define SYSTEM_UNUSED(x) UNUSED(x)
-+#else
-+#define SYSTEM_UNUSED(x) x
-+#endif
-
- extern "C" {
-
-@@ -55,8 +66,13 @@
- /*
- * Deep free of the ECParams struct
- */
--void FreeECParams(ECParams *ecparams, jboolean freeStruct)
-+void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
- {
-+#ifdef SYSTEM_NSS
-+ // Needs to be freed using the matching method to the one
-+ // that allocated it. PR_TRUE means the memory is zeroed.
-+ PORT_FreeArena(ecparams->arena, PR_TRUE);
-+#else
- // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
- // Use B_TRUE to free both
-
-@@ -70,6 +86,7 @@
- SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
- if (freeStruct)
- free(ecparams);
-+#endif
- }
-
- jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
-@@ -95,7 +112,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;
-@@ -127,8 +144,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;
- }
-@@ -175,10 +201,15 @@
- }
- if (privKey) {
- FreeECParams(&privKey->ecParams, false);
-+#ifndef SYSTEM_NSS
-+ // The entire ECPrivateKey is allocated in the arena
-+ // when using system NSS, so only the in-tree version
-+ // needs to clear these manually.
- SECITEM_FreeItem(&privKey->version, B_FALSE);
- SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
- SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
- free(privKey);
-+#endif
- }
-
- if (pSeedBuffer) {
-@@ -196,7 +227,7 @@
- */
- JNIEXPORT jbyteArray
- JNICALL Java_sun_security_ec_ECDSASignature_signDigest
-- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
-+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
- {
- jbyte* pDigestBuffer = NULL;
- jint jDigestLength = env->GetArrayLength(digest);
-@@ -255,8 +286,18 @@
- env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
-
- // Sign the digest (using the supplied seed)
-+#ifdef SYSTEM_NSS
-+ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
-+ != SECSuccess) {
-+ ThrowException(env, KEY_EXCEPTION);
-+ goto cleanup;
-+ }
-+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
-+ != SECSuccess) {
-+#else
- if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
- (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
-+#endif
- ThrowException(env, KEY_EXCEPTION);
- goto cleanup;
- }
-@@ -305,7 +346,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;
-
-@@ -362,9 +403,10 @@
-
- cleanup:
- {
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (pubKey.publicValue.data)
- env->ReleaseByteArrayElements(publicKey,
-@@ -390,7 +432,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;
-@@ -466,9 +508,10 @@
- env->ReleaseByteArrayElements(publicKey,
- (jbyte *) publicValue_item.data, JNI_ABORT);
-
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (ecparams)
- FreeECParams(ecparams, true);
-@@ -477,4 +520,28 @@
- return jSecret;
- }
-
-+JNIEXPORT void
-+JNICALL Java_sun_security_ec_SunEC_initialize
-+ (JNIEnv *env, jclass UNUSED(clazz))
-+{
-+#ifdef SYSTEM_NSS
-+ if (SECOID_Init() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+ if (RNG_RNGInit() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+#endif
-+}
-+
-+JNIEXPORT void
-+JNICALL JNI_OnUnload
-+ (JavaVM *vm, void *reserved)
-+{
-+#ifdef SYSTEM_NSS
-+ RNG_RNGShutdown();
-+ SECOID_Shutdown();
-+#endif
-+}
-+
- } /* extern "C" */
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-new file mode 100644
---- /dev/null
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-@@ -0,0 +1,298 @@
-+/*
-+ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
-+ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
-+ *
-+ * Last Modified Date from the Original Code: May 2017
-+ *********************************************************************** */
-+
-+#ifndef _ECC_IMPL_H
-+#define _ECC_IMPL_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <sys/types.h>
-+
-+#ifdef SYSTEM_NSS
-+#include <secitem.h>
-+#include <secerr.h>
-+#include <keythi.h>
-+#ifdef LEGACY_NSS
-+#include <softoken.h>
-+#else
-+#include <blapi.h>
-+#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 <stdint.h>
-+#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 <stdlib.h>
-+#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.
-+*/
-+#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)
-+
-+#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 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, int timing);
-+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 --git a/systemCryptoPolicyPR3183.patch b/systemCryptoPolicyPR3183.patch
deleted file mode 100644
index 4efbe9a..0000000
--- a/systemCryptoPolicyPR3183.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-
-# HG changeset patch
-# User andrew
-# Date 1478057514 0
-# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
-# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
-PR3183: Support Fedora/RHEL system crypto policy
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
---- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
-@@ -43,6 +43,9 @@
- * implementation-specific location, which is typically the properties file
- * {@code conf/security/java.security} in the Java installation directory.
- *
-+ * <p>Additional default values of security properties are read from a
-+ * system-specific location, if available.</p>
-+ *
- * @author Benjamin Renaud
- * @since 1.1
- */
-@@ -52,6 +55,10 @@
- private static final Debug sdebug =
- Debug.getInstance("properties");
-
-+ /* System property file*/
-+ private static final String SYSTEM_PROPERTIES =
-+ "/etc/crypto-policies/back-ends/java.config";
-+
- /* The java.security properties */
- private static Properties props;
-
-@@ -93,6 +100,7 @@
- if (sdebug != null) {
- sdebug.println("reading security properties file: " +
- propFile);
-+ sdebug.println(props.toString());
- }
- } catch (IOException e) {
- if (sdebug != null) {
-@@ -114,6 +122,31 @@
- }
-
- if ("true".equalsIgnoreCase(props.getProperty
-+ ("security.useSystemPropertiesFile"))) {
-+
-+ // now load the system file, if it exists, so its values
-+ // will win if they conflict with the earlier values
-+ try (BufferedInputStream bis =
-+ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
-+ props.load(bis);
-+ loadedProps = true;
-+
-+ if (sdebug != null) {
-+ sdebug.println("reading system security properties file " +
-+ SYSTEM_PROPERTIES);
-+ sdebug.println(props.toString());
-+ }
-+ } catch (IOException e) {
-+ if (sdebug != null) {
-+ sdebug.println
-+ ("unable to load security properties from " +
-+ SYSTEM_PROPERTIES);
-+ e.printStackTrace();
-+ }
-+ }
-+ }
-+
-+ if ("true".equalsIgnoreCase(props.getProperty
- ("security.overridePropertiesFile"))) {
-
- String extraPropFile = System.getProperty
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
---- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
-@@ -276,6 +276,13 @@
- security.overridePropertiesFile=true
-
- #
-+# Determines whether this properties file will be appended to
-+# using the system properties file stored at
-+# /etc/crypto-policies/back-ends/java.config
-+#
-+security.useSystemPropertiesFile=true
-+
-+#
- # Determines the default key and trust manager factory algorithms for
- # the javax.net.ssl package.
- #
6 years
Architecture specific change in rpms/java-openjdk.git
by githook-noreply@fedoraproject.org
The package rpms/java-openjdk.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/java-openjdk.git/commit/?id=903fd....
Change:
-%ifarch s390
Thanks.
Full change:
============
commit 903fd8331690c051451431e7d5e7575021e1a10e
Author: Severin Gehwolf <sgehwolf(a)redhat.com>
Date: Fri Apr 20 14:02:54 2018 +0200
Clean up patches.
- Remove unneeded ones.
- Rename patches for clarity. Update JDK-8201788
from upstream.
- Add patches needed to build on more arches (Zero).
diff --git a/JDK-8200556-aarch64-slowdebug-crash.patch b/JDK-8200556-aarch64-slowdebug-crash.patch
new file mode 100644
index 0000000..bb5453e
--- /dev/null
+++ b/JDK-8200556-aarch64-slowdebug-crash.patch
@@ -0,0 +1,14 @@
+diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
+--- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
++++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
+@@ -343,7 +343,7 @@
+ CodeBuffer cb(code_pos, instruction_size);
+ MacroAssembler a(&cb);
+
+- a.mov(rscratch1, entry);
++ a.movptr(rscratch1, (uintptr_t)entry);
+ a.br(rscratch1);
+
+ ICache::invalidate_range(code_pos, instruction_size);
+
+
diff --git a/JDK-8201495-s390-java-opts.patch b/JDK-8201495-s390-java-opts.patch
new file mode 100644
index 0000000..a16db0c
--- /dev/null
+++ b/JDK-8201495-s390-java-opts.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1523874036 -7200
+# Mon Apr 16 12:20:36 2018 +0200
+# Node ID fc3a72e286e0d5bf9b994d1b778b39f3b080c686
+# Parent 69bae761600bdbc97953500ac51a396d31f54ee9
+8201495: [Zero] Reduce limits of max heap size for boot JDK on s390
+Reviewed-by: ihse, aph, simonis
+
+diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4
+--- a/make/autoconf/boot-jdk.m4
++++ b/make/autoconf/boot-jdk.m4
+@@ -405,7 +405,7 @@
+ BOOTCYCLE_JVM_ARGS_BIG=-Xms64M
+
+ # Maximum amount of heap memory and stack size.
+- JVM_HEAP_LIMIT_32="1024"
++ JVM_HEAP_LIMIT_32="768"
+ # Running a 64 bit JVM allows for and requires a bigger heap
+ JVM_HEAP_LIMIT_64="1600"
+ STACK_SIZE_32=768
diff --git a/JDK-8201509-s390-atomic_store.patch b/JDK-8201509-s390-atomic_store.patch
new file mode 100644
index 0000000..ba7f748
--- /dev/null
+++ b/JDK-8201509-s390-atomic_store.patch
@@ -0,0 +1,18 @@
+diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
++++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+@@ -50,10 +50,10 @@
+ : "Q"(*(volatile long*)src));
+ #elif defined(S390) && !defined(_LP64)
+ double tmp;
+- asm volatile ("ld %0, 0(%1)\n"
+- "std %0, 0(%2)\n"
+- : "=r"(tmp)
+- : "a"(src), "a"(dst));
++ asm volatile ("ld %0, %2\n"
++ "std %0, %1\n"
++ : "=&f"(tmp), "=Q"(*(volatile double*)dst)
++ : "Q"(*(volatile double*)src));
+ #else
+ *(jlong *) dst = *(const jlong *) src;
+ #endif
diff --git a/JDK-8201788-bootcycle-images-jobs.patch b/JDK-8201788-bootcycle-images-jobs.patch
new file mode 100644
index 0000000..05d1a39
--- /dev/null
+++ b/JDK-8201788-bootcycle-images-jobs.patch
@@ -0,0 +1,27 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1524152606 -7200
+# Thu Apr 19 17:43:26 2018 +0200
+# Node ID f7a3ca673e9cc831848fc890a2df3ae9acb447e4
+# Parent dd26184768b0a1c4103a2e9eaa8b4d852a9eca1b
+8201788: Number of make jobs wrong for bootcycle-images target
+Reviewed-by: erikj, ihse
+
+diff --git a/make/Init.gmk b/make/Init.gmk
+--- a/make/Init.gmk
++++ b/make/Init.gmk
+@@ -310,9 +310,13 @@
+ ifneq ($(PARALLEL_TARGETS), )
+ $(call StartGlobalTimer)
+ $(call PrepareSmartJavac)
++ # JOBS will only be empty for a bootcycle-images recursive call
++ # or if specified via a make argument directly. In those cases
++ # treat it as NOT using jobs at all.
+ ( cd $(TOPDIR) && \
+ $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
+- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
++ $(if $(JOBS), -j $(JOBS)) \
++ -f make/Main.gmk $(USER_MAKE_VARS) \
+ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
+ ( exitcode=$$? && \
+ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
diff --git a/PStack-808293.patch b/PStack-808293.patch
deleted file mode 100644
index fc5fe4e..0000000
--- a/PStack-808293.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:33.322164601 +0200
-+++ openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:57.958514071 +0200
-@@ -84,7 +85,8 @@
- if (jthread != null) {
- jthread.printThreadInfoOn(out);
- }
-- while (f != null) {
-+ int maxStack = 256;
-+ while (f != null && maxStack-- > 0) {
- ClosestSymbol sym = f.closestSymbolToPC();
- Address pc = f.pc();
- out.print(pc + "\t");
-@@ -158,10 +160,19 @@
- }
- }
- }
-+ Address oldPC = f.pc();
-+ Address oldFP = f.localVariableBase();
- f = f.sender(th);
-+ if (f != null
-+ && oldPC.equals(f.pc())
-+ && oldFP.equals(f.localVariableBase())) {
-+ // We didn't make any progress
-+ f = null;
-+ }
- }
- } catch (Exception exp) {
-- exp.printStackTrace();
-+ // exp.printStackTrace();
-+ out.println("bad stack: " + exp);
- // continue, may be we can do a better job for other threads
- }
- if (concurrentLocks) {
diff --git a/RHBZ-1249083-system-crypto-policy-PR3183.patch b/RHBZ-1249083-system-crypto-policy-PR3183.patch
new file mode 100644
index 0000000..4efbe9a
--- /dev/null
+++ b/RHBZ-1249083-system-crypto-policy-PR3183.patch
@@ -0,0 +1,88 @@
+
+# HG changeset patch
+# User andrew
+# Date 1478057514 0
+# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
+# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
+PR3183: Support Fedora/RHEL system crypto policy
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
+--- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
+@@ -43,6 +43,9 @@
+ * implementation-specific location, which is typically the properties file
+ * {@code conf/security/java.security} in the Java installation directory.
+ *
++ * <p>Additional default values of security properties are read from a
++ * system-specific location, if available.</p>
++ *
+ * @author Benjamin Renaud
+ * @since 1.1
+ */
+@@ -52,6 +55,10 @@
+ private static final Debug sdebug =
+ Debug.getInstance("properties");
+
++ /* System property file*/
++ private static final String SYSTEM_PROPERTIES =
++ "/etc/crypto-policies/back-ends/java.config";
++
+ /* The java.security properties */
+ private static Properties props;
+
+@@ -93,6 +100,7 @@
+ if (sdebug != null) {
+ sdebug.println("reading security properties file: " +
+ propFile);
++ sdebug.println(props.toString());
+ }
+ } catch (IOException e) {
+ if (sdebug != null) {
+@@ -114,6 +122,31 @@
+ }
+
+ if ("true".equalsIgnoreCase(props.getProperty
++ ("security.useSystemPropertiesFile"))) {
++
++ // now load the system file, if it exists, so its values
++ // will win if they conflict with the earlier values
++ try (BufferedInputStream bis =
++ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
++ props.load(bis);
++ loadedProps = true;
++
++ if (sdebug != null) {
++ sdebug.println("reading system security properties file " +
++ SYSTEM_PROPERTIES);
++ sdebug.println(props.toString());
++ }
++ } catch (IOException e) {
++ if (sdebug != null) {
++ sdebug.println
++ ("unable to load security properties from " +
++ SYSTEM_PROPERTIES);
++ e.printStackTrace();
++ }
++ }
++ }
++
++ if ("true".equalsIgnoreCase(props.getProperty
+ ("security.overridePropertiesFile"))) {
+
+ String extraPropFile = System.getProperty
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
+--- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
+@@ -276,6 +276,13 @@
+ security.overridePropertiesFile=true
+
+ #
++# Determines whether this properties file will be appended to
++# using the system properties file stored at
++# /etc/crypto-policies/back-ends/java.config
++#
++security.useSystemPropertiesFile=true
++
++#
+ # Determines the default key and trust manager factory algorithms for
+ # the javax.net.ssl package.
+ #
diff --git a/RHBZ-1565658-system-nss-SunEC.patch b/RHBZ-1565658-system-nss-SunEC.patch
new file mode 100644
index 0000000..7b1d4aa
--- /dev/null
+++ b/RHBZ-1565658-system-nss-SunEC.patch
@@ -0,0 +1,654 @@
+diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
+--- openjdk/make/autoconf/jdk-options.m4
++++ openjdk/make/autoconf/jdk-options.m4
+@@ -264,9 +264,10 @@
+ #
+ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
+ [
++ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
+ AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
+
+- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
++ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
+ ENABLE_INTREE_EC=true
+ AC_MSG_RESULT([yes])
+ else
+diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
+--- openjdk/make/autoconf/libraries.m4
++++ openjdk/make/autoconf/libraries.m4
+@@ -175,6 +175,48 @@
+ AC_SUBST(LIBDL)
+ LIBS="$save_LIBS"
+
++ ###############################################################################
++ #
++ # Check for the NSS libraries
++ #
++
++ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
++
++ # default is bundled
++ DEFAULT_SYSTEM_NSS=no
++
++ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
++ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
++ [
++ case "${enableval}" in
++ yes)
++ system_nss=yes
++ ;;
++ *)
++ system_nss=no
++ ;;
++ esac
++ ],
++ [
++ system_nss=${DEFAULT_SYSTEM_NSS}
++ ])
++ AC_MSG_RESULT([$system_nss])
++
++ if test "x${system_nss}" = "xyes"; then
++ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
++ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
++ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
++ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
++ USE_EXTERNAL_NSS=true
++ else
++ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
++ fi
++ else
++ USE_EXTERNAL_NSS=false
++ fi
++ AC_SUBST(USE_EXTERNAL_NSS)
++
++
+ # Deprecated libraries, keep the flags for backwards compatibility
+ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ BASIC_DEPRECATED_ARG_WITH([dxsdk])
+diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
+--- openjdk/make/autoconf/spec.gmk.in
++++ openjdk/make/autoconf/spec.gmk.in
+@@ -764,6 +764,10 @@
+ # Libraries
+ #
+
++USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
++NSS_LIBS:=@NSS_LIBS@
++NSS_CFLAGS:=@NSS_CFLAGS@
++
+ USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
+ LCMS_CFLAGS:=@LCMS_CFLAGS@
+ LCMS_LIBS:=@LCMS_LIBS@
+diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+--- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
++++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+@@ -29,9 +29,15 @@
+
+ ifeq ($(ENABLE_INTREE_EC), true)
+
+- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
+ BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
+
++ ifeq ($(USE_EXTERNAL_NSS), true)
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
++ else
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
++ endif
++
+ #
+ # On sol-sparc...all libraries are compiled with -xregs=no%appl
+ # (set in CFLAGS_REQUIRED_sparc)
+@@ -60,7 +66,7 @@
+ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
+ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LIBS := $(LIBCXX), \
+- LIBS_linux := -lc, \
++ LIBS_linux := -lc $(NSS_LIBS), \
+ LIBS_solaris := -lc, \
+ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
+ RC_FLAGS := $(RC_FLAGS) \
+diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
+--- openjdk/make/mapfiles/libsunec/mapfile-vers
++++ openjdk/make/mapfiles/libsunec/mapfile-vers
+@@ -31,6 +31,7 @@
+ Java_sun_security_ec_ECDSASignature_signDigest;
+ Java_sun_security_ec_ECDSASignature_verifySignedDigest;
+ Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
++ Java_sun_security_ec_SunEC_initialize;
+ local:
+ *;
+ };
+diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
+--- openjdk/src/java.base/unix/native/include/jni_md.h
++++ openjdk/src/java.base/unix/native/include/jni_md.h
+@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+--- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
++++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+@@ -61,6 +61,7 @@
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ System.loadLibrary("sunec"); // check for native library
++ initialize();
+ return null;
+ }
+ });
+@@ -272,4 +273,9 @@
+ putService(new ProviderService(this, "KeyAgreement",
+ "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
+ }
++
++ /**
++ * Initialize the native code.
++ */
++ private static native void initialize();
+ }
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+--- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+@@ -25,7 +25,11 @@
+
+ #include <jni.h>
+ #include "jni_util.h"
++#ifdef SYSTEM_NSS
++#include "ecc_impl.h"
++#else
+ #include "impl/ecc_impl.h"
++#endif
+
+ #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
+ #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
+@@ -33,6 +37,13 @@
+ #define INVALID_PARAMETER_EXCEPTION \
+ "java/security/InvalidParameterException"
+ #define KEY_EXCEPTION "java/security/KeyException"
++#define INTERNAL_ERROR "java/lang/InternalError"
++
++#ifdef SYSTEM_NSS
++#define SYSTEM_UNUSED(x) UNUSED(x)
++#else
++#define SYSTEM_UNUSED(x) x
++#endif
+
+ extern "C" {
+
+@@ -55,8 +66,13 @@
+ /*
+ * Deep free of the ECParams struct
+ */
+-void FreeECParams(ECParams *ecparams, jboolean freeStruct)
++void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
+ {
++#ifdef SYSTEM_NSS
++ // Needs to be freed using the matching method to the one
++ // that allocated it. PR_TRUE means the memory is zeroed.
++ PORT_FreeArena(ecparams->arena, PR_TRUE);
++#else
+ // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
+ // Use B_TRUE to free both
+
+@@ -70,6 +86,7 @@
+ SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
+ if (freeStruct)
+ free(ecparams);
++#endif
+ }
+
+ jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
+@@ -95,7 +112,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;
+@@ -127,8 +144,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;
+ }
+@@ -175,10 +201,15 @@
+ }
+ if (privKey) {
+ FreeECParams(&privKey->ecParams, false);
++#ifndef SYSTEM_NSS
++ // The entire ECPrivateKey is allocated in the arena
++ // when using system NSS, so only the in-tree version
++ // needs to clear these manually.
+ SECITEM_FreeItem(&privKey->version, B_FALSE);
+ SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
+ SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
+ free(privKey);
++#endif
+ }
+
+ if (pSeedBuffer) {
+@@ -196,7 +227,7 @@
+ */
+ JNIEXPORT jbyteArray
+ JNICALL Java_sun_security_ec_ECDSASignature_signDigest
+- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
+ {
+ jbyte* pDigestBuffer = NULL;
+ jint jDigestLength = env->GetArrayLength(digest);
+@@ -255,8 +286,18 @@
+ env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
+
+ // Sign the digest (using the supplied seed)
++#ifdef SYSTEM_NSS
++ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
++ != SECSuccess) {
++ ThrowException(env, KEY_EXCEPTION);
++ goto cleanup;
++ }
++ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
++ != SECSuccess) {
++#else
+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
+ (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
++#endif
+ ThrowException(env, KEY_EXCEPTION);
+ goto cleanup;
+ }
+@@ -305,7 +346,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;
+
+@@ -362,9 +403,10 @@
+
+ cleanup:
+ {
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (pubKey.publicValue.data)
+ env->ReleaseByteArrayElements(publicKey,
+@@ -390,7 +432,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;
+@@ -466,9 +508,10 @@
+ env->ReleaseByteArrayElements(publicKey,
+ (jbyte *) publicValue_item.data, JNI_ABORT);
+
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (ecparams)
+ FreeECParams(ecparams, true);
+@@ -477,4 +520,28 @@
+ return jSecret;
+ }
+
++JNIEXPORT void
++JNICALL Java_sun_security_ec_SunEC_initialize
++ (JNIEnv *env, jclass UNUSED(clazz))
++{
++#ifdef SYSTEM_NSS
++ if (SECOID_Init() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++ if (RNG_RNGInit() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++#endif
++}
++
++JNIEXPORT void
++JNICALL JNI_OnUnload
++ (JavaVM *vm, void *reserved)
++{
++#ifdef SYSTEM_NSS
++ RNG_RNGShutdown();
++ SECOID_Shutdown();
++#endif
++}
++
+ } /* extern "C" */
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+new file mode 100644
+--- /dev/null
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+@@ -0,0 +1,298 @@
++/*
++ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
++ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
++ *
++ * Last Modified Date from the Original Code: May 2017
++ *********************************************************************** */
++
++#ifndef _ECC_IMPL_H
++#define _ECC_IMPL_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/types.h>
++
++#ifdef SYSTEM_NSS
++#include <secitem.h>
++#include <secerr.h>
++#include <keythi.h>
++#ifdef LEGACY_NSS
++#include <softoken.h>
++#else
++#include <blapi.h>
++#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 <stdint.h>
++#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 <stdlib.h>
++#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.
++*/
++#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)
++
++#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 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, int timing);
++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 --git a/aarch64BuildFailure.patch b/aarch64BuildFailure.patch
deleted file mode 100644
index bb5453e..0000000
--- a/aarch64BuildFailure.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
---- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
-+++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
-@@ -343,7 +343,7 @@
- CodeBuffer cb(code_pos, instruction_size);
- MacroAssembler a(&cb);
-
-- a.mov(rscratch1, entry);
-+ a.movptr(rscratch1, (uintptr_t)entry);
- a.br(rscratch1);
-
- ICache::invalidate_range(code_pos, instruction_size);
-
-
diff --git a/bootcycle_jobs.patch b/bootcycle_jobs.patch
deleted file mode 100644
index 05cae9d..0000000
--- a/bootcycle_jobs.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -r 21b063d75b3e make/Init.gmk
---- openjdk/make/Init.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ oepnjdk/make/Init.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -303,7 +303,8 @@
- $(call PrepareSmartJavac)
- ( cd $(TOPDIR) && \
- $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
-- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
-+ $(if $(DISABLE_JOBS),, -j $(JOBS)) \
-+ -f make/Main.gmk $(USER_MAKE_VARS) \
- $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
- ( exitcode=$$? && \
- $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
-diff -r 21b063d75b3e make/Main.gmk
---- jdk9/make/Main.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ jdk9/make/Main.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -320,7 +320,7 @@
- ifneq ($(COMPILE_TYPE), cross)
- $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
- +$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
-- JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
-+ DISABLE_JOBS=true SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
- else
- $(call LogWarn, Boot cycle build disabled when cross compiling)
- endif
diff --git a/hotspot-min-max-macros.patch b/hotspot-min-max-macros.patch
deleted file mode 100644
index 3b2909c..0000000
--- a/hotspot-min-max-macros.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r b515beb3b4ad openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp
---- openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Jul 07 18:40:53 2016 +0100
-+++ openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Jul 12 19:13:51 2016 +0100
-@@ -1163,8 +1163,10 @@
- #undef min
- #endif
-
-+#ifndef _GLIBCXX_STDLIB_H
- #define max(a,b) Do_not_use_max_use_MAX2_instead
- #define min(a,b) Do_not_use_min_use_MIN2_instead
-+#endif
-
- // It is necessary to use templates here. Having normal overloaded
- // functions does not work because it is necessary to provide both 32-
diff --git a/java-openjdk-s390-size_t.patch b/java-openjdk-s390-size_t.patch
new file mode 100644
index 0000000..920624c
--- /dev/null
+++ b/java-openjdk-s390-size_t.patch
@@ -0,0 +1,134 @@
+diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
+--- a/src/hotspot/share/code/codeCache.cpp
++++ b/src/hotspot/share/code/codeCache.cpp
+@@ -405,7 +405,7 @@
+ add_heap(heap);
+
+ // Reserve Space
+- size_t size_initial = MIN2(InitialCodeCacheSize, rs.size());
++ size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
+ size_initial = align_up(size_initial, os::vm_page_size());
+ if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
+ vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
+diff --git a/src/hotspot/share/gc/cms/parNewGeneration.cpp b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp
++++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+@@ -200,7 +200,7 @@
+ 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 --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+@@ -2296,7 +2296,7 @@
+ // of things to do) or totally (at the very end).
+ size_t target_size;
+ if (partially) {
+- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
++ target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t)GCDrainStackTargetSize);
+ } else {
+ target_size = 0;
+ }
+diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+@@ -31,7 +31,7 @@
+ }
+
+ size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
+- size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
++ size_t words_to_scan = MIN2(remaining, (size_t)ObjArrayMarkingStride);
+
+ if (remaining > ObjArrayMarkingStride) {
+ push_array_slice(start_from + ObjArrayMarkingStride);
+diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
++++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+@@ -100,7 +100,7 @@
+ 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/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
++++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+@@ -115,7 +115,7 @@
+ const size_t beg_index = size_t(index);
+ assert(beg_index < len || len == 0, "index too large");
+
+- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
++ const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
+ const size_t end_index = beg_index + stride;
+ T* const base = (T*)obj->base();
+ T* const beg = base + beg_index;
+diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
++++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+@@ -905,8 +905,8 @@
+ void PSParallelCompact::initialize_dead_wood_limiter()
+ {
+ const size_t max = 100;
+- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
++ _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
++ _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+ _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 --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
+--- a/src/hotspot/share/gc/shared/plab.cpp
++++ b/src/hotspot/share/gc/shared/plab.cpp
+@@ -32,7 +32,7 @@
+
+ size_t PLAB::min_size() {
+ // Make sure that we return something that is larger than AlignmentReserve
+- return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
++ return align_object_size(MAX2(MinTLABSize / HeapWordSize, (size_t)oopDesc::header_size())) + AlignmentReserve;
+ }
+
+ size_t PLAB::max_size() {
+diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp
+--- a/src/hotspot/share/prims/whitebox.cpp
++++ b/src/hotspot/share/prims/whitebox.cpp
+@@ -1096,7 +1096,7 @@
+ WB_END
+
+ WB_ENTRY(jobject, WB_GetSizeTVMFlag(JNIEnv* env, jobject o, jstring name))
+- uintx result;
++ size_t result;
+ if (GetVMFlag <size_t> (thread, env, name, &result, &CommandLineFlags::size_tAt)) {
+ ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
+ return longBox(thread, env, result);
+diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
+--- a/src/hotspot/share/runtime/arguments.cpp
++++ b/src/hotspot/share/runtime/arguments.cpp
+@@ -1586,7 +1586,7 @@
+ // Increase the code cache size - tiered compiles a lot more.
+ if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
+ FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
+- MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
++ MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)(ReservedCodeCacheSize * 5)));
+ }
+ // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
+ if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
+diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
+--- a/src/hotspot/share/runtime/arguments.hpp
++++ b/src/hotspot/share/runtime/arguments.hpp
+@@ -328,7 +328,7 @@
+ // Value of the conservative maximum heap alignment needed
+ static size_t _conservative_max_heap_alignment;
+
+- static uintx _min_heap_size;
++ static size_t _min_heap_size;
+
+ // -Xrun arguments
+ static AgentLibraryList _libraryList;
diff --git a/java-openjdk.spec b/java-openjdk.spec
index db412b5..813471e 100644
--- a/java-openjdk.spec
+++ b/java-openjdk.spec
@@ -825,7 +825,7 @@ Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{origin}
Version: %{newjavaver}.%{buildver}
-Release: 1%{?dist}
+Release: 2%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@@ -866,38 +866,48 @@ Source13: TestCryptoLevel.java
# Ensure ECDSA is working
Source14: TestECDSA.java
+############################################
#
# RPM/distribution specific patches
#
+############################################
+
+# NSS via SunPKCS11 Provider (disabled comment
+# due to memory leak).
+Patch1000: enableCommentedOutSystemNss.patch
# Ignore AWTError when assistive technologies are loaded
-Patch1: accessible-toolkit.patch
+Patch1: accessible-toolkit.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
-Patch5: multiple-pkcs11-library-init.patch
-Patch12: system-nss-ec-rh1565658.patch
-Patch13: libjpeg-turbo-1.4-compat.patch
-# follow system wide crypto policy RHBZ#1249083
-Patch14: systemCryptoPolicyPR3183.patch
-
+Patch2: java-atk-wrapper-security.patch
+Patch3: libjpeg-turbo-1.4-compat.patch
+# Follow system wide crypto policy RHBZ#1249083
+Patch4: RHBZ-1249083-system-crypto-policy-PR3183.patch
+# System NSS via SunEC Provider
+Patch5: RHBZ-1565658-system-nss-SunEC.patch
+
+#############################################
#
# OpenJDK specific patches
#
-
-# JVM heap size changes for s390 (thanks to aph)
-Patch101: sorted-diff.patch
-Patch104: bootcycle_jobs.patch
-
-
-Patch400: ppc_stack_overflow_fix.patch
-Patch401: aarch64BuildFailure.patch
-
-
-# Non-OpenJDK fixes
-Patch1000: enableCommentedOutSystemNss.patch
+#############################################
+
+# s390 (Zero) build does not bootcycle without this patch
+# Already in JDK-11. Missing backports.
+Patch100: JDK-8201495-s390-java-opts.patch
+# See JDK-8198844. This won't be needed any more in
+# JDK 11+
+Patch101: sorted-diff.patch
+# Type fixing for s390 (Zero). Not upstream.
+Patch102: java-openjdk-s390-size_t.patch
+# bootcycle-images target may run out of ressources
+# due to bad jobs config. Missing backports.
+Patch103: JDK-8201788-bootcycle-images-jobs.patch
+# s390 (Zero) build fix. Pending upstream.
+Patch104: JDK-8201509-s390-atomic_store.patch
+
+# aarch64 slowdebug build fix. Pending upstream
+Patch400: JDK-8200556-aarch64-slowdebug-crash.patch
BuildRequires: autoconf
BuildRequires: automake
@@ -1154,26 +1164,18 @@ fi
sh %{SOURCE12}
pushd %{top_level_dir_name}
%patch1 -p1
+%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-
-# s390 build fixes
-%ifarch s390
-
-%endif
%patch101 -p1
+%patch102 -p1
+%patch103 -p1
%patch104 -p1
-# Zero PPC fixes
-# TODO: propose them upstream
%patch400 -p1
-%patch401 -p1
popd # openjdk
%patch1000
@@ -1728,6 +1730,20 @@ require "copy_jdk_configs.lua"
%changelog
+* Fri Apr 20 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-2
+- Removed unneeded patches:
+ PStack-808293.patch
+ multiple-pkcs11-library-init.patch
+ ppc_stack_overflow_fix.patch
+- Added patches for s390 Zero builds:
+ JDK-8201495-s390-java-opts.patch
+ JDK-8201509-s390-atomic_store.patch
+- Renamed patches for clarity:
+ aarch64BuildFailure.patch => JDK-8200556-aarch64-slowdebug-crash.patch
+ systemCryptoPolicyPR3183.patch => RHBZ-1249083-system-crypto-policy-PR3183.patch
+ bootcycle_jobs.patch => JDK-8201788-bootcycle-images-jobs.patch
+ system-nss-ec-rh1565658.patch => RHBZ-1565658-system-nss-SunEC.patch
+
* Fri Apr 20 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.1.10-1
- updated to security update 1
- jexec unlinked from path
diff --git a/multiple-pkcs11-library-init.patch b/multiple-pkcs11-library-init.patch
deleted file mode 100644
index ade94ee..0000000
--- a/multiple-pkcs11-library-init.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-# HG changeset patch
-# User andrew
-# Date 1352129932 0
-# Node ID e9c857dcb964dbfa5eef3a3590244cb4d999cf7a
-# Parent 1406789608b76d0906881979335d685855f44190
-Allow multiple PKCS11 library initialisation to be a non-critical error.
-
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/Config.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Mon Nov 05 15:38:52 2012 +0000
-@@ -52,6 +52,7 @@
- static final int ERR_HALT = 1;
- static final int ERR_IGNORE_ALL = 2;
- static final int ERR_IGNORE_LIB = 3;
-+ static final int ERR_IGNORE_MULTI_INIT = 4;
-
- // same as allowSingleThreadedModules but controlled via a system property
- // and applied to all providers. if set to false, no SunPKCS11 instances
-@@ -980,6 +981,8 @@
- handleStartupErrors = ERR_IGNORE_LIB;
- } else if (val.equals("halt")) {
- handleStartupErrors = ERR_HALT;
-+ } else if (val.equals("ignoreMultipleInitialisation")) {
-+ handleStartupErrors = ERR_IGNORE_MULTI_INIT;
- } else {
- throw excToken("Invalid value for handleStartupErrors:");
- }
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/SunPKCS11.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Mon Nov 05 15:38:52 2012 +0000
-@@ -168,26 +168,37 @@
- String nssLibraryDirectory = config.getNssLibraryDirectory();
- String nssSecmodDirectory = config.getNssSecmodDirectory();
- boolean nssOptimizeSpace = config.getNssOptimizeSpace();
-+ int errorHandling = config.getHandleStartupErrors();
-
- if (secmod.isInitialized()) {
- if (nssSecmodDirectory != null) {
- String s = secmod.getConfigDir();
- if ((s != null) &&
- (s.equals(nssSecmodDirectory) == false)) {
-- throw new ProviderException("Secmod directory "
-- + nssSecmodDirectory
-- + " invalid, NSS already initialized with "
-- + s);
-+ String msg = "Secmod directory " + nssSecmodDirectory
-+ + " invalid, NSS already initialized with " + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- if (nssLibraryDirectory != null) {
- String s = secmod.getLibDir();
- if ((s != null) &&
- (s.equals(nssLibraryDirectory) == false)) {
-- throw new ProviderException("NSS library directory "
-+ String msg = "NSS library directory "
- + nssLibraryDirectory
- + " invalid, NSS already initialized with "
-- + s);
-+ + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- } else {
diff --git a/ppc_stack_overflow_fix.patch b/ppc_stack_overflow_fix.patch
deleted file mode 100644
index d1b6184..0000000
--- a/ppc_stack_overflow_fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --git a/src/cpu/zero/vm/stack_zero.hpp b/src/cpu/zero/vm/stack_zero.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-@@ -99,7 +99,7 @@
- int shadow_pages_size() const {
- return _shadow_pages_size;
- }
-- int abi_stack_available(Thread *thread) const;
-+ ssize_t abi_stack_available(Thread *thread) const;
-
- public:
- void overflow_check(int required_words, TRAPS);
-diff --git a/src/cpu/zero/vm/stack_zero.inline.hpp b/src/cpu/zero/vm/stack_zero.inline.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-@@ -47,12 +47,12 @@
- // This method returns the amount of ABI stack available for us
- // to use under normal circumstances. Note that the returned
- // value can be negative.
--inline int ZeroStack::abi_stack_available(Thread *thread) const {
-+inline ssize_t ZeroStack::abi_stack_available(Thread *thread) const {
- guarantee(Thread::current() == thread, "should run in the same thread");
-- int stack_used = thread->stack_base() - (address) &stack_used
-+ ssize_t stack_used = thread->stack_base() - (address) &stack_used
- + (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size());
-- int stack_free = thread->stack_size() - stack_used;
-+ ssize_t stack_free = thread->stack_size() - stack_used;
- return stack_free;
- }
-
- #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
-diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
---- openjdk/src/hotspot/os/posix/os_posix.cpp
-+++ openjdk/src/hotspot/os/posix/os_posix.cpp
-@@ -4791,6 +4791,13 @@
-
- _java_thread_min_stack_allowed = align_up(_java_thread_min_stack_allowed, vm_page_size());
- _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed, os_min_stack_allowed);
-+#ifdef ZERO
-+ // If this is Zero, allow at the very minimum one page each for the
-+ // Zero stack and the native stack. This won't make any difference
-+ // for 4k pages, but is significant for large pages.
-+ _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed,
-+ align_size_up((size_t)(JavaThread::stack_guard_zone_size()+JavaThread::stack_shadow_zone_size()+2) * vm_page_size(), vm_page_size());
-+#endif
-
- size_t stack_size_in_bytes = ThreadStackSize * K;
- if (stack_size_in_bytes != 0 &&
diff --git a/system-nss-ec-rh1565658.patch b/system-nss-ec-rh1565658.patch
deleted file mode 100644
index 7b1d4aa..0000000
--- a/system-nss-ec-rh1565658.patch
+++ /dev/null
@@ -1,654 +0,0 @@
-diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
---- openjdk/make/autoconf/jdk-options.m4
-+++ openjdk/make/autoconf/jdk-options.m4
-@@ -264,9 +264,10 @@
- #
- AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
- [
-+ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
- AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
-
-- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
-+ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
- ENABLE_INTREE_EC=true
- AC_MSG_RESULT([yes])
- else
-diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
---- openjdk/make/autoconf/libraries.m4
-+++ openjdk/make/autoconf/libraries.m4
-@@ -175,6 +175,48 @@
- AC_SUBST(LIBDL)
- LIBS="$save_LIBS"
-
-+ ###############################################################################
-+ #
-+ # Check for the NSS libraries
-+ #
-+
-+ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
-+
-+ # default is bundled
-+ DEFAULT_SYSTEM_NSS=no
-+
-+ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
-+ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
-+ [
-+ case "${enableval}" in
-+ yes)
-+ system_nss=yes
-+ ;;
-+ *)
-+ system_nss=no
-+ ;;
-+ esac
-+ ],
-+ [
-+ system_nss=${DEFAULT_SYSTEM_NSS}
-+ ])
-+ AC_MSG_RESULT([$system_nss])
-+
-+ if test "x${system_nss}" = "xyes"; then
-+ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
-+ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
-+ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
-+ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
-+ USE_EXTERNAL_NSS=true
-+ else
-+ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
-+ fi
-+ else
-+ USE_EXTERNAL_NSS=false
-+ fi
-+ AC_SUBST(USE_EXTERNAL_NSS)
-+
-+
- # Deprecated libraries, keep the flags for backwards compatibility
- if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
- BASIC_DEPRECATED_ARG_WITH([dxsdk])
-diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
---- openjdk/make/autoconf/spec.gmk.in
-+++ openjdk/make/autoconf/spec.gmk.in
-@@ -764,6 +764,10 @@
- # Libraries
- #
-
-+USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
-+NSS_LIBS:=@NSS_LIBS@
-+NSS_CFLAGS:=@NSS_CFLAGS@
-+
- USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
- LCMS_CFLAGS:=@LCMS_CFLAGS@
- LCMS_LIBS:=@LCMS_LIBS@
-diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
---- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-+++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-@@ -29,9 +29,15 @@
-
- ifeq ($(ENABLE_INTREE_EC), true)
-
-- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
- BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
-
-+ ifeq ($(USE_EXTERNAL_NSS), true)
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
-+ else
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
-+ endif
-+
- #
- # On sol-sparc...all libraries are compiled with -xregs=no%appl
- # (set in CFLAGS_REQUIRED_sparc)
-@@ -60,7 +66,7 @@
- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
- LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
- LIBS := $(LIBCXX), \
-- LIBS_linux := -lc, \
-+ LIBS_linux := -lc $(NSS_LIBS), \
- LIBS_solaris := -lc, \
- VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
- RC_FLAGS := $(RC_FLAGS) \
-diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
---- openjdk/make/mapfiles/libsunec/mapfile-vers
-+++ openjdk/make/mapfiles/libsunec/mapfile-vers
-@@ -31,6 +31,7 @@
- Java_sun_security_ec_ECDSASignature_signDigest;
- Java_sun_security_ec_ECDSASignature_verifySignedDigest;
- Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
-+ Java_sun_security_ec_SunEC_initialize;
- local:
- *;
- };
-diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
---- openjdk/src/java.base/unix/native/include/jni_md.h
-+++ openjdk/src/java.base/unix/native/include/jni_md.h
-@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
---- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-+++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-@@ -61,6 +61,7 @@
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- System.loadLibrary("sunec"); // check for native library
-+ initialize();
- return null;
- }
- });
-@@ -272,4 +273,9 @@
- putService(new ProviderService(this, "KeyAgreement",
- "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
- }
-+
-+ /**
-+ * Initialize the native code.
-+ */
-+ private static native void initialize();
- }
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
---- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-@@ -25,7 +25,11 @@
-
- #include <jni.h>
- #include "jni_util.h"
-+#ifdef SYSTEM_NSS
-+#include "ecc_impl.h"
-+#else
- #include "impl/ecc_impl.h"
-+#endif
-
- #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
- #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
-@@ -33,6 +37,13 @@
- #define INVALID_PARAMETER_EXCEPTION \
- "java/security/InvalidParameterException"
- #define KEY_EXCEPTION "java/security/KeyException"
-+#define INTERNAL_ERROR "java/lang/InternalError"
-+
-+#ifdef SYSTEM_NSS
-+#define SYSTEM_UNUSED(x) UNUSED(x)
-+#else
-+#define SYSTEM_UNUSED(x) x
-+#endif
-
- extern "C" {
-
-@@ -55,8 +66,13 @@
- /*
- * Deep free of the ECParams struct
- */
--void FreeECParams(ECParams *ecparams, jboolean freeStruct)
-+void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
- {
-+#ifdef SYSTEM_NSS
-+ // Needs to be freed using the matching method to the one
-+ // that allocated it. PR_TRUE means the memory is zeroed.
-+ PORT_FreeArena(ecparams->arena, PR_TRUE);
-+#else
- // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
- // Use B_TRUE to free both
-
-@@ -70,6 +86,7 @@
- SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
- if (freeStruct)
- free(ecparams);
-+#endif
- }
-
- jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
-@@ -95,7 +112,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;
-@@ -127,8 +144,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;
- }
-@@ -175,10 +201,15 @@
- }
- if (privKey) {
- FreeECParams(&privKey->ecParams, false);
-+#ifndef SYSTEM_NSS
-+ // The entire ECPrivateKey is allocated in the arena
-+ // when using system NSS, so only the in-tree version
-+ // needs to clear these manually.
- SECITEM_FreeItem(&privKey->version, B_FALSE);
- SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
- SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
- free(privKey);
-+#endif
- }
-
- if (pSeedBuffer) {
-@@ -196,7 +227,7 @@
- */
- JNIEXPORT jbyteArray
- JNICALL Java_sun_security_ec_ECDSASignature_signDigest
-- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
-+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
- {
- jbyte* pDigestBuffer = NULL;
- jint jDigestLength = env->GetArrayLength(digest);
-@@ -255,8 +286,18 @@
- env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
-
- // Sign the digest (using the supplied seed)
-+#ifdef SYSTEM_NSS
-+ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
-+ != SECSuccess) {
-+ ThrowException(env, KEY_EXCEPTION);
-+ goto cleanup;
-+ }
-+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
-+ != SECSuccess) {
-+#else
- if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
- (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
-+#endif
- ThrowException(env, KEY_EXCEPTION);
- goto cleanup;
- }
-@@ -305,7 +346,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;
-
-@@ -362,9 +403,10 @@
-
- cleanup:
- {
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (pubKey.publicValue.data)
- env->ReleaseByteArrayElements(publicKey,
-@@ -390,7 +432,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;
-@@ -466,9 +508,10 @@
- env->ReleaseByteArrayElements(publicKey,
- (jbyte *) publicValue_item.data, JNI_ABORT);
-
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (ecparams)
- FreeECParams(ecparams, true);
-@@ -477,4 +520,28 @@
- return jSecret;
- }
-
-+JNIEXPORT void
-+JNICALL Java_sun_security_ec_SunEC_initialize
-+ (JNIEnv *env, jclass UNUSED(clazz))
-+{
-+#ifdef SYSTEM_NSS
-+ if (SECOID_Init() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+ if (RNG_RNGInit() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+#endif
-+}
-+
-+JNIEXPORT void
-+JNICALL JNI_OnUnload
-+ (JavaVM *vm, void *reserved)
-+{
-+#ifdef SYSTEM_NSS
-+ RNG_RNGShutdown();
-+ SECOID_Shutdown();
-+#endif
-+}
-+
- } /* extern "C" */
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-new file mode 100644
---- /dev/null
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-@@ -0,0 +1,298 @@
-+/*
-+ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
-+ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
-+ *
-+ * Last Modified Date from the Original Code: May 2017
-+ *********************************************************************** */
-+
-+#ifndef _ECC_IMPL_H
-+#define _ECC_IMPL_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <sys/types.h>
-+
-+#ifdef SYSTEM_NSS
-+#include <secitem.h>
-+#include <secerr.h>
-+#include <keythi.h>
-+#ifdef LEGACY_NSS
-+#include <softoken.h>
-+#else
-+#include <blapi.h>
-+#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 <stdint.h>
-+#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 <stdlib.h>
-+#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.
-+*/
-+#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)
-+
-+#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 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, int timing);
-+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 --git a/systemCryptoPolicyPR3183.patch b/systemCryptoPolicyPR3183.patch
deleted file mode 100644
index 4efbe9a..0000000
--- a/systemCryptoPolicyPR3183.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-
-# HG changeset patch
-# User andrew
-# Date 1478057514 0
-# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
-# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
-PR3183: Support Fedora/RHEL system crypto policy
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
---- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
-@@ -43,6 +43,9 @@
- * implementation-specific location, which is typically the properties file
- * {@code conf/security/java.security} in the Java installation directory.
- *
-+ * <p>Additional default values of security properties are read from a
-+ * system-specific location, if available.</p>
-+ *
- * @author Benjamin Renaud
- * @since 1.1
- */
-@@ -52,6 +55,10 @@
- private static final Debug sdebug =
- Debug.getInstance("properties");
-
-+ /* System property file*/
-+ private static final String SYSTEM_PROPERTIES =
-+ "/etc/crypto-policies/back-ends/java.config";
-+
- /* The java.security properties */
- private static Properties props;
-
-@@ -93,6 +100,7 @@
- if (sdebug != null) {
- sdebug.println("reading security properties file: " +
- propFile);
-+ sdebug.println(props.toString());
- }
- } catch (IOException e) {
- if (sdebug != null) {
-@@ -114,6 +122,31 @@
- }
-
- if ("true".equalsIgnoreCase(props.getProperty
-+ ("security.useSystemPropertiesFile"))) {
-+
-+ // now load the system file, if it exists, so its values
-+ // will win if they conflict with the earlier values
-+ try (BufferedInputStream bis =
-+ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
-+ props.load(bis);
-+ loadedProps = true;
-+
-+ if (sdebug != null) {
-+ sdebug.println("reading system security properties file " +
-+ SYSTEM_PROPERTIES);
-+ sdebug.println(props.toString());
-+ }
-+ } catch (IOException e) {
-+ if (sdebug != null) {
-+ sdebug.println
-+ ("unable to load security properties from " +
-+ SYSTEM_PROPERTIES);
-+ e.printStackTrace();
-+ }
-+ }
-+ }
-+
-+ if ("true".equalsIgnoreCase(props.getProperty
- ("security.overridePropertiesFile"))) {
-
- String extraPropFile = System.getProperty
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
---- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
-@@ -276,6 +276,13 @@
- security.overridePropertiesFile=true
-
- #
-+# Determines whether this properties file will be appended to
-+# using the system properties file stored at
-+# /etc/crypto-policies/back-ends/java.config
-+#
-+security.useSystemPropertiesFile=true
-+
-+#
- # Determines the default key and trust manager factory algorithms for
- # the javax.net.ssl package.
- #
6 years
Architecture specific change in rpms/java-openjdk.git
by githook-noreply@fedoraproject.org
The package rpms/java-openjdk.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/java-openjdk.git/commit/?id=14c09....
Change:
-%ifarch s390
Thanks.
Full change:
============
commit 14c0906269199b7aece210c5d2cce7d0f20bf167
Author: Severin Gehwolf <sgehwolf(a)redhat.com>
Date: Fri Apr 20 14:02:54 2018 +0200
Clean up patches.
- Remove unneeded ones.
- Rename patches for clarity. Update JDK-8201788
from upstream.
- Add patches needed to build on more arches (Zero).
diff --git a/JDK-8200556-aarch64-slowdebug-crash.patch b/JDK-8200556-aarch64-slowdebug-crash.patch
new file mode 100644
index 0000000..bb5453e
--- /dev/null
+++ b/JDK-8200556-aarch64-slowdebug-crash.patch
@@ -0,0 +1,14 @@
+diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
+--- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
++++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
+@@ -343,7 +343,7 @@
+ CodeBuffer cb(code_pos, instruction_size);
+ MacroAssembler a(&cb);
+
+- a.mov(rscratch1, entry);
++ a.movptr(rscratch1, (uintptr_t)entry);
+ a.br(rscratch1);
+
+ ICache::invalidate_range(code_pos, instruction_size);
+
+
diff --git a/JDK-8201495-s390-java-opts.patch b/JDK-8201495-s390-java-opts.patch
new file mode 100644
index 0000000..a16db0c
--- /dev/null
+++ b/JDK-8201495-s390-java-opts.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1523874036 -7200
+# Mon Apr 16 12:20:36 2018 +0200
+# Node ID fc3a72e286e0d5bf9b994d1b778b39f3b080c686
+# Parent 69bae761600bdbc97953500ac51a396d31f54ee9
+8201495: [Zero] Reduce limits of max heap size for boot JDK on s390
+Reviewed-by: ihse, aph, simonis
+
+diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4
+--- a/make/autoconf/boot-jdk.m4
++++ b/make/autoconf/boot-jdk.m4
+@@ -405,7 +405,7 @@
+ BOOTCYCLE_JVM_ARGS_BIG=-Xms64M
+
+ # Maximum amount of heap memory and stack size.
+- JVM_HEAP_LIMIT_32="1024"
++ JVM_HEAP_LIMIT_32="768"
+ # Running a 64 bit JVM allows for and requires a bigger heap
+ JVM_HEAP_LIMIT_64="1600"
+ STACK_SIZE_32=768
diff --git a/JDK-8201509-s390-atomic_store.patch b/JDK-8201509-s390-atomic_store.patch
new file mode 100644
index 0000000..ba7f748
--- /dev/null
+++ b/JDK-8201509-s390-atomic_store.patch
@@ -0,0 +1,18 @@
+diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
++++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
+@@ -50,10 +50,10 @@
+ : "Q"(*(volatile long*)src));
+ #elif defined(S390) && !defined(_LP64)
+ double tmp;
+- asm volatile ("ld %0, 0(%1)\n"
+- "std %0, 0(%2)\n"
+- : "=r"(tmp)
+- : "a"(src), "a"(dst));
++ asm volatile ("ld %0, %2\n"
++ "std %0, %1\n"
++ : "=&f"(tmp), "=Q"(*(volatile double*)dst)
++ : "Q"(*(volatile double*)src));
+ #else
+ *(jlong *) dst = *(const jlong *) src;
+ #endif
diff --git a/JDK-8201788-bootcycle-images-jobs.patch b/JDK-8201788-bootcycle-images-jobs.patch
new file mode 100644
index 0000000..05d1a39
--- /dev/null
+++ b/JDK-8201788-bootcycle-images-jobs.patch
@@ -0,0 +1,27 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1524152606 -7200
+# Thu Apr 19 17:43:26 2018 +0200
+# Node ID f7a3ca673e9cc831848fc890a2df3ae9acb447e4
+# Parent dd26184768b0a1c4103a2e9eaa8b4d852a9eca1b
+8201788: Number of make jobs wrong for bootcycle-images target
+Reviewed-by: erikj, ihse
+
+diff --git a/make/Init.gmk b/make/Init.gmk
+--- a/make/Init.gmk
++++ b/make/Init.gmk
+@@ -310,9 +310,13 @@
+ ifneq ($(PARALLEL_TARGETS), )
+ $(call StartGlobalTimer)
+ $(call PrepareSmartJavac)
++ # JOBS will only be empty for a bootcycle-images recursive call
++ # or if specified via a make argument directly. In those cases
++ # treat it as NOT using jobs at all.
+ ( cd $(TOPDIR) && \
+ $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
+- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
++ $(if $(JOBS), -j $(JOBS)) \
++ -f make/Main.gmk $(USER_MAKE_VARS) \
+ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
+ ( exitcode=$$? && \
+ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
diff --git a/PStack-808293.patch b/PStack-808293.patch
deleted file mode 100644
index fc5fe4e..0000000
--- a/PStack-808293.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:33.322164601 +0200
-+++ openjdk/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:57.958514071 +0200
-@@ -84,7 +85,8 @@
- if (jthread != null) {
- jthread.printThreadInfoOn(out);
- }
-- while (f != null) {
-+ int maxStack = 256;
-+ while (f != null && maxStack-- > 0) {
- ClosestSymbol sym = f.closestSymbolToPC();
- Address pc = f.pc();
- out.print(pc + "\t");
-@@ -158,10 +160,19 @@
- }
- }
- }
-+ Address oldPC = f.pc();
-+ Address oldFP = f.localVariableBase();
- f = f.sender(th);
-+ if (f != null
-+ && oldPC.equals(f.pc())
-+ && oldFP.equals(f.localVariableBase())) {
-+ // We didn't make any progress
-+ f = null;
-+ }
- }
- } catch (Exception exp) {
-- exp.printStackTrace();
-+ // exp.printStackTrace();
-+ out.println("bad stack: " + exp);
- // continue, may be we can do a better job for other threads
- }
- if (concurrentLocks) {
diff --git a/RHBZ-1249083-system-crypto-policy-PR3183.patch b/RHBZ-1249083-system-crypto-policy-PR3183.patch
new file mode 100644
index 0000000..4efbe9a
--- /dev/null
+++ b/RHBZ-1249083-system-crypto-policy-PR3183.patch
@@ -0,0 +1,88 @@
+
+# HG changeset patch
+# User andrew
+# Date 1478057514 0
+# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
+# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
+PR3183: Support Fedora/RHEL system crypto policy
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
+--- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
+@@ -43,6 +43,9 @@
+ * implementation-specific location, which is typically the properties file
+ * {@code conf/security/java.security} in the Java installation directory.
+ *
++ * <p>Additional default values of security properties are read from a
++ * system-specific location, if available.</p>
++ *
+ * @author Benjamin Renaud
+ * @since 1.1
+ */
+@@ -52,6 +55,10 @@
+ private static final Debug sdebug =
+ Debug.getInstance("properties");
+
++ /* System property file*/
++ private static final String SYSTEM_PROPERTIES =
++ "/etc/crypto-policies/back-ends/java.config";
++
+ /* The java.security properties */
+ private static Properties props;
+
+@@ -93,6 +100,7 @@
+ if (sdebug != null) {
+ sdebug.println("reading security properties file: " +
+ propFile);
++ sdebug.println(props.toString());
+ }
+ } catch (IOException e) {
+ if (sdebug != null) {
+@@ -114,6 +122,31 @@
+ }
+
+ if ("true".equalsIgnoreCase(props.getProperty
++ ("security.useSystemPropertiesFile"))) {
++
++ // now load the system file, if it exists, so its values
++ // will win if they conflict with the earlier values
++ try (BufferedInputStream bis =
++ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
++ props.load(bis);
++ loadedProps = true;
++
++ if (sdebug != null) {
++ sdebug.println("reading system security properties file " +
++ SYSTEM_PROPERTIES);
++ sdebug.println(props.toString());
++ }
++ } catch (IOException e) {
++ if (sdebug != null) {
++ sdebug.println
++ ("unable to load security properties from " +
++ SYSTEM_PROPERTIES);
++ e.printStackTrace();
++ }
++ }
++ }
++
++ if ("true".equalsIgnoreCase(props.getProperty
+ ("security.overridePropertiesFile"))) {
+
+ String extraPropFile = System.getProperty
+diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
+--- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
++++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
+@@ -276,6 +276,13 @@
+ security.overridePropertiesFile=true
+
+ #
++# Determines whether this properties file will be appended to
++# using the system properties file stored at
++# /etc/crypto-policies/back-ends/java.config
++#
++security.useSystemPropertiesFile=true
++
++#
+ # Determines the default key and trust manager factory algorithms for
+ # the javax.net.ssl package.
+ #
diff --git a/RHBZ-1565658-system-nss-SunEC.patch b/RHBZ-1565658-system-nss-SunEC.patch
new file mode 100644
index 0000000..7b1d4aa
--- /dev/null
+++ b/RHBZ-1565658-system-nss-SunEC.patch
@@ -0,0 +1,654 @@
+diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
+--- openjdk/make/autoconf/jdk-options.m4
++++ openjdk/make/autoconf/jdk-options.m4
+@@ -264,9 +264,10 @@
+ #
+ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
+ [
++ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
+ AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
+
+- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
++ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
+ ENABLE_INTREE_EC=true
+ AC_MSG_RESULT([yes])
+ else
+diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
+--- openjdk/make/autoconf/libraries.m4
++++ openjdk/make/autoconf/libraries.m4
+@@ -175,6 +175,48 @@
+ AC_SUBST(LIBDL)
+ LIBS="$save_LIBS"
+
++ ###############################################################################
++ #
++ # Check for the NSS libraries
++ #
++
++ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
++
++ # default is bundled
++ DEFAULT_SYSTEM_NSS=no
++
++ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
++ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
++ [
++ case "${enableval}" in
++ yes)
++ system_nss=yes
++ ;;
++ *)
++ system_nss=no
++ ;;
++ esac
++ ],
++ [
++ system_nss=${DEFAULT_SYSTEM_NSS}
++ ])
++ AC_MSG_RESULT([$system_nss])
++
++ if test "x${system_nss}" = "xyes"; then
++ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
++ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
++ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
++ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
++ USE_EXTERNAL_NSS=true
++ else
++ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
++ fi
++ else
++ USE_EXTERNAL_NSS=false
++ fi
++ AC_SUBST(USE_EXTERNAL_NSS)
++
++
+ # Deprecated libraries, keep the flags for backwards compatibility
+ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ BASIC_DEPRECATED_ARG_WITH([dxsdk])
+diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
+--- openjdk/make/autoconf/spec.gmk.in
++++ openjdk/make/autoconf/spec.gmk.in
+@@ -764,6 +764,10 @@
+ # Libraries
+ #
+
++USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
++NSS_LIBS:=@NSS_LIBS@
++NSS_CFLAGS:=@NSS_CFLAGS@
++
+ USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
+ LCMS_CFLAGS:=@LCMS_CFLAGS@
+ LCMS_LIBS:=@LCMS_LIBS@
+diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+--- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
++++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
+@@ -29,9 +29,15 @@
+
+ ifeq ($(ENABLE_INTREE_EC), true)
+
+- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
+ BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
+
++ ifeq ($(USE_EXTERNAL_NSS), true)
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
++ else
++ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
++ endif
++
+ #
+ # On sol-sparc...all libraries are compiled with -xregs=no%appl
+ # (set in CFLAGS_REQUIRED_sparc)
+@@ -60,7 +66,7 @@
+ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
+ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LIBS := $(LIBCXX), \
+- LIBS_linux := -lc, \
++ LIBS_linux := -lc $(NSS_LIBS), \
+ LIBS_solaris := -lc, \
+ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
+ RC_FLAGS := $(RC_FLAGS) \
+diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
+--- openjdk/make/mapfiles/libsunec/mapfile-vers
++++ openjdk/make/mapfiles/libsunec/mapfile-vers
+@@ -31,6 +31,7 @@
+ Java_sun_security_ec_ECDSASignature_signDigest;
+ Java_sun_security_ec_ECDSASignature_verifySignedDigest;
+ Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
++ Java_sun_security_ec_SunEC_initialize;
+ local:
+ *;
+ };
+diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
+--- openjdk/src/java.base/unix/native/include/jni_md.h
++++ openjdk/src/java.base/unix/native/include/jni_md.h
+@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+--- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
++++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
+@@ -61,6 +61,7 @@
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ System.loadLibrary("sunec"); // check for native library
++ initialize();
+ return null;
+ }
+ });
+@@ -272,4 +273,9 @@
+ putService(new ProviderService(this, "KeyAgreement",
+ "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
+ }
++
++ /**
++ * Initialize the native code.
++ */
++ private static native void initialize();
+ }
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+--- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
+@@ -25,7 +25,11 @@
+
+ #include <jni.h>
+ #include "jni_util.h"
++#ifdef SYSTEM_NSS
++#include "ecc_impl.h"
++#else
+ #include "impl/ecc_impl.h"
++#endif
+
+ #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
+ #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
+@@ -33,6 +37,13 @@
+ #define INVALID_PARAMETER_EXCEPTION \
+ "java/security/InvalidParameterException"
+ #define KEY_EXCEPTION "java/security/KeyException"
++#define INTERNAL_ERROR "java/lang/InternalError"
++
++#ifdef SYSTEM_NSS
++#define SYSTEM_UNUSED(x) UNUSED(x)
++#else
++#define SYSTEM_UNUSED(x) x
++#endif
+
+ extern "C" {
+
+@@ -55,8 +66,13 @@
+ /*
+ * Deep free of the ECParams struct
+ */
+-void FreeECParams(ECParams *ecparams, jboolean freeStruct)
++void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
+ {
++#ifdef SYSTEM_NSS
++ // Needs to be freed using the matching method to the one
++ // that allocated it. PR_TRUE means the memory is zeroed.
++ PORT_FreeArena(ecparams->arena, PR_TRUE);
++#else
+ // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
+ // Use B_TRUE to free both
+
+@@ -70,6 +86,7 @@
+ SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
+ if (freeStruct)
+ free(ecparams);
++#endif
+ }
+
+ jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
+@@ -95,7 +112,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;
+@@ -127,8 +144,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;
+ }
+@@ -175,10 +201,15 @@
+ }
+ if (privKey) {
+ FreeECParams(&privKey->ecParams, false);
++#ifndef SYSTEM_NSS
++ // The entire ECPrivateKey is allocated in the arena
++ // when using system NSS, so only the in-tree version
++ // needs to clear these manually.
+ SECITEM_FreeItem(&privKey->version, B_FALSE);
+ SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
+ SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
+ free(privKey);
++#endif
+ }
+
+ if (pSeedBuffer) {
+@@ -196,7 +227,7 @@
+ */
+ JNIEXPORT jbyteArray
+ JNICALL Java_sun_security_ec_ECDSASignature_signDigest
+- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
+ {
+ jbyte* pDigestBuffer = NULL;
+ jint jDigestLength = env->GetArrayLength(digest);
+@@ -255,8 +286,18 @@
+ env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
+
+ // Sign the digest (using the supplied seed)
++#ifdef SYSTEM_NSS
++ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
++ != SECSuccess) {
++ ThrowException(env, KEY_EXCEPTION);
++ goto cleanup;
++ }
++ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
++ != SECSuccess) {
++#else
+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
+ (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
++#endif
+ ThrowException(env, KEY_EXCEPTION);
+ goto cleanup;
+ }
+@@ -305,7 +346,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;
+
+@@ -362,9 +403,10 @@
+
+ cleanup:
+ {
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (pubKey.publicValue.data)
+ env->ReleaseByteArrayElements(publicKey,
+@@ -390,7 +432,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;
+@@ -466,9 +508,10 @@
+ env->ReleaseByteArrayElements(publicKey,
+ (jbyte *) publicValue_item.data, JNI_ABORT);
+
+- if (params_item.data)
++ if (params_item.data) {
+ env->ReleaseByteArrayElements(encodedParams,
+ (jbyte *) params_item.data, JNI_ABORT);
++ }
+
+ if (ecparams)
+ FreeECParams(ecparams, true);
+@@ -477,4 +520,28 @@
+ return jSecret;
+ }
+
++JNIEXPORT void
++JNICALL Java_sun_security_ec_SunEC_initialize
++ (JNIEnv *env, jclass UNUSED(clazz))
++{
++#ifdef SYSTEM_NSS
++ if (SECOID_Init() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++ if (RNG_RNGInit() != SECSuccess) {
++ ThrowException(env, INTERNAL_ERROR);
++ }
++#endif
++}
++
++JNIEXPORT void
++JNICALL JNI_OnUnload
++ (JavaVM *vm, void *reserved)
++{
++#ifdef SYSTEM_NSS
++ RNG_RNGShutdown();
++ SECOID_Shutdown();
++#endif
++}
++
+ } /* extern "C" */
+diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+new file mode 100644
+--- /dev/null
++++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
+@@ -0,0 +1,298 @@
++/*
++ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
++ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
++ *
++ * Last Modified Date from the Original Code: May 2017
++ *********************************************************************** */
++
++#ifndef _ECC_IMPL_H
++#define _ECC_IMPL_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/types.h>
++
++#ifdef SYSTEM_NSS
++#include <secitem.h>
++#include <secerr.h>
++#include <keythi.h>
++#ifdef LEGACY_NSS
++#include <softoken.h>
++#else
++#include <blapi.h>
++#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 <stdint.h>
++#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 <stdlib.h>
++#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.
++*/
++#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)
++
++#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 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, int timing);
++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 --git a/aarch64BuildFailure.patch b/aarch64BuildFailure.patch
deleted file mode 100644
index bb5453e..0000000
--- a/aarch64BuildFailure.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
---- openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
-+++ openjdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
-@@ -343,7 +343,7 @@
- CodeBuffer cb(code_pos, instruction_size);
- MacroAssembler a(&cb);
-
-- a.mov(rscratch1, entry);
-+ a.movptr(rscratch1, (uintptr_t)entry);
- a.br(rscratch1);
-
- ICache::invalidate_range(code_pos, instruction_size);
-
-
diff --git a/bootcycle_jobs.patch b/bootcycle_jobs.patch
deleted file mode 100644
index 05cae9d..0000000
--- a/bootcycle_jobs.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -r 21b063d75b3e make/Init.gmk
---- openjdk/make/Init.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ oepnjdk/make/Init.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -303,7 +303,8 @@
- $(call PrepareSmartJavac)
- ( cd $(TOPDIR) && \
- $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
-- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
-+ $(if $(DISABLE_JOBS),, -j $(JOBS)) \
-+ -f make/Main.gmk $(USER_MAKE_VARS) \
- $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
- ( exitcode=$$? && \
- $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
-diff -r 21b063d75b3e make/Main.gmk
---- jdk9/make/Main.gmk Thu Mar 16 16:34:33 2017 +0000
-+++ jdk9/make/Main.gmk Tue Apr 04 13:49:37 2017 +0100
-@@ -320,7 +320,7 @@
- ifneq ($(COMPILE_TYPE), cross)
- $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
- +$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
-- JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
-+ DISABLE_JOBS=true SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
- else
- $(call LogWarn, Boot cycle build disabled when cross compiling)
- endif
diff --git a/hotspot-min-max-macros.patch b/hotspot-min-max-macros.patch
deleted file mode 100644
index 3b2909c..0000000
--- a/hotspot-min-max-macros.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -r b515beb3b4ad openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp
---- openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Jul 07 18:40:53 2016 +0100
-+++ openjdk/srchotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Jul 12 19:13:51 2016 +0100
-@@ -1163,8 +1163,10 @@
- #undef min
- #endif
-
-+#ifndef _GLIBCXX_STDLIB_H
- #define max(a,b) Do_not_use_max_use_MAX2_instead
- #define min(a,b) Do_not_use_min_use_MIN2_instead
-+#endif
-
- // It is necessary to use templates here. Having normal overloaded
- // functions does not work because it is necessary to provide both 32-
diff --git a/java-openjdk-s390-size_t.patch b/java-openjdk-s390-size_t.patch
new file mode 100644
index 0000000..920624c
--- /dev/null
+++ b/java-openjdk-s390-size_t.patch
@@ -0,0 +1,134 @@
+diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
+--- a/src/hotspot/share/code/codeCache.cpp
++++ b/src/hotspot/share/code/codeCache.cpp
+@@ -405,7 +405,7 @@
+ add_heap(heap);
+
+ // Reserve Space
+- size_t size_initial = MIN2(InitialCodeCacheSize, rs.size());
++ size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
+ size_initial = align_up(size_initial, os::vm_page_size());
+ if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
+ vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
+diff --git a/src/hotspot/share/gc/cms/parNewGeneration.cpp b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp
++++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp
+@@ -200,7 +200,7 @@
+ 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 --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+@@ -2296,7 +2296,7 @@
+ // of things to do) or totally (at the very end).
+ size_t target_size;
+ if (partially) {
+- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
++ target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t)GCDrainStackTargetSize);
+ } else {
+ target_size = 0;
+ }
+diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
++++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+@@ -31,7 +31,7 @@
+ }
+
+ size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
+- size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
++ size_t words_to_scan = MIN2(remaining, (size_t)ObjArrayMarkingStride);
+
+ if (remaining > ObjArrayMarkingStride) {
+ push_array_slice(start_from + ObjArrayMarkingStride);
+diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
++++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+@@ -100,7 +100,7 @@
+ 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/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
++++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp
+@@ -115,7 +115,7 @@
+ const size_t beg_index = size_t(index);
+ assert(beg_index < len || len == 0, "index too large");
+
+- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
++ const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
+ const size_t end_index = beg_index + stride;
+ T* const base = (T*)obj->base();
+ T* const beg = base + beg_index;
+diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
++++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+@@ -905,8 +905,8 @@
+ void PSParallelCompact::initialize_dead_wood_limiter()
+ {
+ const size_t max = 100;
+- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
++ _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
++ _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+ _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 --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
+--- a/src/hotspot/share/gc/shared/plab.cpp
++++ b/src/hotspot/share/gc/shared/plab.cpp
+@@ -32,7 +32,7 @@
+
+ size_t PLAB::min_size() {
+ // Make sure that we return something that is larger than AlignmentReserve
+- return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
++ return align_object_size(MAX2(MinTLABSize / HeapWordSize, (size_t)oopDesc::header_size())) + AlignmentReserve;
+ }
+
+ size_t PLAB::max_size() {
+diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp
+--- a/src/hotspot/share/prims/whitebox.cpp
++++ b/src/hotspot/share/prims/whitebox.cpp
+@@ -1096,7 +1096,7 @@
+ WB_END
+
+ WB_ENTRY(jobject, WB_GetSizeTVMFlag(JNIEnv* env, jobject o, jstring name))
+- uintx result;
++ size_t result;
+ if (GetVMFlag <size_t> (thread, env, name, &result, &CommandLineFlags::size_tAt)) {
+ ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
+ return longBox(thread, env, result);
+diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
+--- a/src/hotspot/share/runtime/arguments.cpp
++++ b/src/hotspot/share/runtime/arguments.cpp
+@@ -1586,7 +1586,7 @@
+ // Increase the code cache size - tiered compiles a lot more.
+ if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
+ FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
+- MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
++ MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)(ReservedCodeCacheSize * 5)));
+ }
+ // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
+ if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
+diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
+--- a/src/hotspot/share/runtime/arguments.hpp
++++ b/src/hotspot/share/runtime/arguments.hpp
+@@ -328,7 +328,7 @@
+ // Value of the conservative maximum heap alignment needed
+ static size_t _conservative_max_heap_alignment;
+
+- static uintx _min_heap_size;
++ static size_t _min_heap_size;
+
+ // -Xrun arguments
+ static AgentLibraryList _libraryList;
diff --git a/java-openjdk.spec b/java-openjdk.spec
index d095e6a..c094174 100644
--- a/java-openjdk.spec
+++ b/java-openjdk.spec
@@ -825,7 +825,7 @@ Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{origin}
Version: %{newjavaver}.%{buildver}
-Release: 1%{?dist}
+Release: 2%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@@ -866,38 +866,47 @@ Source13: TestCryptoLevel.java
# Ensure ECDSA is working
Source14: TestECDSA.java
+############################################
#
# RPM/distribution specific patches
#
+############################################
+
+# NSS via SunPKCS11 Provider (disabled comment
+# due to memory leak).
+Patch1000: enableCommentedOutSystemNss.patch
# Ignore AWTError when assistive technologies are loaded
-Patch1: accessible-toolkit.patch
+Patch1: accessible-toolkit.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
-Patch5: multiple-pkcs11-library-init.patch
-Patch12: system-nss-ec-rh1565658.patch
-Patch13: libjpeg-turbo-1.4-compat.patch
-# follow system wide crypto policy RHBZ#1249083
-Patch14: systemCryptoPolicyPR3183.patch
+Patch2: java-atk-wrapper-security.patch
+Patch3: libjpeg-turbo-1.4-compat.patch
+# Follow system wide crypto policy RHBZ#1249083
+Patch4: RHBZ-1249083-system-crypto-policy-PR3183.patch
+Patch5: RHBZ-1565658-system-nss-SunEC.patch
+#############################################
#
# OpenJDK specific patches
#
-
-# JVM heap size changes for s390 (thanks to aph)
-Patch101: sorted-diff.patch
-Patch104: bootcycle_jobs.patch
-
-
-Patch400: ppc_stack_overflow_fix.patch
-Patch401: aarch64BuildFailure.patch
-
-
-# Non-OpenJDK fixes
-Patch1000: enableCommentedOutSystemNss.patch
+#############################################
+
+# s390 (Zero) build does not bootcycle without this patch
+# Already in JDK-11. Missing backports.
+Patch100: JDK-8201495-s390-java-opts.patch
+# See JDK-8198844. This won't be needed any more in
+# JDK 11+
+Patch101: sorted-diff.patch
+# Type fixing for s390 (Zero). Not upstream.
+Patch102: java-openjdk-s390-size_t.patch
+# bootcycle-images target may run out of ressources
+# due to bad jobs config. Missing backports.
+Patch103: JDK-8201788-bootcycle-images-jobs.patch
+# s390 (Zero) build fix. Pending upstream.
+Patch104: JDK-8201509-s390-atomic_store.patch
+
+# aarch64 slowdebug build fix. Pending upstream
+Patch400: JDK-8200556-aarch64-slowdebug-crash.patch
BuildRequires: autoconf
BuildRequires: automake
@@ -1154,26 +1163,18 @@ fi
sh %{SOURCE12}
pushd %{top_level_dir_name}
%patch1 -p1
+%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-
-# s390 build fixes
-%ifarch s390
-
-%endif
%patch101 -p1
+%patch102 -p1
+%patch103 -p1
%patch104 -p1
-# Zero PPC fixes
-# TODO: propose them upstream
%patch400 -p1
-%patch401 -p1
popd # openjdk
%patch1000
@@ -1728,6 +1729,20 @@ require "copy_jdk_configs.lua"
%changelog
+* Fri Apr 20 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-2
+- Removed unneeded patches:
+ PStack-808293.patch
+ multiple-pkcs11-library-init.patch
+ ppc_stack_overflow_fix.patch
+- Added patches for s390 Zero builds:
+ JDK-8201495-s390-java-opts.patch
+ JDK-8201509-s390-atomic_store.patch
+- Renamed patches for clarity:
+ aarch64BuildFailure.patch => JDK-8200556-aarch64-slowdebug-crash.patch
+ systemCryptoPolicyPR3183.patch => RHBZ-1249083-system-crypto-policy-PR3183.patch
+ system-nss-ec-rh1565658.patch => RHBZ-1565658-system-nss-SunEC.patch
+ bootcycle_jobs.patch => JDK-8201788-bootcycle-images-jobs.patch
+
* Fri Apr 20 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.1.10-1
- updated to security update 1
- jexec unlinked from path
diff --git a/multiple-pkcs11-library-init.patch b/multiple-pkcs11-library-init.patch
deleted file mode 100644
index ade94ee..0000000
--- a/multiple-pkcs11-library-init.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-# HG changeset patch
-# User andrew
-# Date 1352129932 0
-# Node ID e9c857dcb964dbfa5eef3a3590244cb4d999cf7a
-# Parent 1406789608b76d0906881979335d685855f44190
-Allow multiple PKCS11 library initialisation to be a non-critical error.
-
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/Config.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Mon Nov 05 15:38:52 2012 +0000
-@@ -52,6 +52,7 @@
- static final int ERR_HALT = 1;
- static final int ERR_IGNORE_ALL = 2;
- static final int ERR_IGNORE_LIB = 3;
-+ static final int ERR_IGNORE_MULTI_INIT = 4;
-
- // same as allowSingleThreadedModules but controlled via a system property
- // and applied to all providers. if set to false, no SunPKCS11 instances
-@@ -980,6 +981,8 @@
- handleStartupErrors = ERR_IGNORE_LIB;
- } else if (val.equals("halt")) {
- handleStartupErrors = ERR_HALT;
-+ } else if (val.equals("ignoreMultipleInitialisation")) {
-+ handleStartupErrors = ERR_IGNORE_MULTI_INIT;
- } else {
- throw excToken("Invalid value for handleStartupErrors:");
- }
-diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/SunPKCS11.java
---- openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Tue Oct 30 13:05:14 2012 +0000
-+++ openjdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Mon Nov 05 15:38:52 2012 +0000
-@@ -168,26 +168,37 @@
- String nssLibraryDirectory = config.getNssLibraryDirectory();
- String nssSecmodDirectory = config.getNssSecmodDirectory();
- boolean nssOptimizeSpace = config.getNssOptimizeSpace();
-+ int errorHandling = config.getHandleStartupErrors();
-
- if (secmod.isInitialized()) {
- if (nssSecmodDirectory != null) {
- String s = secmod.getConfigDir();
- if ((s != null) &&
- (s.equals(nssSecmodDirectory) == false)) {
-- throw new ProviderException("Secmod directory "
-- + nssSecmodDirectory
-- + " invalid, NSS already initialized with "
-- + s);
-+ String msg = "Secmod directory " + nssSecmodDirectory
-+ + " invalid, NSS already initialized with " + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- if (nssLibraryDirectory != null) {
- String s = secmod.getLibDir();
- if ((s != null) &&
- (s.equals(nssLibraryDirectory) == false)) {
-- throw new ProviderException("NSS library directory "
-+ String msg = "NSS library directory "
- + nssLibraryDirectory
- + " invalid, NSS already initialized with "
-- + s);
-+ + s;
-+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
-+ errorHandling == Config.ERR_IGNORE_ALL) {
-+ throw new UnsupportedOperationException(msg);
-+ } else {
-+ throw new ProviderException(msg);
-+ }
- }
- }
- } else {
diff --git a/ppc_stack_overflow_fix.patch b/ppc_stack_overflow_fix.patch
deleted file mode 100644
index d1b6184..0000000
--- a/ppc_stack_overflow_fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --git a/src/cpu/zero/vm/stack_zero.hpp b/src/cpu/zero/vm/stack_zero.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.hpp
-@@ -99,7 +99,7 @@
- int shadow_pages_size() const {
- return _shadow_pages_size;
- }
-- int abi_stack_available(Thread *thread) const;
-+ ssize_t abi_stack_available(Thread *thread) const;
-
- public:
- void overflow_check(int required_words, TRAPS);
-diff --git a/src/cpu/zero/vm/stack_zero.inline.hpp b/src/cpu/zero/vm/stack_zero.inline.hpp
---- openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-+++ openjdk/src/hotspot/cpu/zero/stack_zero.inline.hpp
-@@ -47,12 +47,12 @@
- // This method returns the amount of ABI stack available for us
- // to use under normal circumstances. Note that the returned
- // value can be negative.
--inline int ZeroStack::abi_stack_available(Thread *thread) const {
-+inline ssize_t ZeroStack::abi_stack_available(Thread *thread) const {
- guarantee(Thread::current() == thread, "should run in the same thread");
-- int stack_used = thread->stack_base() - (address) &stack_used
-+ ssize_t stack_used = thread->stack_base() - (address) &stack_used
- + (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size());
-- int stack_free = thread->stack_size() - stack_used;
-+ ssize_t stack_free = thread->stack_size() - stack_used;
- return stack_free;
- }
-
- #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
-diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
---- openjdk/src/hotspot/os/posix/os_posix.cpp
-+++ openjdk/src/hotspot/os/posix/os_posix.cpp
-@@ -4791,6 +4791,13 @@
-
- _java_thread_min_stack_allowed = align_up(_java_thread_min_stack_allowed, vm_page_size());
- _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed, os_min_stack_allowed);
-+#ifdef ZERO
-+ // If this is Zero, allow at the very minimum one page each for the
-+ // Zero stack and the native stack. This won't make any difference
-+ // for 4k pages, but is significant for large pages.
-+ _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed,
-+ align_size_up((size_t)(JavaThread::stack_guard_zone_size()+JavaThread::stack_shadow_zone_size()+2) * vm_page_size(), vm_page_size());
-+#endif
-
- size_t stack_size_in_bytes = ThreadStackSize * K;
- if (stack_size_in_bytes != 0 &&
diff --git a/system-nss-ec-rh1565658.patch b/system-nss-ec-rh1565658.patch
deleted file mode 100644
index 7b1d4aa..0000000
--- a/system-nss-ec-rh1565658.patch
+++ /dev/null
@@ -1,654 +0,0 @@
-diff --git openjdk/make/autoconf/jdk-options.m4 openjdk/make/autoconf/jdk-options.m4
---- openjdk/make/autoconf/jdk-options.m4
-+++ openjdk/make/autoconf/jdk-options.m4
-@@ -264,9 +264,10 @@
- #
- AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
- [
-+ AC_REQUIRE([LIB_SETUP_MISC_LIBS])
- AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
-
-- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
-+ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
- ENABLE_INTREE_EC=true
- AC_MSG_RESULT([yes])
- else
-diff --git openjdk/make/autoconf/libraries.m4 openjdk/make/autoconf/libraries.m4
---- openjdk/make/autoconf/libraries.m4
-+++ openjdk/make/autoconf/libraries.m4
-@@ -175,6 +175,48 @@
- AC_SUBST(LIBDL)
- LIBS="$save_LIBS"
-
-+ ###############################################################################
-+ #
-+ # Check for the NSS libraries
-+ #
-+
-+ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
-+
-+ # default is bundled
-+ DEFAULT_SYSTEM_NSS=no
-+
-+ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
-+ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
-+ [
-+ case "${enableval}" in
-+ yes)
-+ system_nss=yes
-+ ;;
-+ *)
-+ system_nss=no
-+ ;;
-+ esac
-+ ],
-+ [
-+ system_nss=${DEFAULT_SYSTEM_NSS}
-+ ])
-+ AC_MSG_RESULT([$system_nss])
-+
-+ if test "x${system_nss}" = "xyes"; then
-+ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
-+ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no])
-+ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then
-+ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl";
-+ USE_EXTERNAL_NSS=true
-+ else
-+ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
-+ fi
-+ else
-+ USE_EXTERNAL_NSS=false
-+ fi
-+ AC_SUBST(USE_EXTERNAL_NSS)
-+
-+
- # Deprecated libraries, keep the flags for backwards compatibility
- if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
- BASIC_DEPRECATED_ARG_WITH([dxsdk])
-diff --git openjdk/make/autoconf/spec.gmk.in openjdk/make/autoconf/spec.gmk.in
---- openjdk/make/autoconf/spec.gmk.in
-+++ openjdk/make/autoconf/spec.gmk.in
-@@ -764,6 +764,10 @@
- # Libraries
- #
-
-+USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
-+NSS_LIBS:=@NSS_LIBS@
-+NSS_CFLAGS:=@NSS_CFLAGS@
-+
- USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
- LCMS_CFLAGS:=@LCMS_CFLAGS@
- LCMS_LIBS:=@LCMS_LIBS@
-diff --git openjdk/make/lib/Lib-jdk.crypto.ec.gmk openjdk/make/lib/Lib-jdk.crypto.ec.gmk
---- openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-+++ openjdk/make/lib/Lib-jdk.crypto.ec.gmk
-@@ -29,9 +29,15 @@
-
- ifeq ($(ENABLE_INTREE_EC), true)
-
-- LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
- BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
-
-+ ifeq ($(USE_EXTERNAL_NSS), true)
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+ BUILD_LIBSUNEC_FLAGS += $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC
-+ else
-+ LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
-+ endif
-+
- #
- # On sol-sparc...all libraries are compiled with -xregs=no%appl
- # (set in CFLAGS_REQUIRED_sparc)
-@@ -60,7 +66,7 @@
- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
- LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
- LIBS := $(LIBCXX), \
-- LIBS_linux := -lc, \
-+ LIBS_linux := -lc $(NSS_LIBS), \
- LIBS_solaris := -lc, \
- VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
- RC_FLAGS := $(RC_FLAGS) \
-diff --git openjdk/make/mapfiles/libsunec/mapfile-vers openjdk/make/mapfiles/libsunec/mapfile-vers
---- openjdk/make/mapfiles/libsunec/mapfile-vers
-+++ openjdk/make/mapfiles/libsunec/mapfile-vers
-@@ -31,6 +31,7 @@
- Java_sun_security_ec_ECDSASignature_signDigest;
- Java_sun_security_ec_ECDSASignature_verifySignedDigest;
- Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
-+ Java_sun_security_ec_SunEC_initialize;
- local:
- *;
- };
-diff --git openjdk/src/java.base/unix/native/include/jni_md.h openjdk/src/java.base/unix/native/include/jni_md.h
---- openjdk/src/java.base/unix/native/include/jni_md.h
-+++ openjdk/src/java.base/unix/native/include/jni_md.h
-@@ -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 openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
---- openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-+++ openjdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java
-@@ -61,6 +61,7 @@
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- System.loadLibrary("sunec"); // check for native library
-+ initialize();
- return null;
- }
- });
-@@ -272,4 +273,9 @@
- putService(new ProviderService(this, "KeyAgreement",
- "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS));
- }
-+
-+ /**
-+ * Initialize the native code.
-+ */
-+ private static native void initialize();
- }
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
---- openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp
-@@ -25,7 +25,11 @@
-
- #include <jni.h>
- #include "jni_util.h"
-+#ifdef SYSTEM_NSS
-+#include "ecc_impl.h"
-+#else
- #include "impl/ecc_impl.h"
-+#endif
-
- #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
- #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
-@@ -33,6 +37,13 @@
- #define INVALID_PARAMETER_EXCEPTION \
- "java/security/InvalidParameterException"
- #define KEY_EXCEPTION "java/security/KeyException"
-+#define INTERNAL_ERROR "java/lang/InternalError"
-+
-+#ifdef SYSTEM_NSS
-+#define SYSTEM_UNUSED(x) UNUSED(x)
-+#else
-+#define SYSTEM_UNUSED(x) x
-+#endif
-
- extern "C" {
-
-@@ -55,8 +66,13 @@
- /*
- * Deep free of the ECParams struct
- */
--void FreeECParams(ECParams *ecparams, jboolean freeStruct)
-+void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct))
- {
-+#ifdef SYSTEM_NSS
-+ // Needs to be freed using the matching method to the one
-+ // that allocated it. PR_TRUE means the memory is zeroed.
-+ PORT_FreeArena(ecparams->arena, PR_TRUE);
-+#else
- // Use B_FALSE to free the SECItem->data element, but not the SECItem itself
- // Use B_TRUE to free both
-
-@@ -70,6 +86,7 @@
- SECITEM_FreeItem(&ecparams->curveOID, B_FALSE);
- if (freeStruct)
- free(ecparams);
-+#endif
- }
-
- jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem)
-@@ -95,7 +112,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;
-@@ -127,8 +144,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;
- }
-@@ -175,10 +201,15 @@
- }
- if (privKey) {
- FreeECParams(&privKey->ecParams, false);
-+#ifndef SYSTEM_NSS
-+ // The entire ECPrivateKey is allocated in the arena
-+ // when using system NSS, so only the in-tree version
-+ // needs to clear these manually.
- SECITEM_FreeItem(&privKey->version, B_FALSE);
- SECITEM_FreeItem(&privKey->privateValue, B_FALSE);
- SECITEM_FreeItem(&privKey->publicValue, B_FALSE);
- free(privKey);
-+#endif
- }
-
- if (pSeedBuffer) {
-@@ -196,7 +227,7 @@
- */
- JNIEXPORT jbyteArray
- JNICALL Java_sun_security_ec_ECDSASignature_signDigest
-- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
-+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing)
- {
- jbyte* pDigestBuffer = NULL;
- jint jDigestLength = env->GetArrayLength(digest);
-@@ -255,8 +286,18 @@
- env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer);
-
- // Sign the digest (using the supplied seed)
-+#ifdef SYSTEM_NSS
-+ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength)
-+ != SECSuccess) {
-+ ThrowException(env, KEY_EXCEPTION);
-+ goto cleanup;
-+ }
-+ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item)
-+ != SECSuccess) {
-+#else
- if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item,
- (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) {
-+#endif
- ThrowException(env, KEY_EXCEPTION);
- goto cleanup;
- }
-@@ -305,7 +346,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;
-
-@@ -362,9 +403,10 @@
-
- cleanup:
- {
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (pubKey.publicValue.data)
- env->ReleaseByteArrayElements(publicKey,
-@@ -390,7 +432,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;
-@@ -466,9 +508,10 @@
- env->ReleaseByteArrayElements(publicKey,
- (jbyte *) publicValue_item.data, JNI_ABORT);
-
-- if (params_item.data)
-+ if (params_item.data) {
- env->ReleaseByteArrayElements(encodedParams,
- (jbyte *) params_item.data, JNI_ABORT);
-+ }
-
- if (ecparams)
- FreeECParams(ecparams, true);
-@@ -477,4 +520,28 @@
- return jSecret;
- }
-
-+JNIEXPORT void
-+JNICALL Java_sun_security_ec_SunEC_initialize
-+ (JNIEnv *env, jclass UNUSED(clazz))
-+{
-+#ifdef SYSTEM_NSS
-+ if (SECOID_Init() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+ if (RNG_RNGInit() != SECSuccess) {
-+ ThrowException(env, INTERNAL_ERROR);
-+ }
-+#endif
-+}
-+
-+JNIEXPORT void
-+JNICALL JNI_OnUnload
-+ (JavaVM *vm, void *reserved)
-+{
-+#ifdef SYSTEM_NSS
-+ RNG_RNGShutdown();
-+ SECOID_Shutdown();
-+#endif
-+}
-+
- } /* extern "C" */
-diff --git openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-new file mode 100644
---- /dev/null
-+++ openjdk/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h
-@@ -0,0 +1,298 @@
-+/*
-+ * Copyright (c) 2007, 2017, 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 <vipul.gupta(a)sun.com> and
-+ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories
-+ *
-+ * Last Modified Date from the Original Code: May 2017
-+ *********************************************************************** */
-+
-+#ifndef _ECC_IMPL_H
-+#define _ECC_IMPL_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <sys/types.h>
-+
-+#ifdef SYSTEM_NSS
-+#include <secitem.h>
-+#include <secerr.h>
-+#include <keythi.h>
-+#ifdef LEGACY_NSS
-+#include <softoken.h>
-+#else
-+#include <blapi.h>
-+#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 <stdint.h>
-+#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 <stdlib.h>
-+#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.
-+*/
-+#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)
-+
-+#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 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, int timing);
-+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 --git a/systemCryptoPolicyPR3183.patch b/systemCryptoPolicyPR3183.patch
deleted file mode 100644
index 4efbe9a..0000000
--- a/systemCryptoPolicyPR3183.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-
-# HG changeset patch
-# User andrew
-# Date 1478057514 0
-# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c
-# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a
-PR3183: Support Fedora/RHEL system crypto policy
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java
---- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000
-@@ -43,6 +43,9 @@
- * implementation-specific location, which is typically the properties file
- * {@code conf/security/java.security} in the Java installation directory.
- *
-+ * <p>Additional default values of security properties are read from a
-+ * system-specific location, if available.</p>
-+ *
- * @author Benjamin Renaud
- * @since 1.1
- */
-@@ -52,6 +55,10 @@
- private static final Debug sdebug =
- Debug.getInstance("properties");
-
-+ /* System property file*/
-+ private static final String SYSTEM_PROPERTIES =
-+ "/etc/crypto-policies/back-ends/java.config";
-+
- /* The java.security properties */
- private static Properties props;
-
-@@ -93,6 +100,7 @@
- if (sdebug != null) {
- sdebug.println("reading security properties file: " +
- propFile);
-+ sdebug.println(props.toString());
- }
- } catch (IOException e) {
- if (sdebug != null) {
-@@ -114,6 +122,31 @@
- }
-
- if ("true".equalsIgnoreCase(props.getProperty
-+ ("security.useSystemPropertiesFile"))) {
-+
-+ // now load the system file, if it exists, so its values
-+ // will win if they conflict with the earlier values
-+ try (BufferedInputStream bis =
-+ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) {
-+ props.load(bis);
-+ loadedProps = true;
-+
-+ if (sdebug != null) {
-+ sdebug.println("reading system security properties file " +
-+ SYSTEM_PROPERTIES);
-+ sdebug.println(props.toString());
-+ }
-+ } catch (IOException e) {
-+ if (sdebug != null) {
-+ sdebug.println
-+ ("unable to load security properties from " +
-+ SYSTEM_PROPERTIES);
-+ e.printStackTrace();
-+ }
-+ }
-+ }
-+
-+ if ("true".equalsIgnoreCase(props.getProperty
- ("security.overridePropertiesFile"))) {
-
- String extraPropFile = System.getProperty
-diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security
---- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100
-+++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000
-@@ -276,6 +276,13 @@
- security.overridePropertiesFile=true
-
- #
-+# Determines whether this properties file will be appended to
-+# using the system properties file stored at
-+# /etc/crypto-policies/back-ends/java.config
-+#
-+security.useSystemPropertiesFile=true
-+
-+#
- # Determines the default key and trust manager factory algorithms for
- # the javax.net.ssl package.
- #
6 years
Architecture specific change in rpms/mongodb.git
by githook-noreply@fedoraproject.org
The package rpms/mongodb.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/mongodb.git/commit/?id=930d3b7845....
Change:
+%ifarch ppc64le
Thanks.
Full change:
============
commit 930d3b784589afb1b182f702ecf7963ed85e609a
Author: Marek Skalický <mskalick(a)redhat.com>
Date: Tue Apr 24 14:57:11 2018 +0200
Rebase patches to new mongodb version
diff --git a/mongodb.spec b/mongodb.spec
index 05cfcaa..cc2bb17 100644
--- a/mongodb.spec
+++ b/mongodb.spec
@@ -195,7 +195,9 @@ the MongoDB sources.
%setup -q -n %{MONGO_DISTNAME}
%patch1 -p1
%patch2 -p1
+%ifarch ppc64le
%patch3 -p1
+%endif
# Patch only Fedora specific architectures
%ifnarch %{upstream_arches}
%patch0 -p1
diff --git a/ppc64le-disable-altivec.patch b/ppc64le-disable-altivec.patch
index 85f7d5c..4202141 100644
--- a/ppc64le-disable-altivec.patch
+++ b/ppc64le-disable-altivec.patch
@@ -1,13 +1,13 @@
-diff --git a/src/mongo/db/fts/unicode/byte_vector.h b/src/mongo/db/fts/unicode/byte_vector.h
-index 2404e15dfd..d361a857ff 100644
---- a/src/mongo/db/fts/unicode/byte_vector.h
-+++ b/src/mongo/db/fts/unicode/byte_vector.h
-@@ -33,8 +33,6 @@
- // TODO replace this with #if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION in boost 1.60
- #if defined(_M_AMD64) || defined(__amd64__)
- #include "mongo/db/fts/unicode/byte_vector_sse2.h"
--#elif defined(__powerpc64__)
--#include "mongo/db/fts/unicode/byte_vector_altivec.h"
- #else // Other platforms go above here.
- #undef MONGO_HAVE_FAST_BYTE_VECTOR
- #endif
+diff --git a/src/mongo/db/fts/unicode/byte_vector_altivec.h b/src/mongo/db/fts/unicode/byte_vector_altivec.h
+index f7a07ac074..74a6441c00 100644
+--- a/src/mongo/db/fts/unicode/byte_vector_altivec.h
++++ b/src/mongo/db/fts/unicode/byte_vector_altivec.h
+@@ -98,7 +98,7 @@ public:
+ // big endian by comparison.
+ const Native bits = {120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0};
+
+- return vec_extract(vec_vbpermq(_data, bits), 0);
++ return vec_extract(vec_vbpermq(_data, bits), 1);
+ }
+
+ /**
diff --git a/python3-buildscripts-tests.patch b/python3-buildscripts-tests.patch
index f2d9c79..5bf9f72 100644
--- a/python3-buildscripts-tests.patch
+++ b/python3-buildscripts-tests.patch
@@ -1,5 +1,5 @@
diff --git a/SConstruct b/SConstruct
-index f949f65..78eab69 100644
+index f949f65475..78eab698b9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -383,7 +383,7 @@ win_version_min_choices = {
@@ -47,216 +47,8 @@ index f949f65..78eab69 100644
blacklist_options=["-fsanitize-blacklist=%s" % blackfile
for blackfile in blackfiles
if os.stat(blackfile.path).st_size != 0]
-diff --git a/buildscripts/aggregate_tracefiles.py b/buildscripts/aggregate_tracefiles.py
-index 8f1db78..0b4bfd2 100644
---- a/buildscripts/aggregate_tracefiles.py
-+++ b/buildscripts/aggregate_tracefiles.py
-@@ -16,7 +16,7 @@ def aggregate(inputs, output):
-
- args += ['-o', output]
-
-- print ' '.join(args)
-+ print(' '.join(args))
-
- return subprocess.call(args)
-
-diff --git a/buildscripts/buildlogger.py b/buildscripts/buildlogger.py
-index 163c10a..fd2c095 100644
---- a/buildscripts/buildlogger.py
-+++ b/buildscripts/buildlogger.py
-@@ -45,8 +45,8 @@ import subprocess
- import sys
- import time
- import traceback
--import urllib2
--import utils
-+import urllib.request, urllib.error, urllib.parse
-+from . import utils
-
- # suppress deprecation warnings that happen when
- # we import the 'buildbot.tac' file below
-@@ -82,7 +82,7 @@ for path in possible_paths:
- if os.path.isfile(credentials_path):
- credentials = {}
- try:
-- execfile(credentials_path, credentials, credentials)
-+ exec(compile(open(credentials_path).read(), credentials_path, 'exec'), credentials, credentials)
- username = credentials.get('slavename', credentials.get('username'))
- password = credentials.get('passwd', credentials.get('password'))
- break
-@@ -94,14 +94,14 @@ URL_ROOT = os.environ.get('BUILDLOGGER_URL', 'http://buildlogs.mongodb.org/')
- TIMEOUT_SECONDS = 10
- socket.setdefaulttimeout(TIMEOUT_SECONDS)
-
--auth_handler = urllib2.HTTPBasicAuthHandler()
-+auth_handler = urllib.request.HTTPBasicAuthHandler()
- auth_handler.add_password(
- realm='buildlogs',
- uri=URL_ROOT,
- user=username,
- passwd=password)
-
--url_opener = urllib2.build_opener(auth_handler, urllib2.HTTPErrorProcessor())
-+url_opener = urllib.request.build_opener(auth_handler, urllib2.HTTPErrorProcessor())
-
- def url(endpoint):
- if not endpoint.endswith('/'):
-@@ -115,10 +115,10 @@ def post(endpoint, data, headers=None):
- headers = headers or {}
- headers.update({'Content-Type': 'application/json; charset=utf-8'})
-
-- req = urllib2.Request(url=url(endpoint), data=data, headers=headers)
-+ req = urllib.request.Request(url=url(endpoint), data=data, headers=headers)
- try:
- response = url_opener.open(req)
-- except urllib2.URLError:
-+ except urllib.error.URLError:
- import traceback
- traceback.print_exc(file=sys.stderr)
- sys.stderr.flush()
-@@ -145,7 +145,7 @@ def traceback_to_stderr(func):
- def wrapper(*args, **kwargs):
- try:
- return func(*args, **kwargs)
-- except urllib2.HTTPError, err:
-+ except urllib.error.HTTPError as err:
- sys.stderr.write('error: HTTP code %d\n----\n' % err.code)
- if hasattr(err, 'hdrs'):
- for k, v in err.hdrs.items():
-diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py
-index a78c905..2255e97 100644
---- a/buildscripts/burn_in_tests.py
-+++ b/buildscripts/burn_in_tests.py
-@@ -16,7 +16,7 @@ import re
- import requests
- import shlex
- import sys
--import urlparse
-+import urllib.parse
- import yaml
-
-
-@@ -114,7 +114,7 @@ def find_last_activated_task(revisions, variant, branch_name):
- evg_cfg = read_evg_config()
- if evg_cfg is not None and "api_server_host" in evg_cfg:
- api_server = "{url.scheme}://{url.netloc}".format(
-- url=urlparse.urlparse(evg_cfg["api_server_host"]))
-+ url=urllib.parse.urlparse(evg_cfg["api_server_host"]))
- else:
- api_server = API_SERVER_DEFAULT
-
-@@ -161,7 +161,7 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
- # commit among 'revs_to_check' that's been activated in Evergreen. We handle this by
- # only considering tests changed in the current commit.
- last_activated = "HEAD"
-- print "Comparing current branch against", last_activated
-+ print("Comparing current branch against", last_activated)
- revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
- base_commit = last_activated
- else:
-@@ -169,10 +169,10 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
-
- revision_count = len(revisions)
- if revision_count > max_revisions:
-- print "There are too many revisions included (%d)." % revision_count, \
-+ print("There are too many revisions included (%d)." % revision_count, \
- "This is likely because your base branch is not " + branch_name + ".", \
- "You can allow us to review more than 25 revisions by using", \
-- "the --maxRevisions option."
-+ "the --maxRevisions option.")
- return changed_tests
-
- changed_files = callo(["git", "diff", "--name-only", base_commit]).splitlines()
-@@ -279,7 +279,7 @@ def create_task_list(evergreen_conf, buildvariant, suites, exclude_tasks):
-
- evg_buildvariant = evergreen_conf.get_variant(buildvariant)
- if not evg_buildvariant:
-- print "Buildvariant", buildvariant, "not found in", evergreen_conf.path
-+ print("Buildvariant", buildvariant, "not found in", evergreen_conf.path)
- sys.exit(1)
-
- # Find all the buildvariant task's resmoke_args.
-@@ -366,9 +366,9 @@ def main():
- evergreen_conf = evergreen.EvergreenProjectConfig(values.evergreen_file)
-
- if values.buildvariant is None:
-- print "Option buildVariant must be specified to find changed tests.\n", \
-+ print("Option buildVariant must be specified to find changed tests.\n", \
- "Select from the following: \n" \
-- "\t", "\n\t".join(sorted(evergreen_conf.variant_names))
-+ "\t", "\n\t".join(sorted(evergreen_conf.variant_names)))
- sys.exit(1)
-
- changed_tests = find_changed_tests(values.branch,
-@@ -380,7 +380,7 @@ def main():
- changed_tests = filter_tests(changed_tests, exclude_tests)
- # If there are no changed tests, exit cleanly.
- if not changed_tests:
-- print "No new or modified tests found."
-+ print("No new or modified tests found.")
- _write_report_file({}, values.test_list_outfile)
- sys.exit(0)
- suites = resmokelib.parser.get_suites(values, changed_tests)
-@@ -403,7 +403,7 @@ def main():
- try:
- subprocess.check_call(resmoke_cmd, shell=False)
- except subprocess.CalledProcessError as err:
-- print "Resmoke returned an error with task:", task
-+ print("Resmoke returned an error with task:", task)
- _save_report_data(test_results, values.report_file, task)
- _write_report_file(test_results, values.report_file)
- sys.exit(err.returncode)
-diff --git a/buildscripts/ciconfig/evergreen.py b/buildscripts/ciconfig/evergreen.py
-index 9a4f7a9..9cb6c3f 100644
---- a/buildscripts/ciconfig/evergreen.py
-+++ b/buildscripts/ciconfig/evergreen.py
-@@ -30,7 +30,7 @@ class EvergreenProjectConfig(object):
- @property
- def task_names(self):
- """The list of task names."""
-- return self._tasks_by_name.keys()
-+ return list(self._tasks_by_name.keys())
-
- def get_task(self, task_name):
- """Return the task with the given name as a Task instance."""
-@@ -52,7 +52,7 @@ class EvergreenProjectConfig(object):
- @property
- def variant_names(self):
- """The list of build variant names."""
-- return self._variants_by_name.keys()
-+ return list(self._variants_by_name.keys())
-
- def get_variant(self, variant_name):
- """Return the variant with the given name as a Variant instance."""
-diff --git a/buildscripts/ciconfig/tags.py b/buildscripts/ciconfig/tags.py
-index 418d0e3..bfdb25c 100644
---- a/buildscripts/ciconfig/tags.py
-+++ b/buildscripts/ciconfig/tags.py
-@@ -12,7 +12,7 @@ import yaml
-
- # Setup to preserve order in yaml.dump, see https://stackoverflow.com/a/8661021
- def _represent_dict_order(self, data):
-- return self.represent_mapping("tag:yaml.org,2002:map", data.items())
-+ return self.represent_mapping("tag:yaml.org,2002:map", list(data.items()))
-
- yaml.add_representer(collections.OrderedDict, _represent_dict_order)
- # End setup
-@@ -55,11 +55,11 @@ class TagsConfig(object):
-
- def get_test_kinds(self):
- """List the test kinds."""
-- return self._conf.keys()
-+ return list(self._conf.keys())
-
- def get_test_patterns(self, test_kind):
- """List the test patterns under 'test_kind'."""
-- return getdefault(self._conf, test_kind, {}).keys()
-+ return list(getdefault(self._conf, test_kind, {}).keys())
-
- def get_tags(self, test_kind, test_pattern):
- """List the tags under 'test_kind' and 'test_pattern'."""
diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py
-index cf9884d..c0f4140 100755
+index cf9884d8b1..c0f4140e59 100755
--- a/buildscripts/clang_format.py
+++ b/buildscripts/clang_format.py
@@ -20,7 +20,7 @@ import sys
@@ -291,21 +83,8 @@ index cf9884d..c0f4140 100755
else:
repo.commit(["--all", "--amend", "--no-edit"])
-diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py
-index b599dc8..485109c 100644
---- a/buildscripts/cleanbb.py
-+++ b/buildscripts/cleanbb.py
-@@ -79,7 +79,7 @@ def tryToRemove(path):
-
- def cleanup( root , nokill ):
- if nokill:
-- print "nokill requested, not killing anybody"
-+ print("nokill requested, not killing anybody")
- else:
- if killprocs( root=root ) > 0:
- time.sleep(3)
diff --git a/buildscripts/cpplint.py b/buildscripts/cpplint.py
-index c6aa51b..ed9cdb3 100755
+index 6979cbcd4e..bc9ff038fd 100755
--- a/buildscripts/cpplint.py
+++ b/buildscripts/cpplint.py
@@ -835,7 +835,7 @@ class _CppLintState(object):
@@ -326,7 +105,7 @@ index c6aa51b..ed9cdb3 100755
char = line[i]
if char in '([{':
# Found start of parenthesized expression, push to expression stack
-@@ -1687,7 +1687,7 @@ def CheckForCopyright(filename, lines, error):
+@@ -1681,7 +1681,7 @@ def CheckForCopyright(filename, lines, error):
# We'll say it should occur by line 10. Don't forget there's a
# dummy line at the front.
@@ -335,7 +114,7 @@ index c6aa51b..ed9cdb3 100755
if re.search(r'Copyright', lines[line], re.I): break
else: # means no copyright line was found
error(filename, 0, 'legal/copyright', 5,
-@@ -1838,7 +1838,7 @@ def CheckForBadCharacters(filename, lines, error):
+@@ -1832,7 +1832,7 @@ def CheckForBadCharacters(filename, lines, error):
error: The function to call with any errors found.
"""
for linenum, line in enumerate(lines):
@@ -344,7 +123,7 @@ index c6aa51b..ed9cdb3 100755
error(filename, linenum, 'readability/utf8', 5,
'Line contains invalid UTF-8 (or Unicode replacement character).')
if '\0' in line:
-@@ -2884,7 +2884,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum,
+@@ -2878,7 +2878,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum,
if starting_func:
body_found = False
@@ -353,7 +132,7 @@ index c6aa51b..ed9cdb3 100755
start_line = lines[start_linenum]
joined_line += ' ' + start_line.lstrip()
if Search(r'(;|})', start_line): # Declarations and trivial functions
-@@ -3361,7 +3361,7 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error):
+@@ -3355,7 +3355,7 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error):
trailing_text = ''
if endpos > -1:
trailing_text = endline[endpos:]
@@ -362,7 +141,7 @@ index c6aa51b..ed9cdb3 100755
min(endlinenum + 3, clean_lines.NumLines() - 1)):
trailing_text += clean_lines.elided[offset]
if not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text):
-@@ -3530,7 +3530,7 @@ def IsRValueType(clean_lines, nesting_state, linenum, column):
+@@ -3524,7 +3524,7 @@ def IsRValueType(clean_lines, nesting_state, linenum, column):
# Look for the previous 'for(' in the previous lines.
before_text = match_symbol.group(1)
@@ -371,7 +150,7 @@ index c6aa51b..ed9cdb3 100755
before_text = clean_lines.elided[i] + before_text
if Search(r'for\s*\([^{};]*$', before_text):
# This is the condition inside a for-loop
-@@ -3657,12 +3657,12 @@ def IsRValueAllowed(clean_lines, linenum):
+@@ -3651,12 +3651,12 @@ def IsRValueAllowed(clean_lines, linenum):
True if line is within the region where RValue references are allowed.
"""
# Allow region marked by PUSH/POP macros
@@ -386,7 +165,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[j]
if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line):
return line.endswith('POP')
-@@ -4142,7 +4142,7 @@ def CheckCheck(filename, clean_lines, linenum, error):
+@@ -4136,7 +4136,7 @@ def CheckCheck(filename, clean_lines, linenum, error):
expression = lines[linenum][start_pos + 1:end_pos - 1]
else:
expression = lines[linenum][start_pos + 1:]
@@ -395,7 +174,7 @@ index c6aa51b..ed9cdb3 100755
expression += lines[i]
expression += last_line[0:end_pos - 1]
-@@ -4270,7 +4270,7 @@ def GetLineWidth(line):
+@@ -4264,7 +4264,7 @@ def GetLineWidth(line):
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
@@ -404,7 +183,7 @@ index c6aa51b..ed9cdb3 100755
width = 0
for uc in unicodedata.normalize('NFC', line):
if unicodedata.east_asian_width(uc) in ('W', 'F'):
-@@ -4623,7 +4623,7 @@ def _GetTextInside(text, start_pattern):
+@@ -4617,7 +4617,7 @@ def _GetTextInside(text, start_pattern):
# Give opening punctuations to get the matching close-punctuations.
matching_punctuation = {'(': ')', '{': '}', '[': ']'}
@@ -413,7 +192,7 @@ index c6aa51b..ed9cdb3 100755
# Find the position to start extracting text.
match = re.search(start_pattern, text, re.M)
-@@ -4949,7 +4949,7 @@ def IsDerivedFunction(clean_lines, linenum):
+@@ -4943,7 +4943,7 @@ def IsDerivedFunction(clean_lines, linenum):
virt-specifier.
"""
# Scan back a few lines for start of current function
@@ -422,7 +201,7 @@ index c6aa51b..ed9cdb3 100755
match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i])
if match:
# Look for "override" after the matching closing parenthesis
-@@ -4970,7 +4970,7 @@ def IsInitializerList(clean_lines, linenum):
+@@ -4964,7 +4964,7 @@ def IsInitializerList(clean_lines, linenum):
True if current line appears to be inside constructor initializer
list, False otherwise.
"""
@@ -431,7 +210,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[i]
if i == linenum:
remove_function_body = Match(r'^(.*)\{\s*$', line)
-@@ -5066,7 +5066,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5060,7 +5060,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# Found the matching < on an earlier line, collect all
# pieces up to current line.
line = ''
@@ -440,7 +219,7 @@ index c6aa51b..ed9cdb3 100755
line += clean_lines.elided[i].strip()
# Check for non-const references in function parameters. A single '&' may
-@@ -5090,7 +5090,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5084,7 +5084,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# appear inside the second set of parentheses on the current line as
# opposed to the first set.
if linenum > 0:
@@ -449,7 +228,7 @@ index c6aa51b..ed9cdb3 100755
previous_line = clean_lines.elided[i]
if not Search(r'[),]\s*$', previous_line):
break
-@@ -5121,7 +5121,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5115,7 +5115,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# Don't see a whitelisted function on this line. Actually we
# didn't see any function name on this line, so this is likely a
# multi-line parameter list. Try a bit harder to catch this case.
@@ -458,7 +237,7 @@ index c6aa51b..ed9cdb3 100755
if (linenum > i and
Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
return
-@@ -5283,7 +5283,7 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
+@@ -5277,7 +5277,7 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
# Try expanding current context to see if we one level of
# parentheses inside a macro.
if linenum > 0:
@@ -467,7 +246,7 @@ index c6aa51b..ed9cdb3 100755
context = clean_lines.elided[i] + context
if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', context):
return False
-@@ -5540,7 +5540,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
+@@ -5534,7 +5534,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
required = {} # A map of header name to linenumber and the template entity.
# Example of required: { '<functional>': (1219, 'less<>') }
@@ -476,7 +255,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[linenum]
if not line or line[0] == '#':
continue
-@@ -5589,7 +5589,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
+@@ -5583,7 +5583,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
# include_dict is modified during iteration, so we iterate over a copy of
# the keys.
@@ -485,7 +264,7 @@ index c6aa51b..ed9cdb3 100755
for header in header_keys:
(same_module, common_path) = FilesBelongToSameModule(abs_filename, header)
fullpath = common_path + header
-@@ -5684,7 +5684,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
+@@ -5678,7 +5678,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
end_col = -1
end_line = -1
start_col = len(virtual.group(1))
@@ -494,7 +273,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[start_line][start_col:]
parameter_list = Match(r'^([^(]*)\(', line)
if parameter_list:
-@@ -5699,7 +5699,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
+@@ -5693,7 +5693,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
# Look for "override" or "final" after the parameter list
# (possibly on the next few lines).
@@ -503,7 +282,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[i][end_col:]
match = Search(r'\b(override|final)\b', line)
if match:
-@@ -5926,7 +5926,7 @@ def ProcessFileData(filename, file_extension, lines, error,
+@@ -5920,7 +5920,7 @@ def ProcessFileData(filename, file_extension, lines, error,
RemoveMultiLineComments(filename, lines, error)
clean_lines = CleansedLines(lines)
@@ -513,7 +292,7 @@ index c6aa51b..ed9cdb3 100755
include_state, function_state, nesting_state, error,
extra_check_functions)
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py
-index cc46789..7351e6a 100755
+index cc46789907..7351e6a12e 100755
--- a/buildscripts/errorcodes.py
+++ b/buildscripts/errorcodes.py
@@ -5,13 +5,16 @@
@@ -606,7 +385,7 @@ index cc46789..7351e6a 100755
diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py
-index c1ab04f..d5c6aef 100755
+index c1ab04fbab..d5c6aef4fc 100755
--- a/buildscripts/eslint.py
+++ b/buildscripts/eslint.py
@@ -18,7 +18,7 @@ import sys
@@ -627,92 +406,8 @@ index c1ab04f..d5c6aef 100755
eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(platform=platform, arch=arch)
extract_eslint(temp_tar_file, eslint_distfile)
-diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py
-index 98dc66d..9538c29 100644
---- a/buildscripts/gdb/mongo_lock.py
-+++ b/buildscripts/gdb/mongo_lock.py
-@@ -231,8 +231,8 @@ def find_mutex_holder(graph, thread_dict, show):
- mutex_waiter_lwpid))
- if graph:
- graph.add_edge(Thread(mutex_waiter_id, mutex_waiter_lwpid),
-- Lock(long(mutex_value), "Mutex"))
-- graph.add_edge(Lock(long(mutex_value), "Mutex"), Thread(mutex_holder_id, mutex_holder))
-+ Lock(int(mutex_value), "Mutex"))
-+ graph.add_edge(Lock(int(mutex_value), "Mutex"), Thread(mutex_holder_id, mutex_holder))
-
-
- def find_lock_manager_holders(graph, thread_dict, show):
-@@ -262,8 +262,8 @@ def find_lock_manager_holders(graph, thread_dict, show):
- lock_head, lock_request["mode"], lock_thread_id, lock_thread_lwpid) +
- " waited on by thread 0x{:x} (LWP {})".format(thread_dict[lwpid], lwpid))
- if graph:
-- graph.add_edge(Thread(thread_dict[lwpid], lwpid), Lock(long(lock_head), "MongoDB lock"))
-- graph.add_edge(Lock(long(lock_head), "MongoDB lock"),
-+ graph.add_edge(Thread(thread_dict[lwpid], lwpid), Lock(int(lock_head), "MongoDB lock"))
-+ graph.add_edge(Lock(int(lock_head), "MongoDB lock"),
- Thread(lock_thread_id, lock_thread_lwpid))
- lock_request_ptr = lock_request["next"]
-
-diff --git a/buildscripts/hang_analyzer.py b/buildscripts/hang_analyzer.py
-index d554e67..0cca026 100755
---- a/buildscripts/hang_analyzer.py
-+++ b/buildscripts/hang_analyzer.py
-@@ -12,7 +12,7 @@ A prototype hang analyzer for Evergreen integration to help investigate test tim
- Supports Linux, MacOS X, Solaris, and Windows.
- """
-
--import StringIO
-+import io
- import csv
- import glob
- import itertools
-@@ -177,7 +177,7 @@ class WindowsProcessList(object):
-
- ret = callo([ps, "/FO", "CSV"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b)
-
- p = [[int(row[1]), row[0]] for row in csvReader if row[1] != "PID"]
-@@ -270,7 +270,7 @@ class DarwinProcessList(object):
-
- ret = callo([ps, "-axco", "pid,comm"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), row[1]] for row in csvReader if row[0] != "PID"]
-@@ -411,7 +411,7 @@ class LinuxProcessList(object):
-
- ret = callo([ps, "-eo", "pid,args"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), os.path.split(row[1])[1]] for row in csvReader if row[0] != "PID"]
-@@ -433,7 +433,7 @@ class SolarisProcessList(object):
-
- ret = callo([ps, "-eo", "pid,args"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), os.path.split(row[1])[1]] for row in csvReader if row[0] != "PID"]
-@@ -545,7 +545,7 @@ def signal_process(logger, pid, signalnum):
-
- logger.info("Waiting for process to report")
- time.sleep(5)
-- except OSError, e:
-+ except OSError as e:
- logger.error("Hit OS error trying to signal process: %s" % str(e))
-
- except AttributeError:
diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py
-index 354acca..9612e39 100644
+index 354acca974..9612e39305 100644
--- a/buildscripts/idl/idl/binder.py
+++ b/buildscripts/idl/idl/binder.py
@@ -608,7 +608,7 @@ def _validate_enum_int(ctxt, idl_enum):
@@ -725,7 +420,7 @@ index 354acca..9612e39 100644
if valid_int != int_values_set:
ctxt.add_enum_non_continuous_range_error(idl_enum, idl_enum.name)
diff --git a/buildscripts/idl/idl/bson.py b/buildscripts/idl/idl/bson.py
-index 214b67a..b84421d 100644
+index 214b67a7bf..b84421d657 100644
--- a/buildscripts/idl/idl/bson.py
+++ b/buildscripts/idl/idl/bson.py
@@ -141,7 +141,7 @@ def cpp_bson_type_name(name):
@@ -738,7 +433,7 @@ index 214b67a..b84421d 100644
def is_valid_bindata_subtype(name):
diff --git a/buildscripts/idl/idl/cpp_types.py b/buildscripts/idl/idl/cpp_types.py
-index aafcf87..e989664 100644
+index aafcf87224..e989664eee 100644
--- a/buildscripts/idl/idl/cpp_types.py
+++ b/buildscripts/idl/idl/cpp_types.py
@@ -28,6 +28,7 @@ from . import writer
@@ -776,7 +471,7 @@ index aafcf87..e989664 100644
# type: (ast.Field) -> None
"""Construct a BsonCppTypeBase."""
diff --git a/buildscripts/idl/idl/enum_types.py b/buildscripts/idl/idl/enum_types.py
-index 3caed6f..f17c926 100644
+index 3caed6f67d..f17c926748 100644
--- a/buildscripts/idl/idl/enum_types.py
+++ b/buildscripts/idl/idl/enum_types.py
@@ -29,11 +29,11 @@ from . import common
@@ -813,7 +508,7 @@ index 3caed6f..f17c926 100644
# type: (Union[syntax.Enum,ast.Enum]) -> None
super(_EnumTypeString, self).__init__(idl_enum)
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
-index 9f591ec..8f97abf 100644
+index 9f591eccc4..8f97abf28c 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -33,6 +33,7 @@ from . import enum_types
@@ -860,7 +555,7 @@ index 9f591ec..8f97abf 100644
def generate_code(spec, output_base_dir, header_file_name, source_file_name):
diff --git a/buildscripts/idl/idl/parser.py b/buildscripts/idl/idl/parser.py
-index fd0af9b..ac36a3a 100644
+index fd0af9b144..ac36a3a280 100644
--- a/buildscripts/idl/idl/parser.py
+++ b/buildscripts/idl/idl/parser.py
@@ -30,6 +30,7 @@ from . import common
@@ -885,7 +580,7 @@ index fd0af9b..ac36a3a 100644
# type: () -> None
"""Construct a ImportResolver."""
diff --git a/buildscripts/idl/idl/struct_types.py b/buildscripts/idl/idl/struct_types.py
-index 9e2a950..cd46e7c 100644
+index 9e2a9504ac..cd46e7c0ff 100644
--- a/buildscripts/idl/idl/struct_types.py
+++ b/buildscripts/idl/idl/struct_types.py
@@ -23,6 +23,7 @@ from . import ast
@@ -910,7 +605,7 @@ index 9e2a950..cd46e7c 100644
def get_constructor_method(self):
# type: () -> MethodInfo
diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py
-index 056d2e9..ff9a395 100644
+index 056d2e9dc3..ff9a3953db 100644
--- a/buildscripts/idl/idl/syntax.py
+++ b/buildscripts/idl/idl/syntax.py
@@ -82,7 +82,7 @@ def _item_and_type(dic):
@@ -923,7 +618,7 @@ index 056d2e9..ff9a395 100644
class SymbolTable(object):
diff --git a/buildscripts/idl/tests/test_binder.py b/buildscripts/idl/tests/test_binder.py
-index 5502b69..b0f4ba4 100644
+index 5502b69d36..b0f4ba4269 100644
--- a/buildscripts/idl/tests/test_binder.py
+++ b/buildscripts/idl/tests/test_binder.py
@@ -72,7 +72,7 @@ class TestBinder(testcase.IDLTestcase):
@@ -936,7 +631,7 @@ index 5502b69..b0f4ba4 100644
def test_type_positive(self):
diff --git a/buildscripts/lint.py b/buildscripts/lint.py
-index d4061a9..b1ca5b6 100644
+index d4061a9b04..b1ca5b6169 100644
--- a/buildscripts/lint.py
+++ b/buildscripts/lint.py
@@ -2,8 +2,8 @@
@@ -951,7 +646,7 @@ index d4061a9..b1ca5b6 100644
class CheckForConfigH:
def __init__(self):
diff --git a/buildscripts/linter/base.py b/buildscripts/linter/base.py
-index ae78d52..7988876 100644
+index ae78d52066..7988876c98 100644
--- a/buildscripts/linter/base.py
+++ b/buildscripts/linter/base.py
@@ -5,12 +5,11 @@ from __future__ import print_function
@@ -970,7 +665,7 @@ index ae78d52..7988876 100644
# type: (str, str) -> None
"""
diff --git a/buildscripts/linter/git.py b/buildscripts/linter/git.py
-index edde6d0..4680e2f 100644
+index edde6d0a49..4680e2f5fd 100644
--- a/buildscripts/linter/git.py
+++ b/buildscripts/linter/git.py
@@ -175,7 +175,7 @@ def get_files_to_check_from_patch(patches, filter_function):
@@ -983,7 +678,7 @@ index edde6d0..4680e2f 100644
candidates = [check.match(line).group(1) for line in lines if check.match(line)]
diff --git a/buildscripts/linter/parallel.py b/buildscripts/linter/parallel.py
-index 0648bfb..361da0c 100644
+index 0648bfb16e..361da0c559 100644
--- a/buildscripts/linter/parallel.py
+++ b/buildscripts/linter/parallel.py
@@ -2,7 +2,12 @@
@@ -1018,258 +713,8 @@ index 0648bfb..361da0c 100644
# if the queue is empty, exit the worker thread
pp_event.set()
return
-diff --git a/buildscripts/make_archive.py b/buildscripts/make_archive.py
-index 2671fa5..91e2bf0 100755
---- a/buildscripts/make_archive.py
-+++ b/buildscripts/make_archive.py
-@@ -95,14 +95,14 @@ def make_tar_archive(opts):
- enclosing_file_directory = os.path.dirname(temp_file_location)
- if not os.path.exists(enclosing_file_directory):
- os.makedirs(enclosing_file_directory)
-- print "copying %s => %s" % (input_filename, temp_file_location)
-+ print("copying %s => %s" % (input_filename, temp_file_location))
- if os.path.isdir(input_filename):
- shutil.copytree(input_filename, temp_file_location)
- else:
- shutil.copy2(input_filename, temp_file_location)
- tar_command.append(preferred_filename)
-
-- print " ".join(tar_command)
-+ print(" ".join(tar_command))
- # execute the full tar command
- run_directory = os.path.join(os.getcwd(), enclosing_archive_directory)
- proc = Popen(tar_command, stdout=PIPE, stderr=STDOUT, bufsize=0, cwd=run_directory)
-@@ -165,7 +165,7 @@ def parse_options(args):
- opts.transformations = [
- xform.replace(os.path.altsep or os.path.sep, os.path.sep).split('=', 1)
- for xform in opts.transformations]
-- except Exception, e:
-+ except Exception as e:
- parser.error(e)
-
- return opts
-diff --git a/buildscripts/make_vcxproj.py b/buildscripts/make_vcxproj.py
-index e4c2d7a..693352f 100644
---- a/buildscripts/make_vcxproj.py
-+++ b/buildscripts/make_vcxproj.py
-@@ -241,12 +241,12 @@ class ProjFileGenerator(object):
-
- def main():
- if len(sys.argv) != 2:
-- print r"Usage: python buildscripts\make_vcxproj.py FILE_NAME"
-+ print(r"Usage: python buildscripts\make_vcxproj.py FILE_NAME")
- return
-
- with ProjFileGenerator(sys.argv[1]) as projfile:
-- with open("compile_commands.json", "rb") as sjh:
-- contents = sjh.read().decode('utf-8')
-+ with open("compile_commands.json", "r") as sjh:
-+ contents = sjh.read()
- commands = json.loads(contents)
-
- for command in commands:
-diff --git a/buildscripts/mongosymb.py b/buildscripts/mongosymb.py
-index 4da0535..b0aba4d 100755
---- a/buildscripts/mongosymb.py
-+++ b/buildscripts/mongosymb.py
-@@ -36,7 +36,7 @@ def symbolize_frames(trace_doc, dbg_path_resolver, symbolizer_path=None, dsym_hi
- """Makes a map from binary load address to description of library from the somap, which is
- a list of dictionaries describing individual loaded libraries.
- """
-- return { so_entry["b"] : so_entry for so_entry in somap_list if so_entry.has_key("b") }
-+ return { so_entry["b"] : so_entry for so_entry in somap_list if "b" in so_entry }
-
- base_addr_map = make_base_addr_map(trace_doc["processInfo"]["somap"])
-
-@@ -50,7 +50,7 @@ def symbolize_frames(trace_doc, dbg_path_resolver, symbolizer_path=None, dsym_hi
- addr_base = frame["b"]
- else:
- addr_base = soinfo.get("vmaddr", "0")
-- addr = long(addr_base, 16) + long(frame["o"], 16)
-+ addr = int(addr_base, 16) + int(frame["o"], 16)
- # addr currently points to the return address which is the one *after* the call. x86 is
- # variable length so going backwards is difficult. However llvm-symbolizer seems to do the
- # right thing if we just subtract 1 byte here. This has the downside of also adjusting the
-diff --git a/buildscripts/msitrim.py b/buildscripts/msitrim.py
-index 45ca8d4..b5781ed 100644
---- a/buildscripts/msitrim.py
-+++ b/buildscripts/msitrim.py
-@@ -29,7 +29,7 @@ def exec_update(query, column, value):
- view.Close()
-
-
--print "Trimming MSI"
-+print("Trimming MSI")
-
- db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT)
-
-diff --git a/buildscripts/packager-enterprise.py b/buildscripts/packager-enterprise.py
-index 8629be1..202a676 100755
---- a/buildscripts/packager-enterprise.py
-+++ b/buildscripts/packager-enterprise.py
-@@ -30,7 +30,7 @@ import argparse
- import errno
- import getopt
- from glob import glob
--import packager
-+from . import packager
- import os
- import re
- import shutil
-@@ -39,7 +39,7 @@ import subprocess
- import sys
- import tempfile
- import time
--import urlparse
-+import urllib.parse
-
- # The MongoDB names for the architectures we support.
- ARCH_CHOICES=["x86_64", "ppc64le", "s390x", "arm64"]
-@@ -153,7 +153,7 @@ def main(argv):
- if prefix is None:
- prefix=tempfile.mkdtemp()
-
-- print "Working in directory %s" % prefix
-+ print("Working in directory %s" % prefix)
-
- os.chdir(prefix)
- try:
-@@ -210,7 +210,7 @@ def unpack_binaries_into(build_os, arch, spec, where):
- os.rename("%s/%s" % (release_dir, releasefile), releasefile)
- os.rmdir(release_dir)
- except Exception:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- os.chdir(rootdir)
- raise exc
- os.chdir(rootdir)
-@@ -226,7 +226,7 @@ def make_package(distro, build_os, arch, spec, srcdir):
- # directory, so the debian directory is needed in all cases (and
- # innocuous in the debianoids' sdirs).
- for pkgdir in ["debian", "rpm"]:
-- print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
-+ print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
- # FIXME: sh-dash-cee is bad. See if tarfile can do this.
- packager.sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
- # Splat the binaries and snmp files under sdir. The "build" stages of the
-@@ -304,7 +304,7 @@ def move_repos_into_place(src, dst):
- os.mkdir(dname)
- break
- except OSError:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -324,7 +324,7 @@ def move_repos_into_place(src, dst):
- os.symlink(dname, tmpnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -342,7 +342,7 @@ def move_repos_into_place(src, dst):
- os.symlink(os.readlink(dst), oldnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-diff --git a/buildscripts/packager.py b/buildscripts/packager.py
-index c821da9..19d34b3 100755
---- a/buildscripts/packager.py
-+++ b/buildscripts/packager.py
-@@ -343,7 +343,7 @@ def main(argv):
- prefix = args.prefix
- if prefix is None:
- prefix = tempfile.mkdtemp()
-- print "Working in directory %s" % prefix
-+ print("Working in directory %s" % prefix)
-
- os.chdir(prefix)
- try:
-@@ -382,14 +382,14 @@ def crossproduct(*seqs):
-
- def sysassert(argv):
- """Run argv and assert that it exited with status 0."""
-- print "In %s, running %s" % (os.getcwd(), " ".join(argv))
-+ print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
- sys.stdout.flush()
- sys.stderr.flush()
- assert(subprocess.Popen(argv).wait()==0)
-
- def backtick(argv):
- """Run argv and return its output string."""
-- print "In %s, running %s" % (os.getcwd(), " ".join(argv))
-+ print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
- sys.stdout.flush()
- sys.stderr.flush()
- return subprocess.Popen(argv, stdout=subprocess.PIPE).communicate()[0]
-@@ -421,11 +421,11 @@ def unpack_binaries_into(build_os, arch, spec, where):
- sysassert(["tar", "xvzf", rootdir+"/"+tarfile(build_os, arch, spec)])
- release_dir = glob('mongodb-linux-*')[0]
- for releasefile in "bin", "GNU-AGPL-3.0", "README", "THIRD-PARTY-NOTICES", "MPL-2":
-- print "moving file: %s/%s" % (release_dir, releasefile)
-+ print("moving file: %s/%s" % (release_dir, releasefile))
- os.rename("%s/%s" % (release_dir, releasefile), releasefile)
- os.rmdir(release_dir)
- except Exception:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- os.chdir(rootdir)
- raise exc
- os.chdir(rootdir)
-@@ -441,7 +441,7 @@ def make_package(distro, build_os, arch, spec, srcdir):
- # directory, so the debian directory is needed in all cases (and
- # innocuous in the debianoids' sdirs).
- for pkgdir in ["debian", "rpm"]:
-- print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
-+ print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
- # FIXME: sh-dash-cee is bad. See if tarfile can do this.
- sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
- # Splat the binaries under sdir. The "build" stages of the
-@@ -574,7 +574,7 @@ def move_repos_into_place(src, dst):
- os.mkdir(dname)
- break
- except OSError:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -594,7 +594,7 @@ def move_repos_into_place(src, dst):
- os.symlink(dname, tmpnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -612,7 +612,7 @@ def move_repos_into_place(src, dst):
- os.symlink(os.readlink(dst), oldnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -765,7 +765,7 @@ def ensure_dir(filename):
- try:
- os.makedirs(dirpart)
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
diff --git a/buildscripts/resmokeconfig/loggers/__init__.py b/buildscripts/resmokeconfig/loggers/__init__.py
-index 6511d49..454f675 100644
+index 6511d49636..454f675ca2 100644
--- a/buildscripts/resmokeconfig/loggers/__init__.py
+++ b/buildscripts/resmokeconfig/loggers/__init__.py
@@ -21,7 +21,7 @@ def _get_named_loggers():
@@ -1282,7 +727,7 @@ index 6511d49..454f675 100644
(short_name, ext) = os.path.splitext(filename)
if ext in (".yml", ".yaml"):
diff --git a/buildscripts/resmokeconfig/suites/__init__.py b/buildscripts/resmokeconfig/suites/__init__.py
-index e075dd2..2ca2187 100644
+index e075dd22e0..2ca2187e6e 100644
--- a/buildscripts/resmokeconfig/suites/__init__.py
+++ b/buildscripts/resmokeconfig/suites/__init__.py
@@ -21,7 +21,7 @@ def _get_named_suites():
@@ -1295,7 +740,7 @@ index e075dd2..2ca2187 100644
(short_name, ext) = os.path.splitext(filename)
if ext in (".yml", ".yaml"):
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
-index 1dcd7d7..8a15651 100644
+index 1dcd7d7793..8a15651b4a 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -58,7 +58,7 @@ DEFAULTS = {
@@ -1308,7 +753,7 @@ index 1dcd7d7..8a15651 100644
"shellReadMode": None,
"shellWriteMode": None,
diff --git a/buildscripts/resmokelib/core/process.py b/buildscripts/resmokelib/core/process.py
-index 03fb849..e70f90a 100644
+index 03fb849616..e70f90abb4 100644
--- a/buildscripts/resmokelib/core/process.py
+++ b/buildscripts/resmokelib/core/process.py
@@ -196,8 +196,8 @@ class Process(object):
@@ -1323,10 +768,10 @@ index 03fb849..e70f90a 100644
# Adapted from implementation of Popen.terminate() in subprocess.py of Python 2.7
# because earlier versions do not catch exceptions.
diff --git a/buildscripts/resmokelib/logging/buildlogger.py b/buildscripts/resmokelib/logging/buildlogger.py
-index a577d64..d5405bd 100644
+index 01bba20202..044855cad0 100644
--- a/buildscripts/resmokelib/logging/buildlogger.py
+++ b/buildscripts/resmokelib/logging/buildlogger.py
-@@ -205,7 +205,7 @@ class BuildloggerServer(object):
+@@ -267,7 +267,7 @@ class BuildloggerServer(object):
def __init__(self):
tmp_globals = {}
self.config = {}
@@ -1336,7 +781,7 @@ index a577d64..d5405bd 100644
# Rename "slavename" to "username" if present.
if "slavename" in self.config and "username" not in self.config:
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
-index 3fff181..4395c3b 100644
+index 3fff181c18..4395c3b2cf 100644
--- a/buildscripts/resmokelib/selector.py
+++ b/buildscripts/resmokelib/selector.py
@@ -66,7 +66,7 @@ class TestFileExplorer(object):
@@ -1358,7 +803,7 @@ index 3fff181..4395c3b 100644
if key == "$allOf":
return _AllOfExpression(_make_expression_list(value))
diff --git a/buildscripts/resmokelib/testing/executor.py b/buildscripts/resmokelib/testing/executor.py
-index cc66556..db8d385 100644
+index 9574111904..d92209a7b1 100644
--- a/buildscripts/resmokelib/testing/executor.py
+++ b/buildscripts/resmokelib/testing/executor.py
@@ -64,7 +64,7 @@ class TestSuiteExecutor(object):
@@ -1380,7 +825,7 @@ index cc66556..db8d385 100644
return queue
diff --git a/buildscripts/resmokelib/testing/fixtures/interface.py b/buildscripts/resmokelib/testing/fixtures/interface.py
-index 6dffa24..dfeeb13 100644
+index 6dffa24e43..dfeeb1326d 100644
--- a/buildscripts/resmokelib/testing/fixtures/interface.py
+++ b/buildscripts/resmokelib/testing/fixtures/interface.py
@@ -4,6 +4,7 @@ Interface of the different fixtures for executing JSTests against.
@@ -1407,10 +852,10 @@ index 6dffa24..dfeeb13 100644
# is defined for all subclasses of Fixture.
REGISTERED_NAME = "Fixture"
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py
-index 025ce25..678ef45 100644
+index 5274ffb4c4..49675bd5e9 100644
--- a/buildscripts/resmokelib/testing/fixtures/replicaset.py
+++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py
-@@ -75,7 +75,7 @@ class ReplicaSetFixture(interface.ReplFixture):
+@@ -87,7 +87,7 @@ class ReplicaSetFixture(interface.ReplFixture):
self.replset_name = self.mongod_options.get("replSet", "rs")
if not self.nodes:
@@ -1420,7 +865,7 @@ index 025ce25..678ef45 100644
self.nodes.append(node)
diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
-index 4f90d16..eb96b8b 100644
+index 06e84c213b..47ba407a51 100644
--- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
+++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
@@ -85,7 +85,7 @@ class ShardedClusterFixture(interface.Fixture):
@@ -1433,11 +878,11 @@ index 4f90d16..eb96b8b 100644
shard = self._new_standalone_shard(i)
elif isinstance(self.num_rs_nodes_per_shard, int):
diff --git a/buildscripts/resmokelib/testing/hooks/interface.py b/buildscripts/resmokelib/testing/hooks/interface.py
-index 6ca4ae7..a225a1b 100644
+index cd5200764f..958cc92192 100644
--- a/buildscripts/resmokelib/testing/hooks/interface.py
+++ b/buildscripts/resmokelib/testing/hooks/interface.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import
- from ... import logging
+ from ...logging import loggers
from ...utils import registry
+import six
@@ -1460,7 +905,7 @@ index 6ca4ae7..a225a1b 100644
@staticmethod
diff --git a/buildscripts/resmokelib/testing/suite.py b/buildscripts/resmokelib/testing/suite.py
-index 132a2d7..07262d1 100644
+index 132a2d70d9..07262d194a 100644
--- a/buildscripts/resmokelib/testing/suite.py
+++ b/buildscripts/resmokelib/testing/suite.py
@@ -262,7 +262,7 @@ class Suite(object):
@@ -1473,7 +918,7 @@ index 132a2d7..07262d1 100644
bulleter_sb = []
summary = self._summarize_report(
diff --git a/buildscripts/resmokelib/testing/summary.py b/buildscripts/resmokelib/testing/summary.py
-index bb44472..54da218 100644
+index bb44472caa..54da2181d5 100644
--- a/buildscripts/resmokelib/testing/summary.py
+++ b/buildscripts/resmokelib/testing/summary.py
@@ -17,6 +17,6 @@ def combine(summary1, summary2):
@@ -1485,7 +930,7 @@ index bb44472..54da218 100644
args.append(summary1[i] + summary2[i])
return Summary._make(args)
diff --git a/buildscripts/resmokelib/testing/testcases/interface.py b/buildscripts/resmokelib/testing/testcases/interface.py
-index be7f14a..f736bd5 100644
+index be7f14afd5..f736bd5c36 100644
--- a/buildscripts/resmokelib/testing/testcases/interface.py
+++ b/buildscripts/resmokelib/testing/testcases/interface.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import
@@ -1525,7 +970,7 @@ index be7f14a..f736bd5 100644
# When the TestCase is created by the TestSuiteExecutor (through a call to make_test_case())
diff --git a/buildscripts/resmokelib/testing/testcases/jstest.py b/buildscripts/resmokelib/testing/testcases/jstest.py
-index adb2828..528a974 100644
+index adb28285f0..528a9747a9 100644
--- a/buildscripts/resmokelib/testing/testcases/jstest.py
+++ b/buildscripts/resmokelib/testing/testcases/jstest.py
@@ -235,7 +235,7 @@ class JSTestCase(interface.TestCase):
@@ -1538,7 +983,7 @@ index adb2828..528a974 100644
test_case = self._create_test_case_for_thread(logger, thread_id)
test_cases.append(test_case)
diff --git a/buildscripts/resmokelib/utils/__init__.py b/buildscripts/resmokelib/utils/__init__.py
-index fa782f3..3ce73c9 100644
+index fa782f3430..3ce73c9b64 100644
--- a/buildscripts/resmokelib/utils/__init__.py
+++ b/buildscripts/resmokelib/utils/__init__.py
@@ -43,14 +43,14 @@ def is_string_list(lst):
@@ -1559,7 +1004,7 @@ index fa782f3..3ce73c9 100644
def is_js_file(filename):
diff --git a/buildscripts/resmokelib/utils/globstar.py b/buildscripts/resmokelib/utils/globstar.py
-index 644ebfe..52100d7 100644
+index 644ebfe3e3..52100d7d9d 100644
--- a/buildscripts/resmokelib/utils/globstar.py
+++ b/buildscripts/resmokelib/utils/globstar.py
@@ -145,7 +145,7 @@ def _list_dir(pathname):
@@ -1572,7 +1017,7 @@ index 644ebfe..52100d7 100644
except StopIteration:
return None # 'pathname' directory does not exist
diff --git a/buildscripts/resmokelib/utils/jscomment.py b/buildscripts/resmokelib/utils/jscomment.py
-index 18da788..a393c43 100644
+index 18da788582..a393c43723 100644
--- a/buildscripts/resmokelib/utils/jscomment.py
+++ b/buildscripts/resmokelib/utils/jscomment.py
@@ -39,7 +39,7 @@ def get_tags(pathname):
@@ -1585,7 +1030,7 @@ index 18da788..a393c43 100644
return tags
except yaml.YAMLError as err:
diff --git a/buildscripts/resmokelib/utils/queue.py b/buildscripts/resmokelib/utils/queue.py
-index 80da5e2..41d23d5 100644
+index 80da5e2cc6..41d23d54bf 100644
--- a/buildscripts/resmokelib/utils/queue.py
+++ b/buildscripts/resmokelib/utils/queue.py
@@ -9,15 +9,20 @@ See https://bugs.python.org/issue1167930 for more details.
@@ -1612,488 +1057,8 @@ index 80da5e2..41d23d5 100644
"""
A multi-producer, multi-consumer queue.
"""
-diff --git a/buildscripts/setup_multiversion_mongodb.py b/buildscripts/setup_multiversion_mongodb.py
-index f3cb804..86bea8f 100755
---- a/buildscripts/setup_multiversion_mongodb.py
-+++ b/buildscripts/setup_multiversion_mongodb.py
-@@ -189,7 +189,7 @@ class MultiVersionDownloader(object):
-
- urls = []
- requested_version_parts = get_version_parts(version)
-- for link_version, link_url in self.links.iteritems():
-+ for link_version, link_url in self.links.items():
- link_version_parts = get_version_parts(link_version)
- if link_version_parts[:len(requested_version_parts)] == requested_version_parts:
- # The 'link_version' is a candidate for the requested 'version' if
-@@ -220,11 +220,11 @@ class MultiVersionDownloader(object):
- else:
- print("Falling back to generic architecture.")
-
-- urls.sort(key=lambda (version, _): get_version_parts(version, for_sorting=True))
-+ urls.sort(key=lambda version__: get_version_parts(version__[0], for_sorting=True))
- full_version = urls[-1][0]
- url = urls[-1][1]
- extract_dir = url.split("/")[-1][:-4]
-- file_suffix = os.path.splitext(urlparse.urlparse(url).path)[1]
-+ file_suffix = os.path.splitext(urllib.parse.urlparse(url).path)[1]
-
- # Only download if we don't already have the directory.
- # Note, we cannot detect if 'latest' has already been downloaded, as the name
-diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py
-index 4fdb01d..eda604e 100755
---- a/buildscripts/smoke.py
-+++ b/buildscripts/smoke.py
-@@ -34,7 +34,7 @@
- # jobs on the same host at once. So something's gotta change.
-
- from datetime import datetime
--from itertools import izip
-+
- import glob
- import logging
- from optparse import OptionParser
-@@ -55,11 +55,11 @@ from pymongo import MongoClient
- from pymongo.errors import OperationFailure
- from pymongo import ReadPreference
-
--import cleanbb
--import utils
-+from . import cleanbb
-+from . import utils
-
- try:
-- import cPickle as pickle
-+ import pickle as pickle
- except ImportError:
- import pickle
-
-@@ -133,17 +133,17 @@ class NullMongod(object):
-
-
- def dump_stacks(signal, frame):
-- print "======================================"
-- print "DUMPING STACKS due to SIGUSR1 signal"
-- print "======================================"
-+ print("======================================")
-+ print("DUMPING STACKS due to SIGUSR1 signal")
-+ print("======================================")
- threads = threading.enumerate();
-
-- print "Total Threads: " + str(len(threads))
-+ print("Total Threads: " + str(len(threads)))
-
- for id, stack in sys._current_frames().items():
-- print "Thread %d" % (id)
-- print "".join(traceback.format_stack(stack))
-- print "======================================"
-+ print("Thread %d" % (id))
-+ print("".join(traceback.format_stack(stack)))
-+ print("======================================")
-
-
- def buildlogger(cmd, is_global=False):
-@@ -196,8 +196,8 @@ class mongod(NullMongod):
- try:
- self.check_mongo_port(int(port))
- return True
-- except Exception,e:
-- print >> sys.stderr, e
-+ except Exception as e:
-+ print(e, file=sys.stderr)
- return False
-
- def did_mongod_start(self, port=mongod_port, timeout=300):
-@@ -207,14 +207,14 @@ class mongod(NullMongod):
- if is_up:
- return True
- timeout = timeout - 1
-- print >> sys.stderr, "timeout starting mongod"
-+ print("timeout starting mongod", file=sys.stderr)
- return False
-
- def start(self):
- global mongod_port
- global mongod
- if self.proc:
-- print >> sys.stderr, "probable bug: self.proc already set in start()"
-+ print("probable bug: self.proc already set in start()", file=sys.stderr)
- return
- self.ensure_test_dirs()
- dir_name = smoke_db_prefix + "/data/db/sconsTests/"
-@@ -270,7 +270,7 @@ class mongod(NullMongod):
- '--sslAllowConnectionsWithoutCertificates']
- if self.kwargs.get('rlp_path'):
- argv += ['--basisTechRootDirectory', self.kwargs.get('rlp_path')]
-- print "running " + " ".join(argv)
-+ print("running " + " ".join(argv))
- self.proc = self._start(buildlogger(argv, is_global=True))
-
- # If the mongod process is spawned under buildlogger.py, then the first line of output
-@@ -352,7 +352,7 @@ class mongod(NullMongod):
-
- def stop(self):
- if not self.proc:
-- print >> sys.stderr, "probable bug: self.proc unset in stop()"
-+ print("probable bug: self.proc unset in stop()", file=sys.stderr)
- return
- try:
- if os.sys.platform == "win32" and self.job_object is not None:
-@@ -407,9 +407,9 @@ class mongod(NullMongod):
- self.proc.terminate()
- else:
- os.kill(self.proc.pid, 15)
-- except Exception, e:
-- print >> sys.stderr, "error shutting down mongod"
-- print >> sys.stderr, e
-+ except Exception as e:
-+ print("error shutting down mongod", file=sys.stderr)
-+ print(e, file=sys.stderr)
- self.proc.wait()
-
- if self._stdout_pipe is not None:
-@@ -424,12 +424,12 @@ class mongod(NullMongod):
- # anyway.
- retcode = self.proc.returncode
- if os.sys.platform != "win32" and retcode != 0:
-- raise(Exception('mongod process exited with non-zero code %d' % retcode))
-+ raise Exception
-
- def wait_for_repl(self):
-- print "Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")"
-+ print("Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")")
- MongoClient(port=self.port).testing.smokeWait.insert({}, w=2, wtimeout=5*60*1000)
-- print "Replicated write completed -- done wait_for_repl"
-+ print("Replicated write completed -- done wait_for_repl")
-
- class Bug(Exception):
- def __str__(self):
-@@ -457,7 +457,7 @@ class TestServerFailure(TestFailure):
- def check_db_hashes(master, slave):
- # Need to pause a bit so a slave might catch up...
- if not slave.slave:
-- raise(Bug("slave instance doesn't have slave attribute set"))
-+ raise Bug
-
- master.wait_for_repl()
-
-@@ -469,7 +469,7 @@ def check_db_hashes(master, slave):
-
- global lost_in_slave, lost_in_master, screwy_in_slave, replicated_collections
-
-- replicated_collections += master.dict.keys()
-+ replicated_collections += list(master.dict.keys())
-
- for coll in replicated_collections:
- if coll not in slave.dict and coll not in lost_in_slave:
-@@ -489,13 +489,13 @@ def check_db_hashes(master, slave):
- sDocs = list(sTestDB[coll].find().sort("_id", 1))
- mDiffDocs = list()
- sDiffDocs = list()
-- for left, right in izip(mDocs, sDocs):
-+ for left, right in zip(mDocs, sDocs):
- if left != right:
- mDiffDocs.append(left)
- sDiffDocs.append(right)
-
- stats["docs"] = {'master': mDiffDocs, 'slave': sDiffDocs }
-- except Exception, e:
-+ except Exception as e:
- stats["error-docs"] = e;
-
- screwy_in_slave[coll] = stats
-@@ -506,7 +506,7 @@ def check_db_hashes(master, slave):
- mOplog = mTestDB.connection.local[oplog];
- oplog_entries = list(mOplog.find({"$or": [{"ns":mTestDB[coll].full_name}, \
- {"op":"c"}]}).sort("$natural", 1))
-- print "oplog for %s" % mTestDB[coll].full_name
-+ print("oplog for %s" % mTestDB[coll].full_name)
- for doc in oplog_entries:
- pprint.pprint(doc, width=200)
-
-@@ -745,7 +745,7 @@ def runTest(test, result):
-
- is_mongod_still_up = test_mongod.is_mongod_up(mongod_port)
- if start_mongod and not is_mongod_still_up:
-- print "mongod is not running after test"
-+ print("mongod is not running after test")
- result["mongod_running_at_end"] = is_mongod_still_up;
- raise TestServerFailure(path)
-
-@@ -754,7 +754,7 @@ def runTest(test, result):
- if r != 0:
- raise TestExitFailure(path, r)
-
-- print ""
-+ print("")
-
- def run_tests(tests):
- # FIXME: some suites of tests start their own mongod, so don't
-@@ -825,7 +825,7 @@ def run_tests(tests):
- result = primary.admin.command("ismaster");
- ismaster = result["ismaster"]
- if not ismaster:
-- print "waiting for primary to be available ..."
-+ print("waiting for primary to be available ...")
- time.sleep(.2)
-
- secondaryUp = False
-@@ -835,7 +835,7 @@ def run_tests(tests):
- result = sConn.admin.command("ismaster");
- secondaryUp = result["secondary"]
- if not secondaryUp:
-- print "waiting for secondary to be available ..."
-+ print("waiting for secondary to be available ...")
- time.sleep(.2)
-
- if small_oplog or small_oplog_rs:
-@@ -857,7 +857,7 @@ def run_tests(tests):
- if skipTest(test_path):
- test_result["status"] = "skip"
-
-- print "skipping " + test_path
-+ print("skipping " + test_path)
- else:
- fails.append(test)
- runTest(test, test_result)
-@@ -897,20 +897,20 @@ def run_tests(tests):
- use_ssl=use_ssl)
- master.start()
-
-- except TestFailure, f:
-+ except TestFailure as f:
- test_result["end"] = time.time()
- test_result["elapsed"] = test_result["end"] - test_result["start"]
- test_result["error"] = str(f)
- test_result["status"] = "fail"
- test_report["results"].append( test_result )
- try:
-- print f
-+ print(f)
- # Record the failing test and re-raise.
- losers[f.path] = f.status
- raise f
-- except TestServerFailure, f:
-+ except TestServerFailure as f:
- return 2
-- except TestFailure, f:
-+ except TestFailure as f:
- if not continue_on_failure:
- return 1
- if isinstance(slave, mongod):
-@@ -925,51 +925,51 @@ def run_tests(tests):
- def check_and_report_replication_dbhashes():
- def missing(lst, src, dst):
- if lst:
-- print """The following collections were present in the %s but not the %s
--at the end of testing:""" % (src, dst)
-+ print("""The following collections were present in the %s but not the %s
-+at the end of testing:""" % (src, dst))
- for db in lst:
-- print db
-+ print(db)
-
- missing(lost_in_slave, "master", "slave")
- missing(lost_in_master, "slave", "master")
- if screwy_in_slave:
-- print """The following collections have different hashes in the master and slave:"""
-+ print("""The following collections have different hashes in the master and slave:""")
- for coll in screwy_in_slave.keys():
- stats = screwy_in_slave[coll]
- # Counts are "approx" because they are collected after the dbhash runs and may not
- # reflect the states of the collections that were hashed. If the hashes differ, one
- # possibility is that a test exited with writes still in-flight.
-- print "collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave'])
-+ print("collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave']))
- if "docs" in stats:
- if (("master" in stats["docs"] and len(stats["docs"]["master"]) == 0) and
- ("slave" in stats["docs"] and len(stats["docs"]["slave"]) == 0)):
-- print "All docs matched!"
-+ print("All docs matched!")
- else:
-- print "Different Docs"
-- print "Master docs:"
-+ print("Different Docs")
-+ print("Master docs:")
- pprint.pprint(stats["docs"]["master"], indent=2)
-- print "Slave docs:"
-+ print("Slave docs:")
- pprint.pprint(stats["docs"]["slave"], indent=2)
- if "error-docs" in stats:
-- print "Error getting docs to diff:"
-+ print("Error getting docs to diff:")
- pprint.pprint(stats["error-docs"])
- return True
-
- if (small_oplog or small_oplog_rs) and not (lost_in_master or lost_in_slave or screwy_in_slave):
-- print "replication ok for %d collections" % (len(replicated_collections))
-+ print("replication ok for %d collections" % (len(replicated_collections)))
-
- return False
-
-
- def report():
-- print "%d tests succeeded" % len(winners)
-+ print("%d tests succeeded" % len(winners))
- num_missed = len(tests) - (len(winners) + len(losers.keys()))
- if num_missed:
-- print "%d tests didn't get run" % num_missed
-+ print("%d tests didn't get run" % num_missed)
- if losers:
-- print "The following tests failed (with exit code):"
-+ print("The following tests failed (with exit code):")
- for loser in losers:
-- print "%s\t%d" % (loser, losers[loser])
-+ print("%s\t%d" % (loser, losers[loser]))
-
- test_result = { "start": time.time() }
- if check_and_report_replication_dbhashes():
-@@ -981,7 +981,7 @@ def report():
- test_report["results"].append( test_result )
-
- if report_file:
-- f = open( report_file, "wb" )
-+ f = open( report_file, "w" )
- f.write( json.dumps( test_report ) )
- f.close()
-
-@@ -1244,7 +1244,7 @@ def run_old_fails():
- return # This counts as passing so we will run all tests
-
- if ('version' not in state or state['version'] != file_version()):
-- print "warning: old version of failfile.smoke detected. skipping recent fails"
-+ print("warning: old version of failfile.smoke detected. skipping recent fails")
- clear_failfile()
- return
-
-@@ -1308,7 +1308,7 @@ def main():
- try:
- signal.signal(signal.SIGUSR1, dump_stacks)
- except AttributeError:
-- print "Cannot catch signals on Windows"
-+ print("Cannot catch signals on Windows")
-
- parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
- parser.add_option('--mode', dest='mode', default='suite',
-@@ -1450,19 +1450,19 @@ def main():
-
- if options.ignore_files != None :
- ignore_patt = re.compile( options.ignore_files )
-- print "Ignoring files with pattern: ", ignore_patt
-+ print("Ignoring files with pattern: ", ignore_patt)
-
- def ignore_test( test ):
- if ignore_patt.search( test[0] ) != None:
-- print "Ignoring test ", test[0]
-+ print("Ignoring test ", test[0])
- return False
- else:
- return True
-
-- tests = filter( ignore_test, tests )
-+ tests = list(filter( ignore_test, tests ))
-
- if not tests:
-- print "warning: no tests specified"
-+ print("warning: no tests specified")
- return
-
- if options.with_cleanbb:
-@@ -1480,7 +1480,7 @@ def main():
- test_report["failures"] = len(losers.keys())
- test_report["mongod_running_at_end"] = mongod().is_mongod_up(mongod_port)
- if report_file:
-- f = open( report_file, "wb" )
-+ f = open( report_file, "w" )
- f.write( json.dumps( test_report, indent=4, separators=(',', ': ')) )
- f.close()
-
-diff --git a/buildscripts/test_failures.py b/buildscripts/test_failures.py
-index 63f138a..a4db503 100755
---- a/buildscripts/test_failures.py
-+++ b/buildscripts/test_failures.py
-@@ -20,7 +20,7 @@ import time
- import warnings
-
- try:
-- from urlparse import urlparse
-+ from urllib.parse import urlparse
- except ImportError:
- from urllib.parse import urlparse
-
-@@ -31,7 +31,7 @@ import yaml
- LOGGER = logging.getLogger(__name__)
-
- if sys.version_info[0] == 2:
-- _STRING_TYPES = (basestring,)
-+ _STRING_TYPES = (str,)
- else:
- _STRING_TYPES = (str,)
-
-diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py
-index ae8b0a9..66eeb40 100644
---- a/buildscripts/tests/resmokelib/test_selector.py
-+++ b/buildscripts/tests/resmokelib/test_selector.py
-@@ -178,12 +178,12 @@ class TestTestList(unittest.TestCase):
-
- def test_roots_with_unmatching_glob(self):
- glob_roots = ["unknown/subdir1/*.js"]
-- with self.assertRaisesRegexp(ValueError, "Pattern does not match any files: unknown/subdir1/\*.js"):
-+ with self.assertRaisesRegex(ValueError, "Pattern does not match any files: unknown/subdir1/\*.js"):
- selector._TestList(self.test_file_explorer, glob_roots)
-
- def test_roots_unknown_file(self):
- roots = ["dir/subdir1/unknown"]
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
- selector._TestList(self.test_file_explorer, roots, tests_are_files=True)
-
- def test_include_files(self):
-@@ -208,7 +208,7 @@ class TestTestList(unittest.TestCase):
- def test_exclude_files_no_match(self):
- roots = ["dir/subdir1/*.js", "dir/subdir2/test21.*"]
- test_list = selector._TestList(self.test_file_explorer, roots)
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: .*$"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: .*$"):
- test_list.exclude_files(["dir/subdir2/test26.js"])
-
- def test_exclude_files_glob(self):
-@@ -420,7 +420,7 @@ class TestFilterTests(unittest.TestCase):
-
- def test_jstest_unknown_file(self):
- config = {"roots": ["dir/subdir1/*.js", "dir/subdir1/unknown"]}
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
- selector.filter_tests("js_test", config, self.test_file_explorer)
-
- def test_json_schema_exclude_files(self):
-diff --git a/buildscripts/tests/test_aws_ec2.py b/buildscripts/tests/test_aws_ec2.py
-index 40f4333..2de7d1f 100755
---- a/buildscripts/tests/test_aws_ec2.py
-+++ b/buildscripts/tests/test_aws_ec2.py
-@@ -169,7 +169,7 @@ class AwsEc2ControlStatus(AwsEc2TestCase):
-
- code, ret = self.aws_ec2.control_instance(mode="status", image_id="bad_id")
- self.assertNotEqual(0, code, ret)
-- self.assertRegexpMatches(ret, "Invalid", ret)
-+ self.assertRegex(ret, "Invalid", ret)
-
-
- class AwsEc2ControlStart(AwsEc2TestCase):
-diff --git a/buildscripts/update_test_lifecycle.py b/buildscripts/update_test_lifecycle.py
-index 52bf204..90ab279 100755
---- a/buildscripts/update_test_lifecycle.py
-+++ b/buildscripts/update_test_lifecycle.py
-@@ -39,7 +39,7 @@ from buildscripts.ciconfig import tags as ci_tags
- LOGGER = logging.getLogger(__name__)
-
- if sys.version_info[0] == 2:
-- _NUMBER_TYPES = (int, long, float)
-+ _NUMBER_TYPES = (int, int, float)
- else:
- _NUMBER_TYPES = (int, float)
-
diff --git a/buildscripts/utils.py b/buildscripts/utils.py
-index 69a7892..93c697a 100644
+index 69a78921ca..93c697adca 100644
--- a/buildscripts/utils.py
+++ b/buildscripts/utils.py
@@ -122,7 +122,7 @@ def getprocesslist():
@@ -2142,7 +1107,7 @@ index 69a7892..93c697a 100644
codecs.register_error('repr', replace_with_repr)
diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py
-index 632ed29..1641c3b 100644
+index 632ed29be5..1641c3ba90 100644
--- a/site_scons/libdeps.py
+++ b/site_scons/libdeps.py
@@ -122,7 +122,7 @@ def __get_libdeps(node):
@@ -2173,7 +1138,7 @@ index 632ed29..1641c3b 100644
else:
result.append(d)
diff --git a/site_scons/mongo/__init__.py b/site_scons/mongo/__init__.py
-index 510bd7b..f774780 100644
+index 510bd7bcc2..f77478092b 100644
--- a/site_scons/mongo/__init__.py
+++ b/site_scons/mongo/__init__.py
@@ -5,4 +5,4 @@
@@ -2183,7 +1148,7 @@ index 510bd7b..f774780 100644
- print "%s failed: %s" % (bf.node, bf.errstr)
+ print("%s failed: %s" % (bf.node, bf.errstr))
diff --git a/site_scons/mongo/generators.py b/site_scons/mongo/generators.py
-index c07e86a..5958e69 100644
+index c07e86a4d1..5958e6923b 100644
--- a/site_scons/mongo/generators.py
+++ b/site_scons/mongo/generators.py
@@ -1,6 +1,6 @@
@@ -2204,7 +1169,7 @@ index c07e86a..5958e69 100644
hasher.update(option)
hasher.update(str(env.GetOption(option)))
diff --git a/site_scons/site_tools/dagger/__init__.py b/site_scons/site_tools/dagger/__init__.py
-index f05228c..f10b402 100644
+index f05228cfe4..f10b4027e1 100644
--- a/site_scons/site_tools/dagger/__init__.py
+++ b/site_scons/site_tools/dagger/__init__.py
@@ -5,7 +5,7 @@ import logging
@@ -2217,7 +1182,7 @@ index f05228c..f10b402 100644
def generate(env, **kwargs):
"""The entry point for our tool. However, the builder for
diff --git a/site_scons/site_tools/dagger/dagger.py b/site_scons/site_tools/dagger/dagger.py
-index 1eeefe1..03e7603 100644
+index 1eeefe1ea3..03e7603d29 100644
--- a/site_scons/site_tools/dagger/dagger.py
+++ b/site_scons/site_tools/dagger/dagger.py
@@ -40,8 +40,8 @@ import sys
@@ -2241,7 +1206,7 @@ index 1eeefe1..03e7603 100644
# target is given as a list of target SCons nodes - this builder is only responsible for
diff --git a/site_scons/site_tools/dagger/graph.py b/site_scons/site_tools/dagger/graph.py
-index 5ebe6f4..379d524 100644
+index 5ebe6f4506..379d5245e6 100644
--- a/site_scons/site_tools/dagger/graph.py
+++ b/site_scons/site_tools/dagger/graph.py
@@ -4,11 +4,13 @@ import abc
@@ -2317,7 +1282,7 @@ index 5ebe6f4..379d524 100644
if isinstance(v, list):
setattr(self, k, set(v))
diff --git a/site_scons/site_tools/dagger/graph_consts.py b/site_scons/site_tools/dagger/graph_consts.py
-index 81fe86d..a922a4f 100644
+index 81fe86d75c..a922a4f3f6 100644
--- a/site_scons/site_tools/dagger/graph_consts.py
+++ b/site_scons/site_tools/dagger/graph_consts.py
@@ -17,8 +17,8 @@ NODE_SYM = 2
@@ -2332,7 +1297,7 @@ index 81fe86d..a922a4f 100644
"""Error/query codes"""
diff --git a/site_scons/site_tools/dagger/graph_test.py b/site_scons/site_tools/dagger/graph_test.py
-index bc84f58..6c0168c 100644
+index bc84f5868c..6c0168cf97 100644
--- a/site_scons/site_tools/dagger/graph_test.py
+++ b/site_scons/site_tools/dagger/graph_test.py
@@ -5,8 +5,8 @@ from JSON
@@ -2424,7 +1389,7 @@ index bc84f58..6c0168c 100644
if __name__ == '__main__':
diff --git a/site_scons/site_tools/distsrc.py b/site_scons/site_tools/distsrc.py
-index 861f5d9..d2dff0b 100644
+index 861f5d9e2e..d2dff0b612 100644
--- a/site_scons/site_tools/distsrc.py
+++ b/site_scons/site_tools/distsrc.py
@@ -20,7 +20,7 @@ import shutil
@@ -2491,7 +1456,7 @@ index 861f5d9..d2dff0b 100644
git_cmd = "\"%s\" archive --format %s --output %s --prefix ${MONGO_DIST_SRC_PREFIX} HEAD" % (
diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py
-index 9838b63..fdf0c26 100644
+index 9838b63349..fdf0c26030 100644
--- a/site_scons/site_tools/icecream.py
+++ b/site_scons/site_tools/icecream.py
@@ -99,7 +99,7 @@ def generate(env):
@@ -2504,7 +1469,7 @@ index 9838b63..fdf0c26 100644
continue
base = emitterdict[suffix]
diff --git a/site_scons/site_tools/idl_tool.py b/site_scons/site_tools/idl_tool.py
-index 78bedfa..628f345 100755
+index 78bedfaa74..628f345361 100755
--- a/site_scons/site_tools/idl_tool.py
+++ b/site_scons/site_tools/idl_tool.py
@@ -47,7 +47,7 @@ def idl_scanner(node, env, path):
@@ -2517,7 +1482,7 @@ index 78bedfa..628f345 100755
nodes_deps_list.extend(env.Glob('#buildscripts/idl/idl/*.py'))
diff --git a/site_scons/site_tools/jstoh.py b/site_scons/site_tools/jstoh.py
-index dc90b32..567958a 100644
+index dc90b324b2..567958a50f 100644
--- a/site_scons/site_tools/jstoh.py
+++ b/site_scons/site_tools/jstoh.py
@@ -1,3 +1,5 @@
@@ -2547,7 +1512,7 @@ index dc90b32..567958a 100644
jsToHeader(sys.argv[1], sys.argv[2:])
diff --git a/site_scons/site_tools/mongo_integrationtest.py b/site_scons/site_tools/mongo_integrationtest.py
-index ff9a5f4..fccbbeb 100644
+index ff9a5f451b..fccbbebb47 100644
--- a/site_scons/site_tools/mongo_integrationtest.py
+++ b/site_scons/site_tools/mongo_integrationtest.py
@@ -12,10 +12,10 @@ def register_integration_test(env, test):
@@ -2564,7 +1529,7 @@ index ff9a5f4..fccbbeb 100644
finally:
ofile.close()
diff --git a/site_scons/site_tools/mongo_unittest.py b/site_scons/site_tools/mongo_unittest.py
-index ec99ab2..a4185a6 100644
+index ec99ab2d45..a4185a6b41 100644
--- a/site_scons/site_tools/mongo_unittest.py
+++ b/site_scons/site_tools/mongo_unittest.py
@@ -11,10 +11,10 @@ def register_unit_test(env, test):
@@ -2581,7 +1546,7 @@ index ec99ab2..a4185a6 100644
finally:
ofile.close()
diff --git a/site_scons/site_tools/split_dwarf.py b/site_scons/site_tools/split_dwarf.py
-index 95130c9..c02d786 100644
+index 95130c9e9a..c02d78619f 100644
--- a/site_scons/site_tools/split_dwarf.py
+++ b/site_scons/site_tools/split_dwarf.py
@@ -52,7 +52,7 @@ def generate(env):
@@ -2594,7 +1559,7 @@ index 95130c9..c02d786 100644
continue
base = emitterdict[suffix]
diff --git a/site_scons/site_tools/thin_archive.py b/site_scons/site_tools/thin_archive.py
-index 511c0ef..0d8a83b 100644
+index 511c0ef6e5..0d8a83b83a 100644
--- a/site_scons/site_tools/thin_archive.py
+++ b/site_scons/site_tools/thin_archive.py
@@ -41,7 +41,7 @@ def exists(env):
@@ -2607,7 +1572,7 @@ index 511c0ef..0d8a83b 100644
return bool(isgnu)
diff --git a/site_scons/site_tools/xcode.py b/site_scons/site_tools/xcode.py
-index 9ec68c3..5ddebb2 100644
+index 9ec68c3547..5ddebb2e00 100644
--- a/site_scons/site_tools/xcode.py
+++ b/site_scons/site_tools/xcode.py
@@ -9,4 +9,4 @@ def generate(env):
@@ -2617,10 +1582,10 @@ index 9ec68c3..5ddebb2 100644
- print "NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands"
+ print("NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands")
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
-index 426e57c..cc09ab4 100644
+index 5d6ec52d14..ccd588899c 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
-@@ -156,7 +156,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else
+@@ -157,7 +157,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else
# On windows, we need to escape the backslashes in the command-line
# so that windows paths look okay.
@@ -2629,7 +1594,7 @@ index 426e57c..cc09ab4 100644
if env.TargetOSIs('windows'):
cmd_line = cmd_line.replace('\\', r'\\')
-@@ -602,7 +602,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'),
+@@ -603,7 +603,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'),
distsrc.File('MPL-2')])
# If no module has introduced a file named LICENSE.txt, then inject the AGPL.
@@ -2638,7 +1603,7 @@ index 426e57c..cc09ab4 100644
env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0')])
# All module banners get staged to the top level of the tarfile, so we
-@@ -621,7 +621,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in
+@@ -622,7 +622,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in
# Allow modules to map original file name directories to subdirectories
# within the archive (e.g. { "src/mongo/db/modules/enterprise/docs": "snmp"})
archive_addition_transforms = []
@@ -2648,7 +1613,7 @@ index 426e57c..cc09ab4 100644
(full_dir, archive_dir))
diff --git a/src/mongo/base/generate_error_codes.py b/src/mongo/base/generate_error_codes.py
-index 420ee96..b704767 100644
+index 420ee964ff..b704767a01 100644
--- a/src/mongo/base/generate_error_codes.py
+++ b/src/mongo/base/generate_error_codes.py
@@ -26,6 +26,8 @@
@@ -2670,7 +1635,7 @@ index 420ee96..b704767 100644
def die(message=None):
diff --git a/src/mongo/db/auth/generate_action_types.py b/src/mongo/db/auth/generate_action_types.py
-index b712b29..39252ed 100755
+index b712b29666..39252ed293 100755
--- a/src/mongo/db/auth/generate_action_types.py
+++ b/src/mongo/db/auth/generate_action_types.py
@@ -227,7 +227,7 @@ def hasDuplicateActionTypes(actionTypes):
@@ -2692,7 +1657,7 @@ index b712b29..39252ed 100755
actionTypes = parseActionTypesFromFile(sys.argv[1])
diff --git a/src/mongo/db/fts/generate_stop_words.py b/src/mongo/db/fts/generate_stop_words.py
-index e0dc801..e0aad76 100644
+index e0dc801ca9..e0aad760e8 100644
--- a/src/mongo/db/fts/generate_stop_words.py
+++ b/src/mongo/db/fts/generate_stop_words.py
@@ -7,7 +7,7 @@ def generate( header, source, language_files ):
@@ -2723,7 +1688,7 @@ index e0dc801..e0aad76 100644
out.write( ' };\n' )
out.write( ' const size_t wordcnt = sizeof(words) / sizeof(words[0]);\n' )
diff --git a/src/mongo/db/fts/unicode/gen_diacritic_map.py b/src/mongo/db/fts/unicode/gen_diacritic_map.py
-index 08cfa95..7c623af 100644
+index 08cfa95cda..7c623aff60 100644
--- a/src/mongo/db/fts/unicode/gen_diacritic_map.py
+++ b/src/mongo/db/fts/unicode/gen_diacritic_map.py
@@ -45,7 +45,7 @@ def add_diacritic_mapping(codepoint):
@@ -2736,7 +1701,7 @@ index 08cfa95..7c623af 100644
for i in range(len(d)):
if ord(d[i]) not in diacritics:
diff --git a/src/mongo/db/query/collation/generate_icu_init_cpp.py b/src/mongo/db/query/collation/generate_icu_init_cpp.py
-index 8ae084a..7c576f6 100755
+index 8ae084aeec..7c576f6ffe 100755
--- a/src/mongo/db/query/collation/generate_icu_init_cpp.py
+++ b/src/mongo/db/query/collation/generate_icu_init_cpp.py
@@ -26,6 +26,9 @@
@@ -2760,25 +1725,3 @@ index 8ae084a..7c576f6 100755
cpp_file.write(source_template % dict(decimal_encoded_data=decimal_encoded_data))
if __name__ == '__main__':
-diff --git a/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py b/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-index ece905d..03cc961 100644
---- a/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-+++ b/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-@@ -36,7 +36,7 @@
- #
- # It uses the C preprocessor to process its inputs.
-
--from __future__ import with_statement
-+from __future__ import with_statement, unicode_literals
- import re, sys, os, subprocess
- import shlex
- import which
-@@ -107,7 +107,7 @@ def preprocess(cxx, preprocessorOption, source, args = []):
- tmpOut = 'self-hosting-preprocessed.pp';
- outputArg = shlex.split(preprocessorOption + tmpOut)
-
-- with open(tmpIn, 'wb') as input:
-+ with open(tmpIn, 'w') as input:
- input.write(source)
- print(' '.join(cxx + outputArg + args + [tmpIn]))
- result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
diff --git a/use-system-mozjs-icu-asio.patch b/use-system-mozjs-icu-asio.patch
index d54768d..7049460 100644
--- a/use-system-mozjs-icu-asio.patch
+++ b/use-system-mozjs-icu-asio.patch
@@ -1,5 +1,5 @@
diff --git a/SConstruct b/SConstruct
-index fe7975b..3cf8a1b 100644
+index f949f65475..9008888d9f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -156,7 +156,7 @@ add_option('wiredtiger',
@@ -23,7 +23,7 @@ index fe7975b..3cf8a1b 100644
add_option('use-system-intel_decimal128',
help='use system version of intel decimal128',
nargs=0,
-@@ -2846,20 +2851,20 @@ def doConfigure(myenv):
+@@ -2850,20 +2855,20 @@ def doConfigure(myenv):
if use_system_version_of_library("icu"):
conf.FindSysLibDep("icudata", ["icudata"])
@@ -52,7 +52,7 @@ index fe7975b..3cf8a1b 100644
conf.env.Append(
CPPDEFINES=[
"BOOST_SYSTEM_NO_DEPRECATED",
-@@ -3028,7 +3033,7 @@ def doConfigure(myenv):
+@@ -3032,7 +3037,7 @@ def doConfigure(myenv):
if conf.CheckExtendedAlignment(size):
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_MAX_EXTENDED_ALIGNMENT", size)
break
@@ -61,7 +61,7 @@ index fe7975b..3cf8a1b 100644
conf.env['MONGO_HAVE_LIBMONGOC'] = conf.CheckLibWithHeader(
["mongoc-1.0"],
["mongoc.h"],
-@@ -3168,7 +3173,7 @@ Export("get_option")
+@@ -3172,7 +3177,7 @@ Export("get_option")
Export("has_option")
Export("use_system_version_of_library")
Export("serverJs")
@@ -71,7 +71,7 @@ index fe7975b..3cf8a1b 100644
Export("debugBuild optBuild")
Export("wiredtiger")
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
-index 416ef7a..9a4f941 100644
+index 69c4a02a61..08c37aa89b 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -2,7 +2,7 @@
6 years
Architecture specific change in rpms/mongodb.git
by githook-noreply@fedoraproject.org
The package rpms/mongodb.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/mongodb.git/commit/?id=930d3b7845....
Change:
+%ifarch ppc64le
Thanks.
Full change:
============
commit 930d3b784589afb1b182f702ecf7963ed85e609a
Author: Marek Skalický <mskalick(a)redhat.com>
Date: Tue Apr 24 14:57:11 2018 +0200
Rebase patches to new mongodb version
diff --git a/mongodb.spec b/mongodb.spec
index 05cfcaa..cc2bb17 100644
--- a/mongodb.spec
+++ b/mongodb.spec
@@ -195,7 +195,9 @@ the MongoDB sources.
%setup -q -n %{MONGO_DISTNAME}
%patch1 -p1
%patch2 -p1
+%ifarch ppc64le
%patch3 -p1
+%endif
# Patch only Fedora specific architectures
%ifnarch %{upstream_arches}
%patch0 -p1
diff --git a/ppc64le-disable-altivec.patch b/ppc64le-disable-altivec.patch
index 85f7d5c..4202141 100644
--- a/ppc64le-disable-altivec.patch
+++ b/ppc64le-disable-altivec.patch
@@ -1,13 +1,13 @@
-diff --git a/src/mongo/db/fts/unicode/byte_vector.h b/src/mongo/db/fts/unicode/byte_vector.h
-index 2404e15dfd..d361a857ff 100644
---- a/src/mongo/db/fts/unicode/byte_vector.h
-+++ b/src/mongo/db/fts/unicode/byte_vector.h
-@@ -33,8 +33,6 @@
- // TODO replace this with #if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION in boost 1.60
- #if defined(_M_AMD64) || defined(__amd64__)
- #include "mongo/db/fts/unicode/byte_vector_sse2.h"
--#elif defined(__powerpc64__)
--#include "mongo/db/fts/unicode/byte_vector_altivec.h"
- #else // Other platforms go above here.
- #undef MONGO_HAVE_FAST_BYTE_VECTOR
- #endif
+diff --git a/src/mongo/db/fts/unicode/byte_vector_altivec.h b/src/mongo/db/fts/unicode/byte_vector_altivec.h
+index f7a07ac074..74a6441c00 100644
+--- a/src/mongo/db/fts/unicode/byte_vector_altivec.h
++++ b/src/mongo/db/fts/unicode/byte_vector_altivec.h
+@@ -98,7 +98,7 @@ public:
+ // big endian by comparison.
+ const Native bits = {120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0};
+
+- return vec_extract(vec_vbpermq(_data, bits), 0);
++ return vec_extract(vec_vbpermq(_data, bits), 1);
+ }
+
+ /**
diff --git a/python3-buildscripts-tests.patch b/python3-buildscripts-tests.patch
index f2d9c79..5bf9f72 100644
--- a/python3-buildscripts-tests.patch
+++ b/python3-buildscripts-tests.patch
@@ -1,5 +1,5 @@
diff --git a/SConstruct b/SConstruct
-index f949f65..78eab69 100644
+index f949f65475..78eab698b9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -383,7 +383,7 @@ win_version_min_choices = {
@@ -47,216 +47,8 @@ index f949f65..78eab69 100644
blacklist_options=["-fsanitize-blacklist=%s" % blackfile
for blackfile in blackfiles
if os.stat(blackfile.path).st_size != 0]
-diff --git a/buildscripts/aggregate_tracefiles.py b/buildscripts/aggregate_tracefiles.py
-index 8f1db78..0b4bfd2 100644
---- a/buildscripts/aggregate_tracefiles.py
-+++ b/buildscripts/aggregate_tracefiles.py
-@@ -16,7 +16,7 @@ def aggregate(inputs, output):
-
- args += ['-o', output]
-
-- print ' '.join(args)
-+ print(' '.join(args))
-
- return subprocess.call(args)
-
-diff --git a/buildscripts/buildlogger.py b/buildscripts/buildlogger.py
-index 163c10a..fd2c095 100644
---- a/buildscripts/buildlogger.py
-+++ b/buildscripts/buildlogger.py
-@@ -45,8 +45,8 @@ import subprocess
- import sys
- import time
- import traceback
--import urllib2
--import utils
-+import urllib.request, urllib.error, urllib.parse
-+from . import utils
-
- # suppress deprecation warnings that happen when
- # we import the 'buildbot.tac' file below
-@@ -82,7 +82,7 @@ for path in possible_paths:
- if os.path.isfile(credentials_path):
- credentials = {}
- try:
-- execfile(credentials_path, credentials, credentials)
-+ exec(compile(open(credentials_path).read(), credentials_path, 'exec'), credentials, credentials)
- username = credentials.get('slavename', credentials.get('username'))
- password = credentials.get('passwd', credentials.get('password'))
- break
-@@ -94,14 +94,14 @@ URL_ROOT = os.environ.get('BUILDLOGGER_URL', 'http://buildlogs.mongodb.org/')
- TIMEOUT_SECONDS = 10
- socket.setdefaulttimeout(TIMEOUT_SECONDS)
-
--auth_handler = urllib2.HTTPBasicAuthHandler()
-+auth_handler = urllib.request.HTTPBasicAuthHandler()
- auth_handler.add_password(
- realm='buildlogs',
- uri=URL_ROOT,
- user=username,
- passwd=password)
-
--url_opener = urllib2.build_opener(auth_handler, urllib2.HTTPErrorProcessor())
-+url_opener = urllib.request.build_opener(auth_handler, urllib2.HTTPErrorProcessor())
-
- def url(endpoint):
- if not endpoint.endswith('/'):
-@@ -115,10 +115,10 @@ def post(endpoint, data, headers=None):
- headers = headers or {}
- headers.update({'Content-Type': 'application/json; charset=utf-8'})
-
-- req = urllib2.Request(url=url(endpoint), data=data, headers=headers)
-+ req = urllib.request.Request(url=url(endpoint), data=data, headers=headers)
- try:
- response = url_opener.open(req)
-- except urllib2.URLError:
-+ except urllib.error.URLError:
- import traceback
- traceback.print_exc(file=sys.stderr)
- sys.stderr.flush()
-@@ -145,7 +145,7 @@ def traceback_to_stderr(func):
- def wrapper(*args, **kwargs):
- try:
- return func(*args, **kwargs)
-- except urllib2.HTTPError, err:
-+ except urllib.error.HTTPError as err:
- sys.stderr.write('error: HTTP code %d\n----\n' % err.code)
- if hasattr(err, 'hdrs'):
- for k, v in err.hdrs.items():
-diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py
-index a78c905..2255e97 100644
---- a/buildscripts/burn_in_tests.py
-+++ b/buildscripts/burn_in_tests.py
-@@ -16,7 +16,7 @@ import re
- import requests
- import shlex
- import sys
--import urlparse
-+import urllib.parse
- import yaml
-
-
-@@ -114,7 +114,7 @@ def find_last_activated_task(revisions, variant, branch_name):
- evg_cfg = read_evg_config()
- if evg_cfg is not None and "api_server_host" in evg_cfg:
- api_server = "{url.scheme}://{url.netloc}".format(
-- url=urlparse.urlparse(evg_cfg["api_server_host"]))
-+ url=urllib.parse.urlparse(evg_cfg["api_server_host"]))
- else:
- api_server = API_SERVER_DEFAULT
-
-@@ -161,7 +161,7 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
- # commit among 'revs_to_check' that's been activated in Evergreen. We handle this by
- # only considering tests changed in the current commit.
- last_activated = "HEAD"
-- print "Comparing current branch against", last_activated
-+ print("Comparing current branch against", last_activated)
- revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
- base_commit = last_activated
- else:
-@@ -169,10 +169,10 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
-
- revision_count = len(revisions)
- if revision_count > max_revisions:
-- print "There are too many revisions included (%d)." % revision_count, \
-+ print("There are too many revisions included (%d)." % revision_count, \
- "This is likely because your base branch is not " + branch_name + ".", \
- "You can allow us to review more than 25 revisions by using", \
-- "the --maxRevisions option."
-+ "the --maxRevisions option.")
- return changed_tests
-
- changed_files = callo(["git", "diff", "--name-only", base_commit]).splitlines()
-@@ -279,7 +279,7 @@ def create_task_list(evergreen_conf, buildvariant, suites, exclude_tasks):
-
- evg_buildvariant = evergreen_conf.get_variant(buildvariant)
- if not evg_buildvariant:
-- print "Buildvariant", buildvariant, "not found in", evergreen_conf.path
-+ print("Buildvariant", buildvariant, "not found in", evergreen_conf.path)
- sys.exit(1)
-
- # Find all the buildvariant task's resmoke_args.
-@@ -366,9 +366,9 @@ def main():
- evergreen_conf = evergreen.EvergreenProjectConfig(values.evergreen_file)
-
- if values.buildvariant is None:
-- print "Option buildVariant must be specified to find changed tests.\n", \
-+ print("Option buildVariant must be specified to find changed tests.\n", \
- "Select from the following: \n" \
-- "\t", "\n\t".join(sorted(evergreen_conf.variant_names))
-+ "\t", "\n\t".join(sorted(evergreen_conf.variant_names)))
- sys.exit(1)
-
- changed_tests = find_changed_tests(values.branch,
-@@ -380,7 +380,7 @@ def main():
- changed_tests = filter_tests(changed_tests, exclude_tests)
- # If there are no changed tests, exit cleanly.
- if not changed_tests:
-- print "No new or modified tests found."
-+ print("No new or modified tests found.")
- _write_report_file({}, values.test_list_outfile)
- sys.exit(0)
- suites = resmokelib.parser.get_suites(values, changed_tests)
-@@ -403,7 +403,7 @@ def main():
- try:
- subprocess.check_call(resmoke_cmd, shell=False)
- except subprocess.CalledProcessError as err:
-- print "Resmoke returned an error with task:", task
-+ print("Resmoke returned an error with task:", task)
- _save_report_data(test_results, values.report_file, task)
- _write_report_file(test_results, values.report_file)
- sys.exit(err.returncode)
-diff --git a/buildscripts/ciconfig/evergreen.py b/buildscripts/ciconfig/evergreen.py
-index 9a4f7a9..9cb6c3f 100644
---- a/buildscripts/ciconfig/evergreen.py
-+++ b/buildscripts/ciconfig/evergreen.py
-@@ -30,7 +30,7 @@ class EvergreenProjectConfig(object):
- @property
- def task_names(self):
- """The list of task names."""
-- return self._tasks_by_name.keys()
-+ return list(self._tasks_by_name.keys())
-
- def get_task(self, task_name):
- """Return the task with the given name as a Task instance."""
-@@ -52,7 +52,7 @@ class EvergreenProjectConfig(object):
- @property
- def variant_names(self):
- """The list of build variant names."""
-- return self._variants_by_name.keys()
-+ return list(self._variants_by_name.keys())
-
- def get_variant(self, variant_name):
- """Return the variant with the given name as a Variant instance."""
-diff --git a/buildscripts/ciconfig/tags.py b/buildscripts/ciconfig/tags.py
-index 418d0e3..bfdb25c 100644
---- a/buildscripts/ciconfig/tags.py
-+++ b/buildscripts/ciconfig/tags.py
-@@ -12,7 +12,7 @@ import yaml
-
- # Setup to preserve order in yaml.dump, see https://stackoverflow.com/a/8661021
- def _represent_dict_order(self, data):
-- return self.represent_mapping("tag:yaml.org,2002:map", data.items())
-+ return self.represent_mapping("tag:yaml.org,2002:map", list(data.items()))
-
- yaml.add_representer(collections.OrderedDict, _represent_dict_order)
- # End setup
-@@ -55,11 +55,11 @@ class TagsConfig(object):
-
- def get_test_kinds(self):
- """List the test kinds."""
-- return self._conf.keys()
-+ return list(self._conf.keys())
-
- def get_test_patterns(self, test_kind):
- """List the test patterns under 'test_kind'."""
-- return getdefault(self._conf, test_kind, {}).keys()
-+ return list(getdefault(self._conf, test_kind, {}).keys())
-
- def get_tags(self, test_kind, test_pattern):
- """List the tags under 'test_kind' and 'test_pattern'."""
diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py
-index cf9884d..c0f4140 100755
+index cf9884d8b1..c0f4140e59 100755
--- a/buildscripts/clang_format.py
+++ b/buildscripts/clang_format.py
@@ -20,7 +20,7 @@ import sys
@@ -291,21 +83,8 @@ index cf9884d..c0f4140 100755
else:
repo.commit(["--all", "--amend", "--no-edit"])
-diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py
-index b599dc8..485109c 100644
---- a/buildscripts/cleanbb.py
-+++ b/buildscripts/cleanbb.py
-@@ -79,7 +79,7 @@ def tryToRemove(path):
-
- def cleanup( root , nokill ):
- if nokill:
-- print "nokill requested, not killing anybody"
-+ print("nokill requested, not killing anybody")
- else:
- if killprocs( root=root ) > 0:
- time.sleep(3)
diff --git a/buildscripts/cpplint.py b/buildscripts/cpplint.py
-index c6aa51b..ed9cdb3 100755
+index 6979cbcd4e..bc9ff038fd 100755
--- a/buildscripts/cpplint.py
+++ b/buildscripts/cpplint.py
@@ -835,7 +835,7 @@ class _CppLintState(object):
@@ -326,7 +105,7 @@ index c6aa51b..ed9cdb3 100755
char = line[i]
if char in '([{':
# Found start of parenthesized expression, push to expression stack
-@@ -1687,7 +1687,7 @@ def CheckForCopyright(filename, lines, error):
+@@ -1681,7 +1681,7 @@ def CheckForCopyright(filename, lines, error):
# We'll say it should occur by line 10. Don't forget there's a
# dummy line at the front.
@@ -335,7 +114,7 @@ index c6aa51b..ed9cdb3 100755
if re.search(r'Copyright', lines[line], re.I): break
else: # means no copyright line was found
error(filename, 0, 'legal/copyright', 5,
-@@ -1838,7 +1838,7 @@ def CheckForBadCharacters(filename, lines, error):
+@@ -1832,7 +1832,7 @@ def CheckForBadCharacters(filename, lines, error):
error: The function to call with any errors found.
"""
for linenum, line in enumerate(lines):
@@ -344,7 +123,7 @@ index c6aa51b..ed9cdb3 100755
error(filename, linenum, 'readability/utf8', 5,
'Line contains invalid UTF-8 (or Unicode replacement character).')
if '\0' in line:
-@@ -2884,7 +2884,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum,
+@@ -2878,7 +2878,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum,
if starting_func:
body_found = False
@@ -353,7 +132,7 @@ index c6aa51b..ed9cdb3 100755
start_line = lines[start_linenum]
joined_line += ' ' + start_line.lstrip()
if Search(r'(;|})', start_line): # Declarations and trivial functions
-@@ -3361,7 +3361,7 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error):
+@@ -3355,7 +3355,7 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error):
trailing_text = ''
if endpos > -1:
trailing_text = endline[endpos:]
@@ -362,7 +141,7 @@ index c6aa51b..ed9cdb3 100755
min(endlinenum + 3, clean_lines.NumLines() - 1)):
trailing_text += clean_lines.elided[offset]
if not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text):
-@@ -3530,7 +3530,7 @@ def IsRValueType(clean_lines, nesting_state, linenum, column):
+@@ -3524,7 +3524,7 @@ def IsRValueType(clean_lines, nesting_state, linenum, column):
# Look for the previous 'for(' in the previous lines.
before_text = match_symbol.group(1)
@@ -371,7 +150,7 @@ index c6aa51b..ed9cdb3 100755
before_text = clean_lines.elided[i] + before_text
if Search(r'for\s*\([^{};]*$', before_text):
# This is the condition inside a for-loop
-@@ -3657,12 +3657,12 @@ def IsRValueAllowed(clean_lines, linenum):
+@@ -3651,12 +3651,12 @@ def IsRValueAllowed(clean_lines, linenum):
True if line is within the region where RValue references are allowed.
"""
# Allow region marked by PUSH/POP macros
@@ -386,7 +165,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[j]
if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line):
return line.endswith('POP')
-@@ -4142,7 +4142,7 @@ def CheckCheck(filename, clean_lines, linenum, error):
+@@ -4136,7 +4136,7 @@ def CheckCheck(filename, clean_lines, linenum, error):
expression = lines[linenum][start_pos + 1:end_pos - 1]
else:
expression = lines[linenum][start_pos + 1:]
@@ -395,7 +174,7 @@ index c6aa51b..ed9cdb3 100755
expression += lines[i]
expression += last_line[0:end_pos - 1]
-@@ -4270,7 +4270,7 @@ def GetLineWidth(line):
+@@ -4264,7 +4264,7 @@ def GetLineWidth(line):
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
@@ -404,7 +183,7 @@ index c6aa51b..ed9cdb3 100755
width = 0
for uc in unicodedata.normalize('NFC', line):
if unicodedata.east_asian_width(uc) in ('W', 'F'):
-@@ -4623,7 +4623,7 @@ def _GetTextInside(text, start_pattern):
+@@ -4617,7 +4617,7 @@ def _GetTextInside(text, start_pattern):
# Give opening punctuations to get the matching close-punctuations.
matching_punctuation = {'(': ')', '{': '}', '[': ']'}
@@ -413,7 +192,7 @@ index c6aa51b..ed9cdb3 100755
# Find the position to start extracting text.
match = re.search(start_pattern, text, re.M)
-@@ -4949,7 +4949,7 @@ def IsDerivedFunction(clean_lines, linenum):
+@@ -4943,7 +4943,7 @@ def IsDerivedFunction(clean_lines, linenum):
virt-specifier.
"""
# Scan back a few lines for start of current function
@@ -422,7 +201,7 @@ index c6aa51b..ed9cdb3 100755
match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i])
if match:
# Look for "override" after the matching closing parenthesis
-@@ -4970,7 +4970,7 @@ def IsInitializerList(clean_lines, linenum):
+@@ -4964,7 +4964,7 @@ def IsInitializerList(clean_lines, linenum):
True if current line appears to be inside constructor initializer
list, False otherwise.
"""
@@ -431,7 +210,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[i]
if i == linenum:
remove_function_body = Match(r'^(.*)\{\s*$', line)
-@@ -5066,7 +5066,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5060,7 +5060,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# Found the matching < on an earlier line, collect all
# pieces up to current line.
line = ''
@@ -440,7 +219,7 @@ index c6aa51b..ed9cdb3 100755
line += clean_lines.elided[i].strip()
# Check for non-const references in function parameters. A single '&' may
-@@ -5090,7 +5090,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5084,7 +5084,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# appear inside the second set of parentheses on the current line as
# opposed to the first set.
if linenum > 0:
@@ -449,7 +228,7 @@ index c6aa51b..ed9cdb3 100755
previous_line = clean_lines.elided[i]
if not Search(r'[),]\s*$', previous_line):
break
-@@ -5121,7 +5121,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
+@@ -5115,7 +5115,7 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
# Don't see a whitelisted function on this line. Actually we
# didn't see any function name on this line, so this is likely a
# multi-line parameter list. Try a bit harder to catch this case.
@@ -458,7 +237,7 @@ index c6aa51b..ed9cdb3 100755
if (linenum > i and
Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
return
-@@ -5283,7 +5283,7 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
+@@ -5277,7 +5277,7 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
# Try expanding current context to see if we one level of
# parentheses inside a macro.
if linenum > 0:
@@ -467,7 +246,7 @@ index c6aa51b..ed9cdb3 100755
context = clean_lines.elided[i] + context
if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', context):
return False
-@@ -5540,7 +5540,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
+@@ -5534,7 +5534,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
required = {} # A map of header name to linenumber and the template entity.
# Example of required: { '<functional>': (1219, 'less<>') }
@@ -476,7 +255,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[linenum]
if not line or line[0] == '#':
continue
-@@ -5589,7 +5589,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
+@@ -5583,7 +5583,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
# include_dict is modified during iteration, so we iterate over a copy of
# the keys.
@@ -485,7 +264,7 @@ index c6aa51b..ed9cdb3 100755
for header in header_keys:
(same_module, common_path) = FilesBelongToSameModule(abs_filename, header)
fullpath = common_path + header
-@@ -5684,7 +5684,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
+@@ -5678,7 +5678,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
end_col = -1
end_line = -1
start_col = len(virtual.group(1))
@@ -494,7 +273,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[start_line][start_col:]
parameter_list = Match(r'^([^(]*)\(', line)
if parameter_list:
-@@ -5699,7 +5699,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
+@@ -5693,7 +5693,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
# Look for "override" or "final" after the parameter list
# (possibly on the next few lines).
@@ -503,7 +282,7 @@ index c6aa51b..ed9cdb3 100755
line = clean_lines.elided[i][end_col:]
match = Search(r'\b(override|final)\b', line)
if match:
-@@ -5926,7 +5926,7 @@ def ProcessFileData(filename, file_extension, lines, error,
+@@ -5920,7 +5920,7 @@ def ProcessFileData(filename, file_extension, lines, error,
RemoveMultiLineComments(filename, lines, error)
clean_lines = CleansedLines(lines)
@@ -513,7 +292,7 @@ index c6aa51b..ed9cdb3 100755
include_state, function_state, nesting_state, error,
extra_check_functions)
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py
-index cc46789..7351e6a 100755
+index cc46789907..7351e6a12e 100755
--- a/buildscripts/errorcodes.py
+++ b/buildscripts/errorcodes.py
@@ -5,13 +5,16 @@
@@ -606,7 +385,7 @@ index cc46789..7351e6a 100755
diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py
-index c1ab04f..d5c6aef 100755
+index c1ab04fbab..d5c6aef4fc 100755
--- a/buildscripts/eslint.py
+++ b/buildscripts/eslint.py
@@ -18,7 +18,7 @@ import sys
@@ -627,92 +406,8 @@ index c1ab04f..d5c6aef 100755
eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(platform=platform, arch=arch)
extract_eslint(temp_tar_file, eslint_distfile)
-diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py
-index 98dc66d..9538c29 100644
---- a/buildscripts/gdb/mongo_lock.py
-+++ b/buildscripts/gdb/mongo_lock.py
-@@ -231,8 +231,8 @@ def find_mutex_holder(graph, thread_dict, show):
- mutex_waiter_lwpid))
- if graph:
- graph.add_edge(Thread(mutex_waiter_id, mutex_waiter_lwpid),
-- Lock(long(mutex_value), "Mutex"))
-- graph.add_edge(Lock(long(mutex_value), "Mutex"), Thread(mutex_holder_id, mutex_holder))
-+ Lock(int(mutex_value), "Mutex"))
-+ graph.add_edge(Lock(int(mutex_value), "Mutex"), Thread(mutex_holder_id, mutex_holder))
-
-
- def find_lock_manager_holders(graph, thread_dict, show):
-@@ -262,8 +262,8 @@ def find_lock_manager_holders(graph, thread_dict, show):
- lock_head, lock_request["mode"], lock_thread_id, lock_thread_lwpid) +
- " waited on by thread 0x{:x} (LWP {})".format(thread_dict[lwpid], lwpid))
- if graph:
-- graph.add_edge(Thread(thread_dict[lwpid], lwpid), Lock(long(lock_head), "MongoDB lock"))
-- graph.add_edge(Lock(long(lock_head), "MongoDB lock"),
-+ graph.add_edge(Thread(thread_dict[lwpid], lwpid), Lock(int(lock_head), "MongoDB lock"))
-+ graph.add_edge(Lock(int(lock_head), "MongoDB lock"),
- Thread(lock_thread_id, lock_thread_lwpid))
- lock_request_ptr = lock_request["next"]
-
-diff --git a/buildscripts/hang_analyzer.py b/buildscripts/hang_analyzer.py
-index d554e67..0cca026 100755
---- a/buildscripts/hang_analyzer.py
-+++ b/buildscripts/hang_analyzer.py
-@@ -12,7 +12,7 @@ A prototype hang analyzer for Evergreen integration to help investigate test tim
- Supports Linux, MacOS X, Solaris, and Windows.
- """
-
--import StringIO
-+import io
- import csv
- import glob
- import itertools
-@@ -177,7 +177,7 @@ class WindowsProcessList(object):
-
- ret = callo([ps, "/FO", "CSV"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b)
-
- p = [[int(row[1]), row[0]] for row in csvReader if row[1] != "PID"]
-@@ -270,7 +270,7 @@ class DarwinProcessList(object):
-
- ret = callo([ps, "-axco", "pid,comm"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), row[1]] for row in csvReader if row[0] != "PID"]
-@@ -411,7 +411,7 @@ class LinuxProcessList(object):
-
- ret = callo([ps, "-eo", "pid,args"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), os.path.split(row[1])[1]] for row in csvReader if row[0] != "PID"]
-@@ -433,7 +433,7 @@ class SolarisProcessList(object):
-
- ret = callo([ps, "-eo", "pid,args"], logger)
-
-- b = StringIO.StringIO(ret)
-+ b = io.StringIO(ret)
- csvReader = csv.reader(b, delimiter=' ', quoting=csv.QUOTE_NONE, skipinitialspace=True)
-
- p = [[int(row[0]), os.path.split(row[1])[1]] for row in csvReader if row[0] != "PID"]
-@@ -545,7 +545,7 @@ def signal_process(logger, pid, signalnum):
-
- logger.info("Waiting for process to report")
- time.sleep(5)
-- except OSError, e:
-+ except OSError as e:
- logger.error("Hit OS error trying to signal process: %s" % str(e))
-
- except AttributeError:
diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py
-index 354acca..9612e39 100644
+index 354acca974..9612e39305 100644
--- a/buildscripts/idl/idl/binder.py
+++ b/buildscripts/idl/idl/binder.py
@@ -608,7 +608,7 @@ def _validate_enum_int(ctxt, idl_enum):
@@ -725,7 +420,7 @@ index 354acca..9612e39 100644
if valid_int != int_values_set:
ctxt.add_enum_non_continuous_range_error(idl_enum, idl_enum.name)
diff --git a/buildscripts/idl/idl/bson.py b/buildscripts/idl/idl/bson.py
-index 214b67a..b84421d 100644
+index 214b67a7bf..b84421d657 100644
--- a/buildscripts/idl/idl/bson.py
+++ b/buildscripts/idl/idl/bson.py
@@ -141,7 +141,7 @@ def cpp_bson_type_name(name):
@@ -738,7 +433,7 @@ index 214b67a..b84421d 100644
def is_valid_bindata_subtype(name):
diff --git a/buildscripts/idl/idl/cpp_types.py b/buildscripts/idl/idl/cpp_types.py
-index aafcf87..e989664 100644
+index aafcf87224..e989664eee 100644
--- a/buildscripts/idl/idl/cpp_types.py
+++ b/buildscripts/idl/idl/cpp_types.py
@@ -28,6 +28,7 @@ from . import writer
@@ -776,7 +471,7 @@ index aafcf87..e989664 100644
# type: (ast.Field) -> None
"""Construct a BsonCppTypeBase."""
diff --git a/buildscripts/idl/idl/enum_types.py b/buildscripts/idl/idl/enum_types.py
-index 3caed6f..f17c926 100644
+index 3caed6f67d..f17c926748 100644
--- a/buildscripts/idl/idl/enum_types.py
+++ b/buildscripts/idl/idl/enum_types.py
@@ -29,11 +29,11 @@ from . import common
@@ -813,7 +508,7 @@ index 3caed6f..f17c926 100644
# type: (Union[syntax.Enum,ast.Enum]) -> None
super(_EnumTypeString, self).__init__(idl_enum)
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
-index 9f591ec..8f97abf 100644
+index 9f591eccc4..8f97abf28c 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -33,6 +33,7 @@ from . import enum_types
@@ -860,7 +555,7 @@ index 9f591ec..8f97abf 100644
def generate_code(spec, output_base_dir, header_file_name, source_file_name):
diff --git a/buildscripts/idl/idl/parser.py b/buildscripts/idl/idl/parser.py
-index fd0af9b..ac36a3a 100644
+index fd0af9b144..ac36a3a280 100644
--- a/buildscripts/idl/idl/parser.py
+++ b/buildscripts/idl/idl/parser.py
@@ -30,6 +30,7 @@ from . import common
@@ -885,7 +580,7 @@ index fd0af9b..ac36a3a 100644
# type: () -> None
"""Construct a ImportResolver."""
diff --git a/buildscripts/idl/idl/struct_types.py b/buildscripts/idl/idl/struct_types.py
-index 9e2a950..cd46e7c 100644
+index 9e2a9504ac..cd46e7c0ff 100644
--- a/buildscripts/idl/idl/struct_types.py
+++ b/buildscripts/idl/idl/struct_types.py
@@ -23,6 +23,7 @@ from . import ast
@@ -910,7 +605,7 @@ index 9e2a950..cd46e7c 100644
def get_constructor_method(self):
# type: () -> MethodInfo
diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py
-index 056d2e9..ff9a395 100644
+index 056d2e9dc3..ff9a3953db 100644
--- a/buildscripts/idl/idl/syntax.py
+++ b/buildscripts/idl/idl/syntax.py
@@ -82,7 +82,7 @@ def _item_and_type(dic):
@@ -923,7 +618,7 @@ index 056d2e9..ff9a395 100644
class SymbolTable(object):
diff --git a/buildscripts/idl/tests/test_binder.py b/buildscripts/idl/tests/test_binder.py
-index 5502b69..b0f4ba4 100644
+index 5502b69d36..b0f4ba4269 100644
--- a/buildscripts/idl/tests/test_binder.py
+++ b/buildscripts/idl/tests/test_binder.py
@@ -72,7 +72,7 @@ class TestBinder(testcase.IDLTestcase):
@@ -936,7 +631,7 @@ index 5502b69..b0f4ba4 100644
def test_type_positive(self):
diff --git a/buildscripts/lint.py b/buildscripts/lint.py
-index d4061a9..b1ca5b6 100644
+index d4061a9b04..b1ca5b6169 100644
--- a/buildscripts/lint.py
+++ b/buildscripts/lint.py
@@ -2,8 +2,8 @@
@@ -951,7 +646,7 @@ index d4061a9..b1ca5b6 100644
class CheckForConfigH:
def __init__(self):
diff --git a/buildscripts/linter/base.py b/buildscripts/linter/base.py
-index ae78d52..7988876 100644
+index ae78d52066..7988876c98 100644
--- a/buildscripts/linter/base.py
+++ b/buildscripts/linter/base.py
@@ -5,12 +5,11 @@ from __future__ import print_function
@@ -970,7 +665,7 @@ index ae78d52..7988876 100644
# type: (str, str) -> None
"""
diff --git a/buildscripts/linter/git.py b/buildscripts/linter/git.py
-index edde6d0..4680e2f 100644
+index edde6d0a49..4680e2f5fd 100644
--- a/buildscripts/linter/git.py
+++ b/buildscripts/linter/git.py
@@ -175,7 +175,7 @@ def get_files_to_check_from_patch(patches, filter_function):
@@ -983,7 +678,7 @@ index edde6d0..4680e2f 100644
candidates = [check.match(line).group(1) for line in lines if check.match(line)]
diff --git a/buildscripts/linter/parallel.py b/buildscripts/linter/parallel.py
-index 0648bfb..361da0c 100644
+index 0648bfb16e..361da0c559 100644
--- a/buildscripts/linter/parallel.py
+++ b/buildscripts/linter/parallel.py
@@ -2,7 +2,12 @@
@@ -1018,258 +713,8 @@ index 0648bfb..361da0c 100644
# if the queue is empty, exit the worker thread
pp_event.set()
return
-diff --git a/buildscripts/make_archive.py b/buildscripts/make_archive.py
-index 2671fa5..91e2bf0 100755
---- a/buildscripts/make_archive.py
-+++ b/buildscripts/make_archive.py
-@@ -95,14 +95,14 @@ def make_tar_archive(opts):
- enclosing_file_directory = os.path.dirname(temp_file_location)
- if not os.path.exists(enclosing_file_directory):
- os.makedirs(enclosing_file_directory)
-- print "copying %s => %s" % (input_filename, temp_file_location)
-+ print("copying %s => %s" % (input_filename, temp_file_location))
- if os.path.isdir(input_filename):
- shutil.copytree(input_filename, temp_file_location)
- else:
- shutil.copy2(input_filename, temp_file_location)
- tar_command.append(preferred_filename)
-
-- print " ".join(tar_command)
-+ print(" ".join(tar_command))
- # execute the full tar command
- run_directory = os.path.join(os.getcwd(), enclosing_archive_directory)
- proc = Popen(tar_command, stdout=PIPE, stderr=STDOUT, bufsize=0, cwd=run_directory)
-@@ -165,7 +165,7 @@ def parse_options(args):
- opts.transformations = [
- xform.replace(os.path.altsep or os.path.sep, os.path.sep).split('=', 1)
- for xform in opts.transformations]
-- except Exception, e:
-+ except Exception as e:
- parser.error(e)
-
- return opts
-diff --git a/buildscripts/make_vcxproj.py b/buildscripts/make_vcxproj.py
-index e4c2d7a..693352f 100644
---- a/buildscripts/make_vcxproj.py
-+++ b/buildscripts/make_vcxproj.py
-@@ -241,12 +241,12 @@ class ProjFileGenerator(object):
-
- def main():
- if len(sys.argv) != 2:
-- print r"Usage: python buildscripts\make_vcxproj.py FILE_NAME"
-+ print(r"Usage: python buildscripts\make_vcxproj.py FILE_NAME")
- return
-
- with ProjFileGenerator(sys.argv[1]) as projfile:
-- with open("compile_commands.json", "rb") as sjh:
-- contents = sjh.read().decode('utf-8')
-+ with open("compile_commands.json", "r") as sjh:
-+ contents = sjh.read()
- commands = json.loads(contents)
-
- for command in commands:
-diff --git a/buildscripts/mongosymb.py b/buildscripts/mongosymb.py
-index 4da0535..b0aba4d 100755
---- a/buildscripts/mongosymb.py
-+++ b/buildscripts/mongosymb.py
-@@ -36,7 +36,7 @@ def symbolize_frames(trace_doc, dbg_path_resolver, symbolizer_path=None, dsym_hi
- """Makes a map from binary load address to description of library from the somap, which is
- a list of dictionaries describing individual loaded libraries.
- """
-- return { so_entry["b"] : so_entry for so_entry in somap_list if so_entry.has_key("b") }
-+ return { so_entry["b"] : so_entry for so_entry in somap_list if "b" in so_entry }
-
- base_addr_map = make_base_addr_map(trace_doc["processInfo"]["somap"])
-
-@@ -50,7 +50,7 @@ def symbolize_frames(trace_doc, dbg_path_resolver, symbolizer_path=None, dsym_hi
- addr_base = frame["b"]
- else:
- addr_base = soinfo.get("vmaddr", "0")
-- addr = long(addr_base, 16) + long(frame["o"], 16)
-+ addr = int(addr_base, 16) + int(frame["o"], 16)
- # addr currently points to the return address which is the one *after* the call. x86 is
- # variable length so going backwards is difficult. However llvm-symbolizer seems to do the
- # right thing if we just subtract 1 byte here. This has the downside of also adjusting the
-diff --git a/buildscripts/msitrim.py b/buildscripts/msitrim.py
-index 45ca8d4..b5781ed 100644
---- a/buildscripts/msitrim.py
-+++ b/buildscripts/msitrim.py
-@@ -29,7 +29,7 @@ def exec_update(query, column, value):
- view.Close()
-
-
--print "Trimming MSI"
-+print("Trimming MSI")
-
- db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT)
-
-diff --git a/buildscripts/packager-enterprise.py b/buildscripts/packager-enterprise.py
-index 8629be1..202a676 100755
---- a/buildscripts/packager-enterprise.py
-+++ b/buildscripts/packager-enterprise.py
-@@ -30,7 +30,7 @@ import argparse
- import errno
- import getopt
- from glob import glob
--import packager
-+from . import packager
- import os
- import re
- import shutil
-@@ -39,7 +39,7 @@ import subprocess
- import sys
- import tempfile
- import time
--import urlparse
-+import urllib.parse
-
- # The MongoDB names for the architectures we support.
- ARCH_CHOICES=["x86_64", "ppc64le", "s390x", "arm64"]
-@@ -153,7 +153,7 @@ def main(argv):
- if prefix is None:
- prefix=tempfile.mkdtemp()
-
-- print "Working in directory %s" % prefix
-+ print("Working in directory %s" % prefix)
-
- os.chdir(prefix)
- try:
-@@ -210,7 +210,7 @@ def unpack_binaries_into(build_os, arch, spec, where):
- os.rename("%s/%s" % (release_dir, releasefile), releasefile)
- os.rmdir(release_dir)
- except Exception:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- os.chdir(rootdir)
- raise exc
- os.chdir(rootdir)
-@@ -226,7 +226,7 @@ def make_package(distro, build_os, arch, spec, srcdir):
- # directory, so the debian directory is needed in all cases (and
- # innocuous in the debianoids' sdirs).
- for pkgdir in ["debian", "rpm"]:
-- print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
-+ print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
- # FIXME: sh-dash-cee is bad. See if tarfile can do this.
- packager.sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
- # Splat the binaries and snmp files under sdir. The "build" stages of the
-@@ -304,7 +304,7 @@ def move_repos_into_place(src, dst):
- os.mkdir(dname)
- break
- except OSError:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -324,7 +324,7 @@ def move_repos_into_place(src, dst):
- os.symlink(dname, tmpnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -342,7 +342,7 @@ def move_repos_into_place(src, dst):
- os.symlink(os.readlink(dst), oldnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-diff --git a/buildscripts/packager.py b/buildscripts/packager.py
-index c821da9..19d34b3 100755
---- a/buildscripts/packager.py
-+++ b/buildscripts/packager.py
-@@ -343,7 +343,7 @@ def main(argv):
- prefix = args.prefix
- if prefix is None:
- prefix = tempfile.mkdtemp()
-- print "Working in directory %s" % prefix
-+ print("Working in directory %s" % prefix)
-
- os.chdir(prefix)
- try:
-@@ -382,14 +382,14 @@ def crossproduct(*seqs):
-
- def sysassert(argv):
- """Run argv and assert that it exited with status 0."""
-- print "In %s, running %s" % (os.getcwd(), " ".join(argv))
-+ print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
- sys.stdout.flush()
- sys.stderr.flush()
- assert(subprocess.Popen(argv).wait()==0)
-
- def backtick(argv):
- """Run argv and return its output string."""
-- print "In %s, running %s" % (os.getcwd(), " ".join(argv))
-+ print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
- sys.stdout.flush()
- sys.stderr.flush()
- return subprocess.Popen(argv, stdout=subprocess.PIPE).communicate()[0]
-@@ -421,11 +421,11 @@ def unpack_binaries_into(build_os, arch, spec, where):
- sysassert(["tar", "xvzf", rootdir+"/"+tarfile(build_os, arch, spec)])
- release_dir = glob('mongodb-linux-*')[0]
- for releasefile in "bin", "GNU-AGPL-3.0", "README", "THIRD-PARTY-NOTICES", "MPL-2":
-- print "moving file: %s/%s" % (release_dir, releasefile)
-+ print("moving file: %s/%s" % (release_dir, releasefile))
- os.rename("%s/%s" % (release_dir, releasefile), releasefile)
- os.rmdir(release_dir)
- except Exception:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- os.chdir(rootdir)
- raise exc
- os.chdir(rootdir)
-@@ -441,7 +441,7 @@ def make_package(distro, build_os, arch, spec, srcdir):
- # directory, so the debian directory is needed in all cases (and
- # innocuous in the debianoids' sdirs).
- for pkgdir in ["debian", "rpm"]:
-- print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
-+ print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
- # FIXME: sh-dash-cee is bad. See if tarfile can do this.
- sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
- # Splat the binaries under sdir. The "build" stages of the
-@@ -574,7 +574,7 @@ def move_repos_into_place(src, dst):
- os.mkdir(dname)
- break
- except OSError:
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -594,7 +594,7 @@ def move_repos_into_place(src, dst):
- os.symlink(dname, tmpnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -612,7 +612,7 @@ def move_repos_into_place(src, dst):
- os.symlink(os.readlink(dst), oldnam)
- break
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
-@@ -765,7 +765,7 @@ def ensure_dir(filename):
- try:
- os.makedirs(dirpart)
- except OSError: # as exc: # Python >2.5
-- exc=sys.exc_value
-+ exc=sys.exc_info()[1]
- if exc.errno == errno.EEXIST:
- pass
- else:
diff --git a/buildscripts/resmokeconfig/loggers/__init__.py b/buildscripts/resmokeconfig/loggers/__init__.py
-index 6511d49..454f675 100644
+index 6511d49636..454f675ca2 100644
--- a/buildscripts/resmokeconfig/loggers/__init__.py
+++ b/buildscripts/resmokeconfig/loggers/__init__.py
@@ -21,7 +21,7 @@ def _get_named_loggers():
@@ -1282,7 +727,7 @@ index 6511d49..454f675 100644
(short_name, ext) = os.path.splitext(filename)
if ext in (".yml", ".yaml"):
diff --git a/buildscripts/resmokeconfig/suites/__init__.py b/buildscripts/resmokeconfig/suites/__init__.py
-index e075dd2..2ca2187 100644
+index e075dd22e0..2ca2187e6e 100644
--- a/buildscripts/resmokeconfig/suites/__init__.py
+++ b/buildscripts/resmokeconfig/suites/__init__.py
@@ -21,7 +21,7 @@ def _get_named_suites():
@@ -1295,7 +740,7 @@ index e075dd2..2ca2187 100644
(short_name, ext) = os.path.splitext(filename)
if ext in (".yml", ".yaml"):
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
-index 1dcd7d7..8a15651 100644
+index 1dcd7d7793..8a15651b4a 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -58,7 +58,7 @@ DEFAULTS = {
@@ -1308,7 +753,7 @@ index 1dcd7d7..8a15651 100644
"shellReadMode": None,
"shellWriteMode": None,
diff --git a/buildscripts/resmokelib/core/process.py b/buildscripts/resmokelib/core/process.py
-index 03fb849..e70f90a 100644
+index 03fb849616..e70f90abb4 100644
--- a/buildscripts/resmokelib/core/process.py
+++ b/buildscripts/resmokelib/core/process.py
@@ -196,8 +196,8 @@ class Process(object):
@@ -1323,10 +768,10 @@ index 03fb849..e70f90a 100644
# Adapted from implementation of Popen.terminate() in subprocess.py of Python 2.7
# because earlier versions do not catch exceptions.
diff --git a/buildscripts/resmokelib/logging/buildlogger.py b/buildscripts/resmokelib/logging/buildlogger.py
-index a577d64..d5405bd 100644
+index 01bba20202..044855cad0 100644
--- a/buildscripts/resmokelib/logging/buildlogger.py
+++ b/buildscripts/resmokelib/logging/buildlogger.py
-@@ -205,7 +205,7 @@ class BuildloggerServer(object):
+@@ -267,7 +267,7 @@ class BuildloggerServer(object):
def __init__(self):
tmp_globals = {}
self.config = {}
@@ -1336,7 +781,7 @@ index a577d64..d5405bd 100644
# Rename "slavename" to "username" if present.
if "slavename" in self.config and "username" not in self.config:
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
-index 3fff181..4395c3b 100644
+index 3fff181c18..4395c3b2cf 100644
--- a/buildscripts/resmokelib/selector.py
+++ b/buildscripts/resmokelib/selector.py
@@ -66,7 +66,7 @@ class TestFileExplorer(object):
@@ -1358,7 +803,7 @@ index 3fff181..4395c3b 100644
if key == "$allOf":
return _AllOfExpression(_make_expression_list(value))
diff --git a/buildscripts/resmokelib/testing/executor.py b/buildscripts/resmokelib/testing/executor.py
-index cc66556..db8d385 100644
+index 9574111904..d92209a7b1 100644
--- a/buildscripts/resmokelib/testing/executor.py
+++ b/buildscripts/resmokelib/testing/executor.py
@@ -64,7 +64,7 @@ class TestSuiteExecutor(object):
@@ -1380,7 +825,7 @@ index cc66556..db8d385 100644
return queue
diff --git a/buildscripts/resmokelib/testing/fixtures/interface.py b/buildscripts/resmokelib/testing/fixtures/interface.py
-index 6dffa24..dfeeb13 100644
+index 6dffa24e43..dfeeb1326d 100644
--- a/buildscripts/resmokelib/testing/fixtures/interface.py
+++ b/buildscripts/resmokelib/testing/fixtures/interface.py
@@ -4,6 +4,7 @@ Interface of the different fixtures for executing JSTests against.
@@ -1407,10 +852,10 @@ index 6dffa24..dfeeb13 100644
# is defined for all subclasses of Fixture.
REGISTERED_NAME = "Fixture"
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py
-index 025ce25..678ef45 100644
+index 5274ffb4c4..49675bd5e9 100644
--- a/buildscripts/resmokelib/testing/fixtures/replicaset.py
+++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py
-@@ -75,7 +75,7 @@ class ReplicaSetFixture(interface.ReplFixture):
+@@ -87,7 +87,7 @@ class ReplicaSetFixture(interface.ReplFixture):
self.replset_name = self.mongod_options.get("replSet", "rs")
if not self.nodes:
@@ -1420,7 +865,7 @@ index 025ce25..678ef45 100644
self.nodes.append(node)
diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
-index 4f90d16..eb96b8b 100644
+index 06e84c213b..47ba407a51 100644
--- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
+++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
@@ -85,7 +85,7 @@ class ShardedClusterFixture(interface.Fixture):
@@ -1433,11 +878,11 @@ index 4f90d16..eb96b8b 100644
shard = self._new_standalone_shard(i)
elif isinstance(self.num_rs_nodes_per_shard, int):
diff --git a/buildscripts/resmokelib/testing/hooks/interface.py b/buildscripts/resmokelib/testing/hooks/interface.py
-index 6ca4ae7..a225a1b 100644
+index cd5200764f..958cc92192 100644
--- a/buildscripts/resmokelib/testing/hooks/interface.py
+++ b/buildscripts/resmokelib/testing/hooks/interface.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import
- from ... import logging
+ from ...logging import loggers
from ...utils import registry
+import six
@@ -1460,7 +905,7 @@ index 6ca4ae7..a225a1b 100644
@staticmethod
diff --git a/buildscripts/resmokelib/testing/suite.py b/buildscripts/resmokelib/testing/suite.py
-index 132a2d7..07262d1 100644
+index 132a2d70d9..07262d194a 100644
--- a/buildscripts/resmokelib/testing/suite.py
+++ b/buildscripts/resmokelib/testing/suite.py
@@ -262,7 +262,7 @@ class Suite(object):
@@ -1473,7 +918,7 @@ index 132a2d7..07262d1 100644
bulleter_sb = []
summary = self._summarize_report(
diff --git a/buildscripts/resmokelib/testing/summary.py b/buildscripts/resmokelib/testing/summary.py
-index bb44472..54da218 100644
+index bb44472caa..54da2181d5 100644
--- a/buildscripts/resmokelib/testing/summary.py
+++ b/buildscripts/resmokelib/testing/summary.py
@@ -17,6 +17,6 @@ def combine(summary1, summary2):
@@ -1485,7 +930,7 @@ index bb44472..54da218 100644
args.append(summary1[i] + summary2[i])
return Summary._make(args)
diff --git a/buildscripts/resmokelib/testing/testcases/interface.py b/buildscripts/resmokelib/testing/testcases/interface.py
-index be7f14a..f736bd5 100644
+index be7f14afd5..f736bd5c36 100644
--- a/buildscripts/resmokelib/testing/testcases/interface.py
+++ b/buildscripts/resmokelib/testing/testcases/interface.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import
@@ -1525,7 +970,7 @@ index be7f14a..f736bd5 100644
# When the TestCase is created by the TestSuiteExecutor (through a call to make_test_case())
diff --git a/buildscripts/resmokelib/testing/testcases/jstest.py b/buildscripts/resmokelib/testing/testcases/jstest.py
-index adb2828..528a974 100644
+index adb28285f0..528a9747a9 100644
--- a/buildscripts/resmokelib/testing/testcases/jstest.py
+++ b/buildscripts/resmokelib/testing/testcases/jstest.py
@@ -235,7 +235,7 @@ class JSTestCase(interface.TestCase):
@@ -1538,7 +983,7 @@ index adb2828..528a974 100644
test_case = self._create_test_case_for_thread(logger, thread_id)
test_cases.append(test_case)
diff --git a/buildscripts/resmokelib/utils/__init__.py b/buildscripts/resmokelib/utils/__init__.py
-index fa782f3..3ce73c9 100644
+index fa782f3430..3ce73c9b64 100644
--- a/buildscripts/resmokelib/utils/__init__.py
+++ b/buildscripts/resmokelib/utils/__init__.py
@@ -43,14 +43,14 @@ def is_string_list(lst):
@@ -1559,7 +1004,7 @@ index fa782f3..3ce73c9 100644
def is_js_file(filename):
diff --git a/buildscripts/resmokelib/utils/globstar.py b/buildscripts/resmokelib/utils/globstar.py
-index 644ebfe..52100d7 100644
+index 644ebfe3e3..52100d7d9d 100644
--- a/buildscripts/resmokelib/utils/globstar.py
+++ b/buildscripts/resmokelib/utils/globstar.py
@@ -145,7 +145,7 @@ def _list_dir(pathname):
@@ -1572,7 +1017,7 @@ index 644ebfe..52100d7 100644
except StopIteration:
return None # 'pathname' directory does not exist
diff --git a/buildscripts/resmokelib/utils/jscomment.py b/buildscripts/resmokelib/utils/jscomment.py
-index 18da788..a393c43 100644
+index 18da788582..a393c43723 100644
--- a/buildscripts/resmokelib/utils/jscomment.py
+++ b/buildscripts/resmokelib/utils/jscomment.py
@@ -39,7 +39,7 @@ def get_tags(pathname):
@@ -1585,7 +1030,7 @@ index 18da788..a393c43 100644
return tags
except yaml.YAMLError as err:
diff --git a/buildscripts/resmokelib/utils/queue.py b/buildscripts/resmokelib/utils/queue.py
-index 80da5e2..41d23d5 100644
+index 80da5e2cc6..41d23d54bf 100644
--- a/buildscripts/resmokelib/utils/queue.py
+++ b/buildscripts/resmokelib/utils/queue.py
@@ -9,15 +9,20 @@ See https://bugs.python.org/issue1167930 for more details.
@@ -1612,488 +1057,8 @@ index 80da5e2..41d23d5 100644
"""
A multi-producer, multi-consumer queue.
"""
-diff --git a/buildscripts/setup_multiversion_mongodb.py b/buildscripts/setup_multiversion_mongodb.py
-index f3cb804..86bea8f 100755
---- a/buildscripts/setup_multiversion_mongodb.py
-+++ b/buildscripts/setup_multiversion_mongodb.py
-@@ -189,7 +189,7 @@ class MultiVersionDownloader(object):
-
- urls = []
- requested_version_parts = get_version_parts(version)
-- for link_version, link_url in self.links.iteritems():
-+ for link_version, link_url in self.links.items():
- link_version_parts = get_version_parts(link_version)
- if link_version_parts[:len(requested_version_parts)] == requested_version_parts:
- # The 'link_version' is a candidate for the requested 'version' if
-@@ -220,11 +220,11 @@ class MultiVersionDownloader(object):
- else:
- print("Falling back to generic architecture.")
-
-- urls.sort(key=lambda (version, _): get_version_parts(version, for_sorting=True))
-+ urls.sort(key=lambda version__: get_version_parts(version__[0], for_sorting=True))
- full_version = urls[-1][0]
- url = urls[-1][1]
- extract_dir = url.split("/")[-1][:-4]
-- file_suffix = os.path.splitext(urlparse.urlparse(url).path)[1]
-+ file_suffix = os.path.splitext(urllib.parse.urlparse(url).path)[1]
-
- # Only download if we don't already have the directory.
- # Note, we cannot detect if 'latest' has already been downloaded, as the name
-diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py
-index 4fdb01d..eda604e 100755
---- a/buildscripts/smoke.py
-+++ b/buildscripts/smoke.py
-@@ -34,7 +34,7 @@
- # jobs on the same host at once. So something's gotta change.
-
- from datetime import datetime
--from itertools import izip
-+
- import glob
- import logging
- from optparse import OptionParser
-@@ -55,11 +55,11 @@ from pymongo import MongoClient
- from pymongo.errors import OperationFailure
- from pymongo import ReadPreference
-
--import cleanbb
--import utils
-+from . import cleanbb
-+from . import utils
-
- try:
-- import cPickle as pickle
-+ import pickle as pickle
- except ImportError:
- import pickle
-
-@@ -133,17 +133,17 @@ class NullMongod(object):
-
-
- def dump_stacks(signal, frame):
-- print "======================================"
-- print "DUMPING STACKS due to SIGUSR1 signal"
-- print "======================================"
-+ print("======================================")
-+ print("DUMPING STACKS due to SIGUSR1 signal")
-+ print("======================================")
- threads = threading.enumerate();
-
-- print "Total Threads: " + str(len(threads))
-+ print("Total Threads: " + str(len(threads)))
-
- for id, stack in sys._current_frames().items():
-- print "Thread %d" % (id)
-- print "".join(traceback.format_stack(stack))
-- print "======================================"
-+ print("Thread %d" % (id))
-+ print("".join(traceback.format_stack(stack)))
-+ print("======================================")
-
-
- def buildlogger(cmd, is_global=False):
-@@ -196,8 +196,8 @@ class mongod(NullMongod):
- try:
- self.check_mongo_port(int(port))
- return True
-- except Exception,e:
-- print >> sys.stderr, e
-+ except Exception as e:
-+ print(e, file=sys.stderr)
- return False
-
- def did_mongod_start(self, port=mongod_port, timeout=300):
-@@ -207,14 +207,14 @@ class mongod(NullMongod):
- if is_up:
- return True
- timeout = timeout - 1
-- print >> sys.stderr, "timeout starting mongod"
-+ print("timeout starting mongod", file=sys.stderr)
- return False
-
- def start(self):
- global mongod_port
- global mongod
- if self.proc:
-- print >> sys.stderr, "probable bug: self.proc already set in start()"
-+ print("probable bug: self.proc already set in start()", file=sys.stderr)
- return
- self.ensure_test_dirs()
- dir_name = smoke_db_prefix + "/data/db/sconsTests/"
-@@ -270,7 +270,7 @@ class mongod(NullMongod):
- '--sslAllowConnectionsWithoutCertificates']
- if self.kwargs.get('rlp_path'):
- argv += ['--basisTechRootDirectory', self.kwargs.get('rlp_path')]
-- print "running " + " ".join(argv)
-+ print("running " + " ".join(argv))
- self.proc = self._start(buildlogger(argv, is_global=True))
-
- # If the mongod process is spawned under buildlogger.py, then the first line of output
-@@ -352,7 +352,7 @@ class mongod(NullMongod):
-
- def stop(self):
- if not self.proc:
-- print >> sys.stderr, "probable bug: self.proc unset in stop()"
-+ print("probable bug: self.proc unset in stop()", file=sys.stderr)
- return
- try:
- if os.sys.platform == "win32" and self.job_object is not None:
-@@ -407,9 +407,9 @@ class mongod(NullMongod):
- self.proc.terminate()
- else:
- os.kill(self.proc.pid, 15)
-- except Exception, e:
-- print >> sys.stderr, "error shutting down mongod"
-- print >> sys.stderr, e
-+ except Exception as e:
-+ print("error shutting down mongod", file=sys.stderr)
-+ print(e, file=sys.stderr)
- self.proc.wait()
-
- if self._stdout_pipe is not None:
-@@ -424,12 +424,12 @@ class mongod(NullMongod):
- # anyway.
- retcode = self.proc.returncode
- if os.sys.platform != "win32" and retcode != 0:
-- raise(Exception('mongod process exited with non-zero code %d' % retcode))
-+ raise Exception
-
- def wait_for_repl(self):
-- print "Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")"
-+ print("Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")")
- MongoClient(port=self.port).testing.smokeWait.insert({}, w=2, wtimeout=5*60*1000)
-- print "Replicated write completed -- done wait_for_repl"
-+ print("Replicated write completed -- done wait_for_repl")
-
- class Bug(Exception):
- def __str__(self):
-@@ -457,7 +457,7 @@ class TestServerFailure(TestFailure):
- def check_db_hashes(master, slave):
- # Need to pause a bit so a slave might catch up...
- if not slave.slave:
-- raise(Bug("slave instance doesn't have slave attribute set"))
-+ raise Bug
-
- master.wait_for_repl()
-
-@@ -469,7 +469,7 @@ def check_db_hashes(master, slave):
-
- global lost_in_slave, lost_in_master, screwy_in_slave, replicated_collections
-
-- replicated_collections += master.dict.keys()
-+ replicated_collections += list(master.dict.keys())
-
- for coll in replicated_collections:
- if coll not in slave.dict and coll not in lost_in_slave:
-@@ -489,13 +489,13 @@ def check_db_hashes(master, slave):
- sDocs = list(sTestDB[coll].find().sort("_id", 1))
- mDiffDocs = list()
- sDiffDocs = list()
-- for left, right in izip(mDocs, sDocs):
-+ for left, right in zip(mDocs, sDocs):
- if left != right:
- mDiffDocs.append(left)
- sDiffDocs.append(right)
-
- stats["docs"] = {'master': mDiffDocs, 'slave': sDiffDocs }
-- except Exception, e:
-+ except Exception as e:
- stats["error-docs"] = e;
-
- screwy_in_slave[coll] = stats
-@@ -506,7 +506,7 @@ def check_db_hashes(master, slave):
- mOplog = mTestDB.connection.local[oplog];
- oplog_entries = list(mOplog.find({"$or": [{"ns":mTestDB[coll].full_name}, \
- {"op":"c"}]}).sort("$natural", 1))
-- print "oplog for %s" % mTestDB[coll].full_name
-+ print("oplog for %s" % mTestDB[coll].full_name)
- for doc in oplog_entries:
- pprint.pprint(doc, width=200)
-
-@@ -745,7 +745,7 @@ def runTest(test, result):
-
- is_mongod_still_up = test_mongod.is_mongod_up(mongod_port)
- if start_mongod and not is_mongod_still_up:
-- print "mongod is not running after test"
-+ print("mongod is not running after test")
- result["mongod_running_at_end"] = is_mongod_still_up;
- raise TestServerFailure(path)
-
-@@ -754,7 +754,7 @@ def runTest(test, result):
- if r != 0:
- raise TestExitFailure(path, r)
-
-- print ""
-+ print("")
-
- def run_tests(tests):
- # FIXME: some suites of tests start their own mongod, so don't
-@@ -825,7 +825,7 @@ def run_tests(tests):
- result = primary.admin.command("ismaster");
- ismaster = result["ismaster"]
- if not ismaster:
-- print "waiting for primary to be available ..."
-+ print("waiting for primary to be available ...")
- time.sleep(.2)
-
- secondaryUp = False
-@@ -835,7 +835,7 @@ def run_tests(tests):
- result = sConn.admin.command("ismaster");
- secondaryUp = result["secondary"]
- if not secondaryUp:
-- print "waiting for secondary to be available ..."
-+ print("waiting for secondary to be available ...")
- time.sleep(.2)
-
- if small_oplog or small_oplog_rs:
-@@ -857,7 +857,7 @@ def run_tests(tests):
- if skipTest(test_path):
- test_result["status"] = "skip"
-
-- print "skipping " + test_path
-+ print("skipping " + test_path)
- else:
- fails.append(test)
- runTest(test, test_result)
-@@ -897,20 +897,20 @@ def run_tests(tests):
- use_ssl=use_ssl)
- master.start()
-
-- except TestFailure, f:
-+ except TestFailure as f:
- test_result["end"] = time.time()
- test_result["elapsed"] = test_result["end"] - test_result["start"]
- test_result["error"] = str(f)
- test_result["status"] = "fail"
- test_report["results"].append( test_result )
- try:
-- print f
-+ print(f)
- # Record the failing test and re-raise.
- losers[f.path] = f.status
- raise f
-- except TestServerFailure, f:
-+ except TestServerFailure as f:
- return 2
-- except TestFailure, f:
-+ except TestFailure as f:
- if not continue_on_failure:
- return 1
- if isinstance(slave, mongod):
-@@ -925,51 +925,51 @@ def run_tests(tests):
- def check_and_report_replication_dbhashes():
- def missing(lst, src, dst):
- if lst:
-- print """The following collections were present in the %s but not the %s
--at the end of testing:""" % (src, dst)
-+ print("""The following collections were present in the %s but not the %s
-+at the end of testing:""" % (src, dst))
- for db in lst:
-- print db
-+ print(db)
-
- missing(lost_in_slave, "master", "slave")
- missing(lost_in_master, "slave", "master")
- if screwy_in_slave:
-- print """The following collections have different hashes in the master and slave:"""
-+ print("""The following collections have different hashes in the master and slave:""")
- for coll in screwy_in_slave.keys():
- stats = screwy_in_slave[coll]
- # Counts are "approx" because they are collected after the dbhash runs and may not
- # reflect the states of the collections that were hashed. If the hashes differ, one
- # possibility is that a test exited with writes still in-flight.
-- print "collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave'])
-+ print("collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave']))
- if "docs" in stats:
- if (("master" in stats["docs"] and len(stats["docs"]["master"]) == 0) and
- ("slave" in stats["docs"] and len(stats["docs"]["slave"]) == 0)):
-- print "All docs matched!"
-+ print("All docs matched!")
- else:
-- print "Different Docs"
-- print "Master docs:"
-+ print("Different Docs")
-+ print("Master docs:")
- pprint.pprint(stats["docs"]["master"], indent=2)
-- print "Slave docs:"
-+ print("Slave docs:")
- pprint.pprint(stats["docs"]["slave"], indent=2)
- if "error-docs" in stats:
-- print "Error getting docs to diff:"
-+ print("Error getting docs to diff:")
- pprint.pprint(stats["error-docs"])
- return True
-
- if (small_oplog or small_oplog_rs) and not (lost_in_master or lost_in_slave or screwy_in_slave):
-- print "replication ok for %d collections" % (len(replicated_collections))
-+ print("replication ok for %d collections" % (len(replicated_collections)))
-
- return False
-
-
- def report():
-- print "%d tests succeeded" % len(winners)
-+ print("%d tests succeeded" % len(winners))
- num_missed = len(tests) - (len(winners) + len(losers.keys()))
- if num_missed:
-- print "%d tests didn't get run" % num_missed
-+ print("%d tests didn't get run" % num_missed)
- if losers:
-- print "The following tests failed (with exit code):"
-+ print("The following tests failed (with exit code):")
- for loser in losers:
-- print "%s\t%d" % (loser, losers[loser])
-+ print("%s\t%d" % (loser, losers[loser]))
-
- test_result = { "start": time.time() }
- if check_and_report_replication_dbhashes():
-@@ -981,7 +981,7 @@ def report():
- test_report["results"].append( test_result )
-
- if report_file:
-- f = open( report_file, "wb" )
-+ f = open( report_file, "w" )
- f.write( json.dumps( test_report ) )
- f.close()
-
-@@ -1244,7 +1244,7 @@ def run_old_fails():
- return # This counts as passing so we will run all tests
-
- if ('version' not in state or state['version'] != file_version()):
-- print "warning: old version of failfile.smoke detected. skipping recent fails"
-+ print("warning: old version of failfile.smoke detected. skipping recent fails")
- clear_failfile()
- return
-
-@@ -1308,7 +1308,7 @@ def main():
- try:
- signal.signal(signal.SIGUSR1, dump_stacks)
- except AttributeError:
-- print "Cannot catch signals on Windows"
-+ print("Cannot catch signals on Windows")
-
- parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
- parser.add_option('--mode', dest='mode', default='suite',
-@@ -1450,19 +1450,19 @@ def main():
-
- if options.ignore_files != None :
- ignore_patt = re.compile( options.ignore_files )
-- print "Ignoring files with pattern: ", ignore_patt
-+ print("Ignoring files with pattern: ", ignore_patt)
-
- def ignore_test( test ):
- if ignore_patt.search( test[0] ) != None:
-- print "Ignoring test ", test[0]
-+ print("Ignoring test ", test[0])
- return False
- else:
- return True
-
-- tests = filter( ignore_test, tests )
-+ tests = list(filter( ignore_test, tests ))
-
- if not tests:
-- print "warning: no tests specified"
-+ print("warning: no tests specified")
- return
-
- if options.with_cleanbb:
-@@ -1480,7 +1480,7 @@ def main():
- test_report["failures"] = len(losers.keys())
- test_report["mongod_running_at_end"] = mongod().is_mongod_up(mongod_port)
- if report_file:
-- f = open( report_file, "wb" )
-+ f = open( report_file, "w" )
- f.write( json.dumps( test_report, indent=4, separators=(',', ': ')) )
- f.close()
-
-diff --git a/buildscripts/test_failures.py b/buildscripts/test_failures.py
-index 63f138a..a4db503 100755
---- a/buildscripts/test_failures.py
-+++ b/buildscripts/test_failures.py
-@@ -20,7 +20,7 @@ import time
- import warnings
-
- try:
-- from urlparse import urlparse
-+ from urllib.parse import urlparse
- except ImportError:
- from urllib.parse import urlparse
-
-@@ -31,7 +31,7 @@ import yaml
- LOGGER = logging.getLogger(__name__)
-
- if sys.version_info[0] == 2:
-- _STRING_TYPES = (basestring,)
-+ _STRING_TYPES = (str,)
- else:
- _STRING_TYPES = (str,)
-
-diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py
-index ae8b0a9..66eeb40 100644
---- a/buildscripts/tests/resmokelib/test_selector.py
-+++ b/buildscripts/tests/resmokelib/test_selector.py
-@@ -178,12 +178,12 @@ class TestTestList(unittest.TestCase):
-
- def test_roots_with_unmatching_glob(self):
- glob_roots = ["unknown/subdir1/*.js"]
-- with self.assertRaisesRegexp(ValueError, "Pattern does not match any files: unknown/subdir1/\*.js"):
-+ with self.assertRaisesRegex(ValueError, "Pattern does not match any files: unknown/subdir1/\*.js"):
- selector._TestList(self.test_file_explorer, glob_roots)
-
- def test_roots_unknown_file(self):
- roots = ["dir/subdir1/unknown"]
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
- selector._TestList(self.test_file_explorer, roots, tests_are_files=True)
-
- def test_include_files(self):
-@@ -208,7 +208,7 @@ class TestTestList(unittest.TestCase):
- def test_exclude_files_no_match(self):
- roots = ["dir/subdir1/*.js", "dir/subdir2/test21.*"]
- test_list = selector._TestList(self.test_file_explorer, roots)
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: .*$"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: .*$"):
- test_list.exclude_files(["dir/subdir2/test26.js"])
-
- def test_exclude_files_glob(self):
-@@ -420,7 +420,7 @@ class TestFilterTests(unittest.TestCase):
-
- def test_jstest_unknown_file(self):
- config = {"roots": ["dir/subdir1/*.js", "dir/subdir1/unknown"]}
-- with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
-+ with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"):
- selector.filter_tests("js_test", config, self.test_file_explorer)
-
- def test_json_schema_exclude_files(self):
-diff --git a/buildscripts/tests/test_aws_ec2.py b/buildscripts/tests/test_aws_ec2.py
-index 40f4333..2de7d1f 100755
---- a/buildscripts/tests/test_aws_ec2.py
-+++ b/buildscripts/tests/test_aws_ec2.py
-@@ -169,7 +169,7 @@ class AwsEc2ControlStatus(AwsEc2TestCase):
-
- code, ret = self.aws_ec2.control_instance(mode="status", image_id="bad_id")
- self.assertNotEqual(0, code, ret)
-- self.assertRegexpMatches(ret, "Invalid", ret)
-+ self.assertRegex(ret, "Invalid", ret)
-
-
- class AwsEc2ControlStart(AwsEc2TestCase):
-diff --git a/buildscripts/update_test_lifecycle.py b/buildscripts/update_test_lifecycle.py
-index 52bf204..90ab279 100755
---- a/buildscripts/update_test_lifecycle.py
-+++ b/buildscripts/update_test_lifecycle.py
-@@ -39,7 +39,7 @@ from buildscripts.ciconfig import tags as ci_tags
- LOGGER = logging.getLogger(__name__)
-
- if sys.version_info[0] == 2:
-- _NUMBER_TYPES = (int, long, float)
-+ _NUMBER_TYPES = (int, int, float)
- else:
- _NUMBER_TYPES = (int, float)
-
diff --git a/buildscripts/utils.py b/buildscripts/utils.py
-index 69a7892..93c697a 100644
+index 69a78921ca..93c697adca 100644
--- a/buildscripts/utils.py
+++ b/buildscripts/utils.py
@@ -122,7 +122,7 @@ def getprocesslist():
@@ -2142,7 +1107,7 @@ index 69a7892..93c697a 100644
codecs.register_error('repr', replace_with_repr)
diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py
-index 632ed29..1641c3b 100644
+index 632ed29be5..1641c3ba90 100644
--- a/site_scons/libdeps.py
+++ b/site_scons/libdeps.py
@@ -122,7 +122,7 @@ def __get_libdeps(node):
@@ -2173,7 +1138,7 @@ index 632ed29..1641c3b 100644
else:
result.append(d)
diff --git a/site_scons/mongo/__init__.py b/site_scons/mongo/__init__.py
-index 510bd7b..f774780 100644
+index 510bd7bcc2..f77478092b 100644
--- a/site_scons/mongo/__init__.py
+++ b/site_scons/mongo/__init__.py
@@ -5,4 +5,4 @@
@@ -2183,7 +1148,7 @@ index 510bd7b..f774780 100644
- print "%s failed: %s" % (bf.node, bf.errstr)
+ print("%s failed: %s" % (bf.node, bf.errstr))
diff --git a/site_scons/mongo/generators.py b/site_scons/mongo/generators.py
-index c07e86a..5958e69 100644
+index c07e86a4d1..5958e6923b 100644
--- a/site_scons/mongo/generators.py
+++ b/site_scons/mongo/generators.py
@@ -1,6 +1,6 @@
@@ -2204,7 +1169,7 @@ index c07e86a..5958e69 100644
hasher.update(option)
hasher.update(str(env.GetOption(option)))
diff --git a/site_scons/site_tools/dagger/__init__.py b/site_scons/site_tools/dagger/__init__.py
-index f05228c..f10b402 100644
+index f05228cfe4..f10b4027e1 100644
--- a/site_scons/site_tools/dagger/__init__.py
+++ b/site_scons/site_tools/dagger/__init__.py
@@ -5,7 +5,7 @@ import logging
@@ -2217,7 +1182,7 @@ index f05228c..f10b402 100644
def generate(env, **kwargs):
"""The entry point for our tool. However, the builder for
diff --git a/site_scons/site_tools/dagger/dagger.py b/site_scons/site_tools/dagger/dagger.py
-index 1eeefe1..03e7603 100644
+index 1eeefe1ea3..03e7603d29 100644
--- a/site_scons/site_tools/dagger/dagger.py
+++ b/site_scons/site_tools/dagger/dagger.py
@@ -40,8 +40,8 @@ import sys
@@ -2241,7 +1206,7 @@ index 1eeefe1..03e7603 100644
# target is given as a list of target SCons nodes - this builder is only responsible for
diff --git a/site_scons/site_tools/dagger/graph.py b/site_scons/site_tools/dagger/graph.py
-index 5ebe6f4..379d524 100644
+index 5ebe6f4506..379d5245e6 100644
--- a/site_scons/site_tools/dagger/graph.py
+++ b/site_scons/site_tools/dagger/graph.py
@@ -4,11 +4,13 @@ import abc
@@ -2317,7 +1282,7 @@ index 5ebe6f4..379d524 100644
if isinstance(v, list):
setattr(self, k, set(v))
diff --git a/site_scons/site_tools/dagger/graph_consts.py b/site_scons/site_tools/dagger/graph_consts.py
-index 81fe86d..a922a4f 100644
+index 81fe86d75c..a922a4f3f6 100644
--- a/site_scons/site_tools/dagger/graph_consts.py
+++ b/site_scons/site_tools/dagger/graph_consts.py
@@ -17,8 +17,8 @@ NODE_SYM = 2
@@ -2332,7 +1297,7 @@ index 81fe86d..a922a4f 100644
"""Error/query codes"""
diff --git a/site_scons/site_tools/dagger/graph_test.py b/site_scons/site_tools/dagger/graph_test.py
-index bc84f58..6c0168c 100644
+index bc84f5868c..6c0168cf97 100644
--- a/site_scons/site_tools/dagger/graph_test.py
+++ b/site_scons/site_tools/dagger/graph_test.py
@@ -5,8 +5,8 @@ from JSON
@@ -2424,7 +1389,7 @@ index bc84f58..6c0168c 100644
if __name__ == '__main__':
diff --git a/site_scons/site_tools/distsrc.py b/site_scons/site_tools/distsrc.py
-index 861f5d9..d2dff0b 100644
+index 861f5d9e2e..d2dff0b612 100644
--- a/site_scons/site_tools/distsrc.py
+++ b/site_scons/site_tools/distsrc.py
@@ -20,7 +20,7 @@ import shutil
@@ -2491,7 +1456,7 @@ index 861f5d9..d2dff0b 100644
git_cmd = "\"%s\" archive --format %s --output %s --prefix ${MONGO_DIST_SRC_PREFIX} HEAD" % (
diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py
-index 9838b63..fdf0c26 100644
+index 9838b63349..fdf0c26030 100644
--- a/site_scons/site_tools/icecream.py
+++ b/site_scons/site_tools/icecream.py
@@ -99,7 +99,7 @@ def generate(env):
@@ -2504,7 +1469,7 @@ index 9838b63..fdf0c26 100644
continue
base = emitterdict[suffix]
diff --git a/site_scons/site_tools/idl_tool.py b/site_scons/site_tools/idl_tool.py
-index 78bedfa..628f345 100755
+index 78bedfaa74..628f345361 100755
--- a/site_scons/site_tools/idl_tool.py
+++ b/site_scons/site_tools/idl_tool.py
@@ -47,7 +47,7 @@ def idl_scanner(node, env, path):
@@ -2517,7 +1482,7 @@ index 78bedfa..628f345 100755
nodes_deps_list.extend(env.Glob('#buildscripts/idl/idl/*.py'))
diff --git a/site_scons/site_tools/jstoh.py b/site_scons/site_tools/jstoh.py
-index dc90b32..567958a 100644
+index dc90b324b2..567958a50f 100644
--- a/site_scons/site_tools/jstoh.py
+++ b/site_scons/site_tools/jstoh.py
@@ -1,3 +1,5 @@
@@ -2547,7 +1512,7 @@ index dc90b32..567958a 100644
jsToHeader(sys.argv[1], sys.argv[2:])
diff --git a/site_scons/site_tools/mongo_integrationtest.py b/site_scons/site_tools/mongo_integrationtest.py
-index ff9a5f4..fccbbeb 100644
+index ff9a5f451b..fccbbebb47 100644
--- a/site_scons/site_tools/mongo_integrationtest.py
+++ b/site_scons/site_tools/mongo_integrationtest.py
@@ -12,10 +12,10 @@ def register_integration_test(env, test):
@@ -2564,7 +1529,7 @@ index ff9a5f4..fccbbeb 100644
finally:
ofile.close()
diff --git a/site_scons/site_tools/mongo_unittest.py b/site_scons/site_tools/mongo_unittest.py
-index ec99ab2..a4185a6 100644
+index ec99ab2d45..a4185a6b41 100644
--- a/site_scons/site_tools/mongo_unittest.py
+++ b/site_scons/site_tools/mongo_unittest.py
@@ -11,10 +11,10 @@ def register_unit_test(env, test):
@@ -2581,7 +1546,7 @@ index ec99ab2..a4185a6 100644
finally:
ofile.close()
diff --git a/site_scons/site_tools/split_dwarf.py b/site_scons/site_tools/split_dwarf.py
-index 95130c9..c02d786 100644
+index 95130c9e9a..c02d78619f 100644
--- a/site_scons/site_tools/split_dwarf.py
+++ b/site_scons/site_tools/split_dwarf.py
@@ -52,7 +52,7 @@ def generate(env):
@@ -2594,7 +1559,7 @@ index 95130c9..c02d786 100644
continue
base = emitterdict[suffix]
diff --git a/site_scons/site_tools/thin_archive.py b/site_scons/site_tools/thin_archive.py
-index 511c0ef..0d8a83b 100644
+index 511c0ef6e5..0d8a83b83a 100644
--- a/site_scons/site_tools/thin_archive.py
+++ b/site_scons/site_tools/thin_archive.py
@@ -41,7 +41,7 @@ def exists(env):
@@ -2607,7 +1572,7 @@ index 511c0ef..0d8a83b 100644
return bool(isgnu)
diff --git a/site_scons/site_tools/xcode.py b/site_scons/site_tools/xcode.py
-index 9ec68c3..5ddebb2 100644
+index 9ec68c3547..5ddebb2e00 100644
--- a/site_scons/site_tools/xcode.py
+++ b/site_scons/site_tools/xcode.py
@@ -9,4 +9,4 @@ def generate(env):
@@ -2617,10 +1582,10 @@ index 9ec68c3..5ddebb2 100644
- print "NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands"
+ print("NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands")
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
-index 426e57c..cc09ab4 100644
+index 5d6ec52d14..ccd588899c 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
-@@ -156,7 +156,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else
+@@ -157,7 +157,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else
# On windows, we need to escape the backslashes in the command-line
# so that windows paths look okay.
@@ -2629,7 +1594,7 @@ index 426e57c..cc09ab4 100644
if env.TargetOSIs('windows'):
cmd_line = cmd_line.replace('\\', r'\\')
-@@ -602,7 +602,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'),
+@@ -603,7 +603,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'),
distsrc.File('MPL-2')])
# If no module has introduced a file named LICENSE.txt, then inject the AGPL.
@@ -2638,7 +1603,7 @@ index 426e57c..cc09ab4 100644
env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0')])
# All module banners get staged to the top level of the tarfile, so we
-@@ -621,7 +621,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in
+@@ -622,7 +622,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in
# Allow modules to map original file name directories to subdirectories
# within the archive (e.g. { "src/mongo/db/modules/enterprise/docs": "snmp"})
archive_addition_transforms = []
@@ -2648,7 +1613,7 @@ index 426e57c..cc09ab4 100644
(full_dir, archive_dir))
diff --git a/src/mongo/base/generate_error_codes.py b/src/mongo/base/generate_error_codes.py
-index 420ee96..b704767 100644
+index 420ee964ff..b704767a01 100644
--- a/src/mongo/base/generate_error_codes.py
+++ b/src/mongo/base/generate_error_codes.py
@@ -26,6 +26,8 @@
@@ -2670,7 +1635,7 @@ index 420ee96..b704767 100644
def die(message=None):
diff --git a/src/mongo/db/auth/generate_action_types.py b/src/mongo/db/auth/generate_action_types.py
-index b712b29..39252ed 100755
+index b712b29666..39252ed293 100755
--- a/src/mongo/db/auth/generate_action_types.py
+++ b/src/mongo/db/auth/generate_action_types.py
@@ -227,7 +227,7 @@ def hasDuplicateActionTypes(actionTypes):
@@ -2692,7 +1657,7 @@ index b712b29..39252ed 100755
actionTypes = parseActionTypesFromFile(sys.argv[1])
diff --git a/src/mongo/db/fts/generate_stop_words.py b/src/mongo/db/fts/generate_stop_words.py
-index e0dc801..e0aad76 100644
+index e0dc801ca9..e0aad760e8 100644
--- a/src/mongo/db/fts/generate_stop_words.py
+++ b/src/mongo/db/fts/generate_stop_words.py
@@ -7,7 +7,7 @@ def generate( header, source, language_files ):
@@ -2723,7 +1688,7 @@ index e0dc801..e0aad76 100644
out.write( ' };\n' )
out.write( ' const size_t wordcnt = sizeof(words) / sizeof(words[0]);\n' )
diff --git a/src/mongo/db/fts/unicode/gen_diacritic_map.py b/src/mongo/db/fts/unicode/gen_diacritic_map.py
-index 08cfa95..7c623af 100644
+index 08cfa95cda..7c623aff60 100644
--- a/src/mongo/db/fts/unicode/gen_diacritic_map.py
+++ b/src/mongo/db/fts/unicode/gen_diacritic_map.py
@@ -45,7 +45,7 @@ def add_diacritic_mapping(codepoint):
@@ -2736,7 +1701,7 @@ index 08cfa95..7c623af 100644
for i in range(len(d)):
if ord(d[i]) not in diacritics:
diff --git a/src/mongo/db/query/collation/generate_icu_init_cpp.py b/src/mongo/db/query/collation/generate_icu_init_cpp.py
-index 8ae084a..7c576f6 100755
+index 8ae084aeec..7c576f6ffe 100755
--- a/src/mongo/db/query/collation/generate_icu_init_cpp.py
+++ b/src/mongo/db/query/collation/generate_icu_init_cpp.py
@@ -26,6 +26,9 @@
@@ -2760,25 +1725,3 @@ index 8ae084a..7c576f6 100755
cpp_file.write(source_template % dict(decimal_encoded_data=decimal_encoded_data))
if __name__ == '__main__':
-diff --git a/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py b/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-index ece905d..03cc961 100644
---- a/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-+++ b/src/third_party/mozjs-45/extract/js/src/builtin/embedjs.py
-@@ -36,7 +36,7 @@
- #
- # It uses the C preprocessor to process its inputs.
-
--from __future__ import with_statement
-+from __future__ import with_statement, unicode_literals
- import re, sys, os, subprocess
- import shlex
- import which
-@@ -107,7 +107,7 @@ def preprocess(cxx, preprocessorOption, source, args = []):
- tmpOut = 'self-hosting-preprocessed.pp';
- outputArg = shlex.split(preprocessorOption + tmpOut)
-
-- with open(tmpIn, 'wb') as input:
-+ with open(tmpIn, 'w') as input:
- input.write(source)
- print(' '.join(cxx + outputArg + args + [tmpIn]))
- result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
diff --git a/use-system-mozjs-icu-asio.patch b/use-system-mozjs-icu-asio.patch
index d54768d..7049460 100644
--- a/use-system-mozjs-icu-asio.patch
+++ b/use-system-mozjs-icu-asio.patch
@@ -1,5 +1,5 @@
diff --git a/SConstruct b/SConstruct
-index fe7975b..3cf8a1b 100644
+index f949f65475..9008888d9f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -156,7 +156,7 @@ add_option('wiredtiger',
@@ -23,7 +23,7 @@ index fe7975b..3cf8a1b 100644
add_option('use-system-intel_decimal128',
help='use system version of intel decimal128',
nargs=0,
-@@ -2846,20 +2851,20 @@ def doConfigure(myenv):
+@@ -2850,20 +2855,20 @@ def doConfigure(myenv):
if use_system_version_of_library("icu"):
conf.FindSysLibDep("icudata", ["icudata"])
@@ -52,7 +52,7 @@ index fe7975b..3cf8a1b 100644
conf.env.Append(
CPPDEFINES=[
"BOOST_SYSTEM_NO_DEPRECATED",
-@@ -3028,7 +3033,7 @@ def doConfigure(myenv):
+@@ -3032,7 +3037,7 @@ def doConfigure(myenv):
if conf.CheckExtendedAlignment(size):
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_MAX_EXTENDED_ALIGNMENT", size)
break
@@ -61,7 +61,7 @@ index fe7975b..3cf8a1b 100644
conf.env['MONGO_HAVE_LIBMONGOC'] = conf.CheckLibWithHeader(
["mongoc-1.0"],
["mongoc.h"],
-@@ -3168,7 +3173,7 @@ Export("get_option")
+@@ -3172,7 +3177,7 @@ Export("get_option")
Export("has_option")
Export("use_system_version_of_library")
Export("serverJs")
@@ -71,7 +71,7 @@ index fe7975b..3cf8a1b 100644
Export("debugBuild optBuild")
Export("wiredtiger")
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
-index 416ef7a..9a4f941 100644
+index 69c4a02a61..08c37aa89b 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -2,7 +2,7 @@
6 years