From: Patrick Ohly <patrick.ohly@intel.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [meta-java][PATCH] openjdk-8: Detect compiler version
Date: Tue, 19 Jul 2016 09:42:17 +0000 (UTC) [thread overview]
Message-ID: <loom.20160719T113248-200@post.gmane.org> (raw)
In-Reply-To: 20160715210820.6801-1-danismostlikely@gmail.com
Dan McGregor <danismostlikely <at> gmail.com> writes:
> From: Daniel McGregor <daniel.mcgregor <at> vecima.com>
>
> Some supported hosts still use GCC 4.X. These don't support the flags
> needed to make GCC 6 work, so check the GCC version and add appropriate
> compiler flags.
>
> This implementation will append flags for any gcc version, but it's only
> used for GCC 6 right now.
Now I am getting an error directly when bitbake parses the updated
recipes in meta-java:
ERROR: ExpansionError during parsing
.../ostro-os/meta-java/recipes-core/openjdk/openjdk-8_72b05.bb
...
bb.data_smart.ExpansionError: Failure expanding variable CFLAGS,
expression was -O2 -pipe -g -feliminate-unused-debug-types
-fdebug-prefix-map=.../ostro-os/build/tmp-glibc/work/corei7-64-ostro-
linux/openjdk-8/72b05-r0=/usr/src/debug/openjdk-8/72b05-r0
-fdebug-prefix-map=.../ostro-os/build/tmp-glibc/sysroots/x86_64-linux=
-fdebug-prefix-map=.../ostro-os/build/tmp-glibc/sysroots/intel-corei7-64=
-fstack-protector-strong -D_FORTIFY_SOURCE=2
${@version_specific_cflags(d)} -Wno-error=deprecated-declarations which
triggered exception TypeError: can only join an iterable
> +def version_specific_cflags(d):
> + extraflags = None
> + version = None
> +
> + if bb.data.inherits_class('native', d):
> + from subprocess import Popen, PIPE
> +
> + cmd = d.expand('${CPP} -P -').split()
> + cc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
> + # This check is GCC specific. Clang always returns 4. For Clang
> + # __clang_major__ and __clang_minor__ need to be checked. Ideally
> + # __GNUC_MINOR__ would be checked as well, but for this recipe
> + # GCC major is all we care about.
> + version = cc.communicate(b'__GNUC__')[0].decode('utf-8')[0]
> + else:
> + # in the cross case, trust that GCCVERSION is correct. This won't
> + # work if the native toolchain is Clang, but as of this writing that
> + # doesn't work anyway.
> + version = d.getVar('GCCVERSION', expand=True)[0]
> +
> + if int(version) >= 4:
> + extraflags = d.getVar('FLAGS_GCC%d' % int(version), True)
> +
> + return ''.join(extraflags)
The code above only works when FLAGS_GCC<version> is set. In Ostro OS, we
are using GCCVERSION ?= "5.%" because of these unsolveed build breakages
with gcc6, and thus extraflags becomes None, which then triggers the
exception.
The same problem should also appear when gcc on the host is older than v6.
Has the patch actually been tested on a system where the problem occurs?
As I said in the other mail thread, fixing flags for openjdk-native is one
part of the problem. The other part is distinguishing between flags for the
host compiler and and target compiler when building openjdk - that part is
unsolved, and thus I'd expect compilation to still fail when building on a
host with gcc 4.x and default target gcc.
Bye, Patrick
next prev parent reply other threads:[~2016-07-19 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 21:08 [meta-java][PATCH] openjdk-8: Detect compiler version Dan McGregor
2016-07-19 9:42 ` Patrick Ohly [this message]
2016-07-20 9:48 ` [meta-java][PATCH] openjdk-8: fix compiler detection Patrick Ohly
2016-07-20 16:04 ` Dan McGregor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20160719T113248-200@post.gmane.org \
--to=patrick.ohly@intel.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox