[meta-java] openjdk7: fix arm32JIT with current gcc versions by disabling optimizer

Submitted by Richard Leitner on July 10, 2019, 7:33 a.m. | Patch ID: 162931

Details

Message ID 20190710073301.21945-1-richard.leitner@skidata.com
State Under Review
Delegated to: Richard Leitner
Headers show

Commit Message

Richard Leitner July 10, 2019, 7:33 a.m.
This works around a severe error in the arm32JIT when built with current gcc
cross compiler versions with O1 (or higher) set.

There were different errors thrown for this problem when built on
different machines, some of them are:

	fatal error: only PUSH_EA or PUSH_FD available on Thumb
or
	Segmentation Fault
or
	Illegal instruction

The currently only "solution" found was to disable the optimizer
completely. This is a quite dirty fix, and more elegant fixes are warmly
welcome!

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
 recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb b/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
index aa165f5..3fd17cd 100644
--- a/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
+++ b/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
@@ -78,3 +78,14 @@  export DISTRIBUTION_PATCHES
 #
 # NOTE: When updating the recipe, please check if this is still needed
 CFLAGS_append = " -Wno-error=deprecated-declarations -Wno-error=narrowing -fpermissive"
+
+# the zero arm32JIT crashes during runtime when built with current gcc versions.
+# The following compile adaptions provide a workaround for this issues.
+ARM_INSTRUCTION_SET = "arm"
+TARGET_CFLAGS_remove_arm = "-O2"
+TARGET_CXXFLAGS_remove_arm = "-O2"
+TARGET_CPPFLAGS_remove_arm = "-O2"
+CFLAGS_remove_arm = "-O2"
+CXXFLAGS_remove_arm = "-O2"
+CXXFLAGS_append_arm = " -O0"
+CFLAGS_append_arm = " -O0"
\ No newline at end of file