diff options
author | André Draszik <andre.draszik@jci.com> | 2018-08-13 11:09:31 +0100 |
---|---|---|
committer | Richard Leitner <richard.leitner@skidata.com> | 2018-08-13 14:57:45 +0200 |
commit | 050229916257fdc57d887a67a57c2ab330051717 (patch) | |
tree | 045081c6a62497851ed8fead0ef39a4d2a9213c2 /classes/java.bbclass | |
parent | 8ffbe8755cfa7b2088c415e2d649c64af8ee5167 (diff) | |
download | meta-java-050229916257fdc57d887a67a57c2ab330051717.tar.gz |
openjdk-8: fix infrastructure for version host gcc != cross gcc (again)
Building OpenJDK-8 (target) with an older host compiler (gcc < 6) does
not work as the build errors with error messages regarding unrecognized
gcc command line options.
As part of the (cross) build particularly, OpenJDK-8 builds a host tool
(adlc) using the host gcc. We have a patch, openjdk8-fix-adlc-flags.patch,
that tries to make the adlc build use the correct / intended compiler
flags.
This doesn't work right now, as that build still sees compiler flags
intended for / understood by the gcc version used for the actual cross
compile only.
The reason is that while we have infrastructure in place to add compiler
flags based on the compiler version, we add all of them unconditionally to
CFLAGS / CXXFLAGS directly but above patch uses TARGET_CFLAGS /
TARGET_CXXFLAGS to filter out unwanted BUILD_CFLAGS / BUILD_CXXFLAGS from
CFLAGS / CXXFLAGS, In other words above patch cannot do what it intends to
do and all compiler version specific flags (-fno-lifetime-dse &
-fno-delete-null-pointer-checks) end up in CFLAGS / CXXFLAGS.
So far, this was only affecting people using host gcc < 6, but upcoming
patches adding support for gcc >= 8 will add even more compiler flags that
even gcc < 7 don't support - it's time to finally address this.
We fix the issue by adding the compiler version specific flags to
BUILD_CFLAGS / BUILD_CXXFLAGS and TARGET_CFLAGS / TARGET_CXXFLAGS as
necessary, so that above patch can work as intended.
We now support all necessary combinations:
* -native builds
* -target builds
* host tools built using the native compiler during the -target build
A similar but different patch existed here before as
commit 6801f6d4e19c ("openjdk-8-common: Fix the issue of building
failed adlc on host with gcc < 6") but was reverted subsequently
due to reportedly still(?) having (new?) issues with older compilers.
This patch here is different from the older patch in that it
*doesn't* set the cflags during a python_anonymous() function, and
thus it guarantees deterministic execution order.
This change here was tested to work using host gcc versions 4.8.4 and
6.3.0 and 7.3.0
Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Diffstat (limited to 'classes/java.bbclass')
0 files changed, 0 insertions, 0 deletions