Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Norbert Lange <nolange79@gmail.com>,
	Fabrice Fontaine <fontaine.fabrice@gmail.com>,
	Sen Hastings <sen@phobosdpl.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/systemd: disable with -Ofast
Date: Tue, 21 Feb 2023 22:15:54 +0100	[thread overview]
Message-ID: <20230221211554.GI2718518@scaer> (raw)
In-Reply-To: <20230221214948.0b7ba737@windsurf>

Thomas, All,

On 2023-02-21 21:49 +0100, Thomas Petazzoni spake thusly:
> On Tue, 21 Feb 2023 21:34:03 +0100
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> 
> > The upstream code is (split for readability):
> > 
> >      if (('-Ofast' in c_args or
> >           '-ffast-math' in c_args or
> >           '-ffinite-math-only' in c_args
> >          ) and
> >          not '-fno-finite-math-only' in c_args
> >         )
> > 
> > So, if -fno-finite-math-only is in c_args, then the whole condition
> > should evaluate to false, and thus it should not error out, right?
> > 
> > Or did I lose more than my grep-fu? ;-)
> 
> No, tonight your grep-fu is better than mine: you're totally right! :-)

Note however that upstream code is anyway buggy. If CFLAGS contain, in
that order:

    -fno-finite-math-only -ffinite-math-only

then the condition will evaluate to false, and thus the test will not
abort, but still this would be incorrect, as -ffinite-math-only would
win the setting because it comes last...

So presumably, we should even be able to do:

    SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-finite-math-only -ffinite-math-only

which would again break the build....

Even if we do not do that ourselves, nothing prevents a suer from
providing that in their BR2_TARGET_OPTIMIZATION. But then, we can't
protect people from shooting themselves in the foot... ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2023-02-21 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:21 [Buildroot] [PATCH 1/1] package/systemd: disable with -Ofast Fabrice Fontaine
2023-02-21 14:48 ` Thomas Petazzoni via buildroot
2023-02-21 20:08   ` Yann E. MORIN
2023-02-21 20:26     ` Thomas Petazzoni via buildroot
2023-02-21 20:34       ` Yann E. MORIN
2023-02-21 20:49         ` Thomas Petazzoni via buildroot
2023-02-21 21:15           ` Yann E. MORIN [this message]

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=20230221211554.GI2718518@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=nolange79@gmail.com \
    --cc=sen@phobosdpl.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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