diff options
author | Erkka Kääriä <erkka.kaaria@intel.com> | 2016-04-28 12:04:12 +0300 |
---|---|---|
committer | Maxin B. John <maxin.john@intel.com> | 2016-04-29 13:17:16 +0300 |
commit | 3a1ac9def769a95bbc843931d3c192038ec7c382 (patch) | |
tree | f343805c4db915a6dd195e1b01c2435ad187f7d8 /recipes-core | |
parent | 1b975523b8d0467b2e3a44097825c30cdc9e3944 (diff) | |
download | meta-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>
Diffstat (limited to 'recipes-core')
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 | ||
16 | do_install() { | 17 | do_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 | ||
14 | do_install() { | 15 | do_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 @@ | |||
1 | makefiles: Add -Wno-cpp to CFLAGS | ||
2 | |||
3 | The security flag '-D_FORTIFY_SOURCE' requires at least -O to work, | ||
4 | otherwise a warning is given. If CFLAGS additionally contains -Werror, | ||
5 | this warning turns into an error. As Openjdk build system intentionally | ||
6 | deoptimizes certains files due to potential bad codegen during optimization, | ||
7 | build will fail when both '-D_FORTIFY_SOURCE' and '-Werror' are used. | ||
8 | As turning the optimizations back on will likely break things, the | ||
9 | warning is silenced instead. | ||
10 | |||
11 | Upstream-Status: Inappropriate [Yocto-specific fixes] | ||
12 | |||
13 | Signed-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 | |||
20 | diff --git hotspot/make/linux/makefiles/amd64.make hotspot/make/linux/makefiles/amd64.make | ||
21 | index 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 | ||
31 | diff --git hotspot/make/linux/makefiles/i486.make hotspot/make/linux/makefiles/i486.make | ||
32 | index 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 | ||
42 | diff --git hotspot/make/linux/makefiles/zero.make hotspot/make/linux/makefiles/zero.make | ||
43 | index 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 | -- | ||
55 | 2.7.4 | ||
56 | |||