All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: buildroot@buildroot.org, Julien Olivain <ju.o@free.fr>
Subject: Re: [Buildroot] [PATCH] package/musl: fix build for POWER10 and later
Date: Sun, 15 Nov 2026 10:48:54 +0100	[thread overview]
Message-ID: <avl_jpXx2ArJxs_D@windsurf> (raw)
In-Reply-To: <20261115065803.1426249-1-yegorslists@googlemail.com>

On Sun, Nov 15, 2026 at 07:58:03AM +0100, Yegor Yefremov wrote:
> When targeting POWER10 or POWER11, gcc generates pc-relative code by
> default, and the resulting C functions do not preserve the TOC pointer.
> musl's powerpc64 assembly calls or tail-calls C functions assuming the
> TOC-based ABI (bl without a following nop in crt_arch.h, b __dlsym in
> dlsym.s, b __setjmp_toc in setjmp.s/sigsetjmp.s), so the linker cannot
> insert the needed TOC save/restore stubs and linking libc.so fails:
> 
>   dlstart.c:(.text+0x24): call to `_dlstart_c' lacks nop, can't restore toc; (toc save/adjust stub)
>   ld: final link failed: bad value
> 
> Build musl with -mno-pcrel for POWER10 and POWER11, so musl itself is
> built as TOC-based code. Applications can still be built with
> pc-relative code and link against it.
> 
> The issue has been reported upstream [1], as musl does not accept
> AI-assisted patches.
> 
> This issue has been present since commit 3523e1ac79c1
> ("arch/Config.in.powerpc: add Power10 CPU type"), which made it possible
> to build musl with -mcpu=power10 (and later power11, added by commit
> da1b45dd00fd ("arch/Config.in.powerpc: add Power11 CPU type")). It
> therefore affects 2026.08 and later, including 2026.08.x.
> 
> Fixes:
> https://autobuild.buildroot.org/results/1342da7c9258a93eada96f92f53a643e316ce7f6
> 
> [1] https://www.openwall.com/lists/musl/2026/11/15/2

Funnily enough, I had already reported the issue to upstream musl:

  https://www.openwall.com/lists/musl/2026/11/05/3

> Fixes: 3523e1ac79c15c5199a15589692e269191abd546 ("arch/Config.in.powerpc: add Power10 CPU type")
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied to master, thanks!

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-11-15  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15  6:58 [Buildroot] [PATCH] package/musl: fix build for POWER10 and later Yegor Yefremov
2026-11-15  9:48 ` Thomas Petazzoni via buildroot [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=avl_jpXx2ArJxs_D@windsurf \
    --to=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yegorslists@googlemail.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.