All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/Makefile.in: remove BR2_TARGET_OPTIMIZATION from TARGET_CFLAGS
Date: Wed, 21 Oct 2015 21:28:26 +0200	[thread overview]
Message-ID: <5627E75A.70206@mind.be> (raw)
In-Reply-To: <20151021182815.GA4112@free.fr>

On 21-10-15 20:28, Yann E. MORIN wrote:
[snip]
> However, I noticed a potential bug in the toolchain-wrapper makefile.
> Here's how we currently define BR_ADDITIONAL_CFLAGS:
> 
>     -DBR_ADDITIONAL_CFLAGS='$(foreach f,$(call qstrip,$(BR2_TARGET_OPTIMIZATION)),"$(f)",)'
> 
> Notice the last comma in there? We want to have that comma in the
> resulting expansion, so that we transform the option string:
> 
>     -mfoo -mbar -buz
> 
> into:
> 
>     "-mfoo", "-mbar", "-mbuz",
> 
> so that it can be used ina C array definition:
> 
>     static char *predef_args[] = {
>     [...]
>     #ifdef BR_ADDITIONAL_CFLAGS
>         BR_ADDITIONAL_CFLAGS
>     #endif
>     }
> 
> However, in Makefile function calls, the comma is used to separate the
> arguments passed to the function.
> 
> Even though $(foreach ...) only accepts three arguments, and the last
> comma in fact correctly ends up in the expanded string, it would be
> much safer to use $(comma) instead, like we would have to do in a call
> to any other function.

 Sure thing. Care to cook a patch?

 Regards,
 Arnout

[snip]


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2015-10-21 19:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 22:19 [Buildroot] [PATCH] package/Makefile.in: remove BR2_TARGET_OPTIMIZATION from TARGET_CFLAGS Arnout Vandecappelle
2015-10-21 18:28 ` Yann E. MORIN
2015-10-21 19:28   ` Arnout Vandecappelle [this message]
2015-10-29  9:19 ` Peter Korsgaard

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=5627E75A.70206@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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.