From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Martin Beeger <martin.beeger@online.de>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: RE: [OE-core] [PATCH] cmake: read asm flags correctly from environment in toolchain file
Date: Tue, 15 Feb 2022 14:18:06 +0000 [thread overview]
Message-ID: <ae91d8b8f6184e90b5dddda21ec7a815@axis.com> (raw)
In-Reply-To: <61e8c8ee-5ddc-b3b7-44c2-30eb7546e3d0@online.de>
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Martin Beeger
> Sent: den 14 februari 2022 17:32
> To: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] cmake: read asm flags correctly from
> environment in toolchain file
>
>
> > I'm a little more puzzled on this one since whilst we set CFLAGS and
> CXXFLAGS in
> > bitbake.conf, we don't set ASMFLAGS and it wouldn't be present in our
> > environment.
> >
> > Perhaps this should be $ENV{CFLAGS} instead of ${CMAKE_C_FLAGS}? There
> are flags
> > in our CFLAGS which like need to be passed to the assembler too?
>
> I am a bit unsure now about this.
> As far as I understand the environment-setup will not set ASMFLAGS, that
> is correct. For all non-cmake recipes, the compiler will not pick up
> CFLAGS instead. It will simply still use no extra parameters for the
> inline assembly.
> In cmake it will use the CFLAGS for the ASM too, yielding inconsistent
> behaviour over build systems. Is that really a good thing?
>
> Also the CFLAGS are usually "-O2 -g". At least the -g parameter will
> have limited effect for the assembly, and optimizations for inline
> assembly are also extremely limited.
> So the practical difference between both modes and whether the flags
> propagate through is minimal, if at all existent.
>
> All critical compiler parameters like the --sysroot and others are not
> stored in CFLAGS, but are instead directly appended to the compiler
> executable path for CC, CXX and so on. These are always applied and
> cmake does understand these, parses them out, forces them to always be
> there etc.
> This code has nothing to do with that, it only impacts the optimization
> and debugging flags.
>
> This patch makes this behaviour consistent between cmake and non-cmake
> recipes in that is never applies ASM flags, instead of inconsistently
> applying them.
For the record, the variable name that, e.g., make expects for assembler
flags in its default rules is "ASFLAGS", not "ASMFLAGS".
//Peter
next prev parent reply other threads:[~2022-02-15 14:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 15:38 [PATCH] cmake: read asm flags correctly from environment in toolchain file Martin Beeger
2022-02-14 15:43 ` [OE-core] " Richard Purdie
2022-02-14 16:32 ` Martin Beeger
2022-02-15 14:18 ` Peter Kjellerstedt [this message]
2022-02-15 20:25 ` Martin Beeger
2022-07-18 16:47 ` Martin Beeger
2022-07-18 16:48 ` Martin Beeger
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=ae91d8b8f6184e90b5dddda21ec7a815@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=martin.beeger@online.de \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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