From: Chris Packham via Gdb <gdb@sourceware.org>
To: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Cc: gdb@sourceware.org
Subject: Re: GDB 17 build failure with musl
Date: Thu, 5 Feb 2026 13:35:25 +1300 [thread overview]
Message-ID: <CAFOYHZCbHSSyGHS7aR2V5StsO_d5D2tsiB3EBoVupuMA874sqA@mail.gmail.com> (raw)
In-Reply-To: <87cy2ltaga.fsf@linaro.org>
On Wed, Feb 4, 2026 at 5:11 PM Thiago Jung Bauermann
<thiago.bauermann@linaro.org> wrote:
>
> Chris Packham <judge.packham@gmail.com> writes:
>
> > On Tue, Feb 3, 2026 at 4:10 PM Thiago Jung Bauermann
> > <thiago.bauermann@linaro.org> wrote:
> >>
> >> Do you have reproduction instructions for this problem? I'd like to
> >> experiment a bit and see if I can come up with a solution.
> >
> > The only reproduction I have right now is to build crosstool-ng then
> > use ct-ng to build the aarch64-unknown-linux-musl sample. You'd need
> > to build from crosstool-ng commit be7fafbc7b6435 as I ended up
> > reverting the update for now to unblock some builds.
> >
> > For the intrepid:
> >
> > git clone https://github.com/crosstool-ng/crosstool-ng.git
> > cd crosstool-ng
> > git checkout -B gdb-17-build be7fafbc7b6435
> > ./bootstrap && ./configure --enable-local && make
> > ./ct-ng aarch64-unknown-linux-musl
> > ./ct-ng build
> > # go get a coffee this part can take a while
> >
> > I have been meaning to come up with a better reproduction. At the very
> > least you could disable the gdb options in ./ct-ng menuconfig and use
> > the resulting toolchain & sysroot to build gdb rather than having to
> > sit through a full build to try something out (ct-ng does also have
> > various options for restarting a build from a particular step).
>
> Thank you! This got me started. I suspect I'll have to add a configure
> test for availability of struct user_gcs. I don't see any macro in
> <asm/ptrace.h> itself which is correlated to the presence of that
> struct. I'll let you know when I have a patch.
>
I came to the same conclusion although I had a hard time getting the
configure result into a place that could actually use it. If it helps
here is the configure check I wrote
# Check for `struct user_gcs`
AC_CACHE_CHECK(
[for struct user_gcs],
[gdb_cv_struct_user_gcs],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <sys/ptrace.h>
#include <asm/ptrace.h>],
[struct user_gcs u;]
)],
[gdb_cv_struct_user_gcs=yes],
[gdb_cv_struct_user_gcs=no]
)]
)
if test "$gdb_cv_struct_user_gcs" = yes; then
AC_DEFINE(HAVE_STRUCT_USER_GCS, 1,
[Define to 1 if your system has struct user_gcs.])
fi
>
> > I actually suspect you could probably see the problem on a musl based
> > distro on an aarch64 host (or docker multiarch) but I haven't looked
> > into that.
>
> Ah, that's true. I'll also test on Alpine Linux to make sure the patch
> works there.
>
> --
> Thiago
prev parent reply other threads:[~2026-02-05 0:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 6:29 Chris Packham via Gdb
2026-01-26 6:55 ` Andrew Pinski via Gdb
2026-01-26 7:31 ` Chris Packham via Gdb
2026-02-03 3:10 ` Thiago Jung Bauermann via Gdb
2026-02-03 21:56 ` Chris Packham via Gdb
2026-02-04 4:11 ` Thiago Jung Bauermann via Gdb
2026-02-05 0:35 ` Chris Packham via Gdb [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=CAFOYHZCbHSSyGHS7aR2V5StsO_d5D2tsiB3EBoVupuMA874sqA@mail.gmail.com \
--to=gdb@sourceware.org \
--cc=judge.packham@gmail.com \
--cc=thiago.bauermann@linaro.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