All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Fengwei Tan <tfx2001@outlook.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package: fix builds with $(PKG)_FLAT_STACKSIZE
Date: Thu, 20 Aug 2026 21:20:00 +0200	[thread overview]
Message-ID: <aodS3qtR9YJL5U63@windsurf> (raw)
In-Reply-To: <SY8P300MB0041B37C6A3A259B05B0404DF8A72@SY8P300MB0041.AUSP300.PROD.OUTLOOK.COM>

Hello!

On Tue, Aug 18, 2026 at 02:17:29AM +0800, Fengwei Tan wrote:
> When a package defines $(PKG)_FLAT_STACKSIZE, ELF2FLT_FLAGS contains
> -Wl,-elf2flt="-r -s<stack-size>". The embedded quotes are needed to
> keep both elf2flt options in single linker argument.
> 
> However, many package Makefiles wrap $(TARGET_CFLAGS) in double quotes,
> for example:
> 
>   CFLAGS="$(TARGET_CFLAGS)"
> 
> After expansion, the embedded quote terminates the outer CFLAGS quote.
> As a result, the shell interprets "-s<stack-size> ..." as a command
> instead of passing it to the compiler.
> 
> Pass -r and -s<stack-size> in separate -Wl arguments instead. This
> avoids embedded quotes; GCC forwards both -elf2flt options to
> ld-elf2flt, which collects them before invoking elf2flt.
> 
> Signed-off-by: Fengwei Tan <tfx2001@outlook.com>

Thanks a lot for your patch, well spotted!

One thing that was missing from your commit message is the indication
of which commit broke this, so I added that and applied your commit to
our master branch.

This feature is not actually used by any package in Buildroot, which
explains why this problem remained unnoticed. Would you be willing to
work on adding a simple test case in support/testing/ for this? I
guess it could be a very simple br2-external, with a very simple
package that uses <pkg>_FLAT_STACKSIZE.

Aside from that, no many of our users use Buildroot for noMMU
platforms. Would you mind sharing your use case? Which platform are
you using, in which context, how did you end up running into this
<pkg>_FLAT_STACKSIZE issue?

Again, thanks for your contribution!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-08-20 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 18:17 [Buildroot] [PATCH] package: fix builds with $(PKG)_FLAT_STACKSIZE Fengwei Tan
2026-08-20 19:20 ` Thomas Petazzoni via buildroot [this message]
2026-08-21 17:26   ` Fengwei Tan

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=aodS3qtR9YJL5U63@windsurf \
    --to=buildroot@buildroot.org \
    --cc=tfx2001@outlook.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 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.