All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Maxin B. John" <maxin.john@intel.com>
To: "André Draszik" <git@andred.net>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: [meta-java][PATCH] openjdk-8-common: Fix the issue of building failed adlc on host with gcc < 6
Date: Thu, 9 Aug 2018 14:19:53 +0300	[thread overview]
Message-ID: <20180809111952.GA13716@mbabyjoh-desk.ger.corp.intel.com> (raw)
In-Reply-To: <6464289341266dc9d8b146f788f07aac3af57c2a.camel@andred.net>

Hi Andre',

On Thu, Aug 09, 2018 at 12:04:01PM +0100, André Draszik wrote:
> Hi Maxin,
> 
> You reverted this patch, do you remember what the problem was? It looks
> useful, and I believe a solution similar to this one is actually needed...

IIRC, this patch caused build error on one machine with gcc version 5.1.1.

> Cheers,
> Andre'

Best Regards,
Maxin

> On Fri, 2017-09-29 at 19:24 -0700, fupan.li@windriver.com wrote:
> > From: Fupan Li <fupan.li@windriver.com>
> > 
> > The patch recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-
> > flags.patch
> > had tried to fix this issue, and it tried to filter out the
> > TARGET_FLAGS/TARGET_
> > CXXFLGAS, but for the flags such as "-fno-lifetime-dse" was added to
> > CFLAGS/CXXFLAGS,
> > directly, thus that patch failed to filter it out.
> > 
> > To fix this issue, it's better to add those GCC version specific flags to
> > BUILD_CFLAGS/
> > BUILD_CXXFLAGS and TARGET_CFLAGS/TARGET_CXXFLAGS separatedly, thus that
> > patch can work
> > as expected.
> > 
> > Signed-off-by: Fupan Li <fupan.li@windriver.com>
> > ---
> >  recipes-core/openjdk/openjdk-8-common.inc | 36 ++++++++++++++++++++----
> > -------
> >  1 file changed, 24 insertions(+), 12 deletions(-)
> > 
> > diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-
> > core/openjdk/openjdk-8-common.inc
> > index 83828e1..c609232 100644
> > --- a/recipes-core/openjdk/openjdk-8-common.inc
> > +++ b/recipes-core/openjdk/openjdk-8-common.inc
> > @@ -231,27 +231,39 @@ FLAGS_GCC7 = "-fno-lifetime-dse -fno-delete-null-
> > pointer-checks"
> >  # version is and only add the flags that are appropriate for that GCC
> >  # version.
> >  
> > -def version_specific_cflags(d):
> > +def version_specific_cflags(d, toolchain):
> >      extraflags = None
> >      version = None
> >  
> > -    if bb.data.inherits_class('native', d):
> > -        from subprocess import Popen, PIPE
> > +    from subprocess import Popen, PIPE
> > +    cmd = d.expand('%s -dumpversion' % toolchain ).split()
> > +    cc = Popen(cmd, stdout=PIPE, stderr=PIPE)
> > +    version = cc.communicate()[0].decode('utf-8')[0]
> >  
> > -        cmd = d.expand('${CC} -dumpversion').split()
> > -        cc = Popen(cmd, stdout=PIPE, stderr=PIPE)
> > -        version = cc.communicate()[0].decode('utf-8')[0]
> > +    if version.isdigit():
> > +        extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or ''
> > +        return extraflags
> > +    return ''
> > +
> > +python __anonymous() {
> > +    if bb.data.inherits_class('native', d):
> > +        toolchain = d.getVar('CC', True)
> > +        extraflags = version_specific_cflags(d, toolchain)
> > +        d.appendVar("CFLAGS", ' ' + extraflags) 
> > +        d.appendVar("CXXFLAGS", ' ' + extraflags)
> >      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 version.isdigit():
> >          extraflags = d.getVar('FLAGS_GCC%d' % int(version), True) or ''
> > -        return extraflags
> > -    return ''
> > +        d.appendVar("TARGET_CFLAGS", ' ' + extraflags)
> > +        d.appendVar("TARGET_CXXFLAGS", ' ' + extraflags)
> > +
> > +        toolchain = d.getVar('BUILD_CC', True)
> > +        extraflags = version_specific_cflags(d, toolchain)
> > +        d.appendVar("BUILD_CFLAGS", ' ' + extraflags)
> > +        d.appendVar("BUILD_CXXFLAGS", ' ' + extraflags)
> > +}
> >  
> > -CFLAGS_append = " ${@version_specific_cflags(d)}"
> > -CXXFLAGS_append = " ${@version_specific_cflags(d)}"
> >  CXX_append = " -std=gnu++98"
> > -- 
> > 2.11.0
> > 


  reply	other threads:[~2018-08-09 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30  2:24 [meta-java][PATCH] openjdk-8-common: Fix the issue of building failed adlc on host with gcc < 6 fupan.li
2017-10-03 10:14 ` [oe] " Andrew Goodbody
2017-10-09  3:06   ` fupan
2017-10-12  2:23   ` fupan
2018-08-09 11:04 ` André Draszik
2018-08-09 11:19   ` Maxin B. John [this message]
2018-08-09 17:16     ` Matthew McClain

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=20180809111952.GA13716@mbabyjoh-desk.ger.corp.intel.com \
    --to=maxin.john@intel.com \
    --cc=git@andred.net \
    --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 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.