From efc3daa7526a5ae5aad24a0f777d2274aab3d5c3 Mon Sep 17 00:00:00 2001 From: Erkka Kääriä Date: Mon, 21 Mar 2016 13:39:12 +0200 Subject: Openjdk-8: Fix build flags for adlc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adlc is a native tool that openjdk builds and uses during its build process. Bitbake however passes target machine specific CFLAGS and CXXFLAGS because we are crosscompiling openjdk for the target architecture. This can cause issues, if these flags contains values, that work for the Yocto provided crosscompiler but not for the system compiler. As an example, compilation will fail on Ubuntu 14.04 if -fstack-protector-strong is specified in the distro security flags. Ubuntu 14.04 ships with GCC 4.8, whereas this flag is only supported by GCC 4.9+. Signed-off-by: Erkka Kääriä Signed-off-by: Maxin B. John --- recipes-core/openjdk/openjdk-8_72b05.bb | 1 + .../openjdk8-fix-adlc-flags.patch | 34 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-flags.patch diff --git a/recipes-core/openjdk/openjdk-8_72b05.bb b/recipes-core/openjdk/openjdk-8_72b05.bb index 1a01630..feaf227 100644 --- a/recipes-core/openjdk/openjdk-8_72b05.bb +++ b/recipes-core/openjdk/openjdk-8_72b05.bb @@ -10,6 +10,7 @@ PATCHES_URI_append = "\ file://openjdk8-fix-shark-stdc++11.patch;apply=no \ file://openjdk8-use_builtin_frame_address_0_rather_than_returning_address_of_local_variable.patch;apply=no \ file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \ + file://openjdk8-fix-adlc-flags.patch;apply=no \ " do_compile_append() { diff --git a/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-flags.patch b/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-flags.patch new file mode 100644 index 0000000..fa26d04 --- /dev/null +++ b/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-flags.patch @@ -0,0 +1,34 @@ +adlc is built using the native toolchain, not the crosscompiler. It however +was incorrectly using flags meant for the crosscompiler. + +Signed-off-by: Erkka Kääriä + +Upstream-Status: Inappropriate [Yocto-specific fixes] + +--- + hotspot/make/linux/makefiles/adlc.make | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git hotspot/make/linux/makefiles/adlc.make hotspot/make/linux/makefiles/adlc.make +index 8a86691..2789c03 100644 +--- hotspot/make/linux/makefiles/adlc.make ++++ hotspot/make/linux/makefiles/adlc.make +@@ -28,6 +28,16 @@ + + include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make + ++# Yocto specific fix - remove target machine flags and replace them with ++# build machine flags, as this part is built using the native toolchain ++CXXFLAGS:=$(filter-out $(TARGET_CXXFLAGS),$(CXXFLAGS)) ++CFLAGS:=$(filter-out $(TARGET_CFLAGS),$(CFLAGS)) ++ ++CXXFLAGS += $(BUILD_CXXFLAGS) ++CFLAGS += $(BUILD_CFLAGS) ++ ++ ++ + # ######################################################################### + + # OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make: +-- +1.9.1 -- cgit v1.2.3-54-g00ecf