summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErkka Kääriä <erkka.kaaria@intel.com>2016-04-28 12:04:12 +0300
committerMaxin B. John <maxin.john@intel.com>2016-04-29 13:17:16 +0300
commit3a1ac9def769a95bbc843931d3c192038ec7c382 (patch)
treef343805c4db915a6dd195e1b01c2435ad187f7d8
parent1b975523b8d0467b2e3a44097825c30cdc9e3944 (diff)
downloadmeta-java-3a1ac9def769a95bbc843931d3c192038ec7c382.tar.gz
Openjdk-8: Add -Wno-cpp to CFLAGS in certain makefiles
The security flag '-D_FORTIFY_SOURCE' requires at least -O to work, otherwise a warning is given. If CFLAGS additionally contains -Werror, this warning turns into an error. As Openjdk build system intentionally deoptimizes certains files due to potential bad codegen during optimization, build will fail when both '-D_FORTIFY_SOURCE' and '-Werror' are used. As turning the optimizations back on will likely break things, the warning is silenced instead. Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com> Signed-off-by: Maxin B. John <maxin.john@intel.com>
-rw-r--r--recipes-core/openjdk/openjdk-8_72b05.bb1
-rw-r--r--recipes-core/openjdk/openjre-8_72b05.bb1
-rw-r--r--recipes-core/openjdk/patches-openjdk-8/openjdk8-silence-d_fortify_source-warning.patch56
3 files changed, 58 insertions, 0 deletions
diff --git a/recipes-core/openjdk/openjdk-8_72b05.bb b/recipes-core/openjdk/openjdk-8_72b05.bb
index f378b0a..bafc6cd 100644
--- a/recipes-core/openjdk/openjdk-8_72b05.bb
+++ b/recipes-core/openjdk/openjdk-8_72b05.bb
@@ -11,6 +11,7 @@ PATCHES_URI_append = "\
11 file://openjdk8-use_builtin_frame_address_0_rather_than_returning_address_of_local_variable.patch;apply=no \ 11 file://openjdk8-use_builtin_frame_address_0_rather_than_returning_address_of_local_variable.patch;apply=no \
12 file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \ 12 file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \
13 file://openjdk8-fix-adlc-flags.patch;apply=no \ 13 file://openjdk8-fix-adlc-flags.patch;apply=no \
14 file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
14" 15"
15 16
16do_install() { 17do_install() {
diff --git a/recipes-core/openjdk/openjre-8_72b05.bb b/recipes-core/openjdk/openjre-8_72b05.bb
index 6d29d12..3a34848 100644
--- a/recipes-core/openjdk/openjre-8_72b05.bb
+++ b/recipes-core/openjdk/openjre-8_72b05.bb
@@ -9,6 +9,7 @@ PATCHES_URI_append = "\
9 file://openjdk8-fix-shark-build.patch;apply=no \ 9 file://openjdk8-fix-shark-build.patch;apply=no \
10 file://openjdk8-fix-shark-stdc++11.patch;apply=no \ 10 file://openjdk8-fix-shark-stdc++11.patch;apply=no \
11 file://openjdk8-use_builtin_frame_address_0_rather_than_returning_address_of_local_variable.patch;apply=no \ 11 file://openjdk8-use_builtin_frame_address_0_rather_than_returning_address_of_local_variable.patch;apply=no \
12 file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
12" 13"
13 14
14do_install() { 15do_install() {
diff --git a/recipes-core/openjdk/patches-openjdk-8/openjdk8-silence-d_fortify_source-warning.patch b/recipes-core/openjdk/patches-openjdk-8/openjdk8-silence-d_fortify_source-warning.patch
new file mode 100644
index 0000000..2c2e333
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/openjdk8-silence-d_fortify_source-warning.patch
@@ -0,0 +1,56 @@
1makefiles: Add -Wno-cpp to CFLAGS
2
3The security flag '-D_FORTIFY_SOURCE' requires at least -O to work,
4otherwise a warning is given. If CFLAGS additionally contains -Werror,
5this warning turns into an error. As Openjdk build system intentionally
6deoptimizes certains files due to potential bad codegen during optimization,
7build will fail when both '-D_FORTIFY_SOURCE' and '-Werror' are used.
8As turning the optimizations back on will likely break things, the
9warning is silenced instead.
10
11Upstream-Status: Inappropriate [Yocto-specific fixes]
12
13Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
14---
15 hotspot/make/linux/makefiles/amd64.make | 2 ++
16 hotspot/make/linux/makefiles/i486.make | 2 ++
17 hotspot/make/linux/makefiles/zero.make | 2 ++
18 3 files changed, 6 insertions(+)
19
20diff --git hotspot/make/linux/makefiles/amd64.make hotspot/make/linux/makefiles/amd64.make
21index 2b77dba..db3965b 100644
22--- hotspot/make/linux/makefiles/amd64.make
23+++ hotspot/make/linux/makefiles/amd64.make
24@@ -31,4 +31,6 @@ CFLAGS += -DVM_LITTLE_ENDIAN
25
26 CFLAGS += -D_LP64=1
27
28+CFLAGS += -Wno-cpp
29+
30 OPT_CFLAGS/compactingPermGenGen.o = -O1
31diff --git hotspot/make/linux/makefiles/i486.make hotspot/make/linux/makefiles/i486.make
32index 86e825d..6a92f09 100644
33--- hotspot/make/linux/makefiles/i486.make
34+++ hotspot/make/linux/makefiles/i486.make
35@@ -31,4 +31,6 @@ OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
36 # Must also specify if CPU is little endian
37 CFLAGS += -DVM_LITTLE_ENDIAN
38
39+CFLAGS += -Wno-cpp
40+
41 OPT_CFLAGS/compactingPermGenGen.o = -O1
42diff --git hotspot/make/linux/makefiles/zero.make hotspot/make/linux/makefiles/zero.make
43index 0270711..2b05f33 100644
44--- hotspot/make/linux/makefiles/zero.make
45+++ hotspot/make/linux/makefiles/zero.make
46@@ -28,5 +28,7 @@
47 # Select which files to use (in top.make)
48 TYPE = ZERO
49
50+CFLAGS += -Wno-cpp
51+
52 # Install libjvm.so, etc in in server directory.
53 VM_SUBDIR = server
54--
552.7.4
56