All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java][PATCH 1/2] Openjdk-8: Fix openjdk build when CXX contains assembler arguments
@ 2016-03-21 11:39 Erkka Kääriä
  2016-03-21 11:39 ` [meta-java][PATCH 2/2] Openjdk-8: Fix build flags for adlc Erkka Kääriä
  0 siblings, 1 reply; 3+ messages in thread
From: Erkka Kääriä @ 2016-03-21 11:39 UTC (permalink / raw)
  To: openembedded-devel

Builds currently fail, if CXX also contains assembler arguments. These
arguments are in form "-Wa,args,are,here". When this string is then used in
openjdk make process, it is inserted before the make evaluates its argument
lists. As these lists are comma separated, the commas in assembler argument list
are interpreted as list separators, which breaks the build.

This is fixed by adding the extra '$', which means the string is inserted after
make evaluates the list.

Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
---
 recipes-core/openjdk/openjdk-8_72b05.bb              |  1 +
 ...dk8-fix-assembler-flag-handling-in-makefile.patch | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-assembler-flag-handling-in-makefile.patch

diff --git a/recipes-core/openjdk/openjdk-8_72b05.bb b/recipes-core/openjdk/openjdk-8_72b05.bb
index e0a786a..1a01630 100644
--- a/recipes-core/openjdk/openjdk-8_72b05.bb
+++ b/recipes-core/openjdk/openjdk-8_72b05.bb
@@ -9,6 +9,7 @@ PATCHES_URI_append = "\
     file://openjdk8-fix-shark-build.patch;apply=no \
     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 \
 "
 
 do_compile_append() {
diff --git a/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-assembler-flag-handling-in-makefile.patch b/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-assembler-flag-handling-in-makefile.patch
new file mode 100644
index 0000000..5e02f28
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-assembler-flag-handling-in-makefile.patch
@@ -0,0 +1,20 @@
+Delay $CXX insertion until after make has evaluated the comma-separated list,
+as any comma separated parameters in CXX (such as assembler arguments) would
+break the build
+
+Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
+
+Upstream-Status: Pending
+
+---
+--- make/common/NativeCompilation.gmk
++++ make/common/NativeCompilation.gmk
+@@ -372,7 +372,7 @@ define SetupNativeCompilation
+   $$(foreach p,$$($1_SRCS), \
+       $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
+           $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \
+-          $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS))))
++          $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$$(CXX),$$($1_ASFLAGS))))
+
+   # On windows we need to create a resource file
+   ifeq ($(OPENJDK_TARGET_OS), windows)
-- 
2.7.3

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-java][PATCH 2/2] Openjdk-8: Fix build flags for adlc
  2016-03-21 11:39 [meta-java][PATCH 1/2] Openjdk-8: Fix openjdk build when CXX contains assembler arguments Erkka Kääriä
@ 2016-03-21 11:39 ` Erkka Kääriä
  2016-03-22  9:26   ` Maxin B. John
  0 siblings, 1 reply; 3+ messages in thread
From: Erkka Kääriä @ 2016-03-21 11:39 UTC (permalink / raw)
  To: openembedded-devel

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ä <erkka.kaaria@intel.com>
---
 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ä <erkka.kaaria@intel.com>
+
+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
-- 
2.7.3

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-java][PATCH 2/2] Openjdk-8: Fix build flags for adlc
  2016-03-21 11:39 ` [meta-java][PATCH 2/2] Openjdk-8: Fix build flags for adlc Erkka Kääriä
@ 2016-03-22  9:26   ` Maxin B. John
  0 siblings, 0 replies; 3+ messages in thread
From: Maxin B. John @ 2016-03-22  9:26 UTC (permalink / raw)
  To: openembedded-devel

Hi Erkka,

On Mon, Mar 21, 2016 at 01:39:12PM +0200, Erkka Kääriä wrote:
> 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+.

Pushed both these fixes to master-next. Thanks !

Best Regards,
Maxin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-22  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 11:39 [meta-java][PATCH 1/2] Openjdk-8: Fix openjdk build when CXX contains assembler arguments Erkka Kääriä
2016-03-21 11:39 ` [meta-java][PATCH 2/2] Openjdk-8: Fix build flags for adlc Erkka Kääriä
2016-03-22  9:26   ` Maxin B. John

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.