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

Richard Leitner richard.leitner at skidata.com
Wed Jul 10 07:33:01 UTC 2019


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 at skidata.com>
---
 recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

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
-- 
2.20.1



More information about the Openembedded-devel mailing list