diff options
-rw-r--r-- | recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch | 49 | ||||
-rw-r--r-- | recipes-core/icedtea/openjdk-7-release-03b147.inc | 2 |
2 files changed, 51 insertions, 0 deletions
diff --git a/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch b/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch new file mode 100644 index 0000000..56513a0 --- /dev/null +++ b/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Hotspot compiler has a bug where signed integers could overflow. This is | ||
4 | undefined behaviour, and causes massive memory leak when compiled with GCC 5.0+, | ||
5 | causing the build to fail. | ||
6 | |||
7 | This is fixed by backporting patch from | ||
8 | https://bugs.openjdk.java.net/browse/JDK-8078666 where it was fixed by | ||
9 | Severin Gehwolf. | ||
10 | |||
11 | Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com> | ||
12 | |||
13 | --- openjdk/hotspot/src/share/vm/opto/type.cpp | ||
14 | +++ openjdk/hotspot/src/share/vm/opto/type.cpp | ||
15 | @@ -1077,11 +1077,11 @@ static int normalize_int_widen( jint lo, jint hi, int w ) { | ||
16 | // Certain normalizations keep us sane when comparing types. | ||
17 | // The 'SMALLINT' covers constants and also CC and its relatives. | ||
18 | if (lo <= hi) { | ||
19 | - if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin; | ||
20 | - if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT | ||
21 | + if (((juint)hi - lo) <= SMALLINT) w = Type::WidenMin; | ||
22 | + if (((juint)hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT | ||
23 | } else { | ||
24 | - if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin; | ||
25 | - if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT | ||
26 | + if (((juint)lo - hi) <= SMALLINT) w = Type::WidenMin; | ||
27 | + if (((juint)lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT | ||
28 | } | ||
29 | return w; | ||
30 | } | ||
31 | @@ -1332,11 +1332,11 @@ static int normalize_long_widen( jlong lo, jlong hi, int w ) { | ||
32 | // Certain normalizations keep us sane when comparing types. | ||
33 | // The 'SMALLINT' covers constants. | ||
34 | if (lo <= hi) { | ||
35 | - if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin; | ||
36 | - if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG | ||
37 | + if (((julong)hi - lo) <= SMALLINT) w = Type::WidenMin; | ||
38 | + if (((julong)hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG | ||
39 | } else { | ||
40 | - if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin; | ||
41 | - if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG | ||
42 | + if (((julong)lo - hi) <= SMALLINT) w = Type::WidenMin; | ||
43 | + if (((julong)lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG | ||
44 | } | ||
45 | return w; | ||
46 | } | ||
47 | -- | ||
48 | 2.1.4 | ||
49 | |||
diff --git a/recipes-core/icedtea/openjdk-7-release-03b147.inc b/recipes-core/icedtea/openjdk-7-release-03b147.inc index 98266f7..b1cf6e9 100644 --- a/recipes-core/icedtea/openjdk-7-release-03b147.inc +++ b/recipes-core/icedtea/openjdk-7-release-03b147.inc | |||
@@ -84,6 +84,7 @@ OPENJDK_PATCHES = " \ | |||
84 | file://icedtea-change-to-gdb-debug-format.patch;apply=no \ | 84 | file://icedtea-change-to-gdb-debug-format.patch;apply=no \ |
85 | file://icedtea-disable-x11-in-headless.patch;apply=no \ | 85 | file://icedtea-disable-x11-in-headless.patch;apply=no \ |
86 | file://icedtea-disable-sun.applet-for-tools-in-headless.patch;apply=no \ | 86 | file://icedtea-disable-sun.applet-for-tools-in-headless.patch;apply=no \ |
87 | file://icedtea-hotspot-fix-undefined-behaviour.patch;apply=no \ | ||
87 | " | 88 | " |
88 | 89 | ||
89 | OPENJDK_HEADLESS_PATCHES = " \ | 90 | OPENJDK_HEADLESS_PATCHES = " \ |
@@ -102,5 +103,6 @@ export DISTRIBUTION_PATCHES = " \ | |||
102 | patches/icedtea-flags.patch \ | 103 | patches/icedtea-flags.patch \ |
103 | patches/icedtea-openjdk-remove-currency-data-generation-expi.patch \ | 104 | patches/icedtea-openjdk-remove-currency-data-generation-expi.patch \ |
104 | patches/icedtea-change-to-gdb-debug-format.patch \ | 105 | patches/icedtea-change-to-gdb-debug-format.patch \ |
106 | patches/icedtea-hotspot-fix-undefined-behaviour.patch \ | ||
105 | ${CLEAN_X11_DISTRIBUTION_PATCH} \ | 107 | ${CLEAN_X11_DISTRIBUTION_PATCH} \ |
106 | " | 108 | " |