From: Tom de Vries <tdevries@suse.de>
To: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/build] Use gnulib fnmatch
Date: Fri, 13 Nov 2026 15:52:53 +0100 [thread overview]
Message-ID: <69e3799f-231e-4e51-a70a-aefd4429350e@suse.de> (raw)
In-Reply-To: <87qzgpbr1i.fsf@linaro.org>
On 11/12/26 11:53 PM, Thiago Jung Bauermann wrote:
> Hello Tom,
>
> Tom de Vries <tdevries@suse.de> writes:
>
>> and the root cause is that we use libiberty's fnmatch, which is rather old
>> (based on some glibc v1 version).
>>
>> This happens as follows:
>> - because system libc is not glibc, the !__GNU_LIBRARY__ test in
>> libiberty/fnmatch.c succeeds and fnmatch.o contains an fnmatch function
>> - because system libc is not glibc, gnulib also compiles an fnmatch function
>> - because of the inclusion order in INTERNAL_CFLAGS of libiberty vs gnulib,
>> the libiberty copy gets used
>>
>> For contrast, on x86_64-linux:
>> - because system libc is glibc, the !__GNU_LIBRARY__ test in
>> libiberty/fnmatch.c fails and fnmatch.o is empty
>> - because system libc is glibc, gnulib doesn't compile an fnmatch function
>> - fnmatch binds to fnmatch from the system glibc
>>
>> Fix this by changing the inclusion order in INTERNAL_CFLAGS.
>
> This is somewhat subtle. Can it be fixed instead by removing
> libiberty/fnmatch.c from the repo?
>
Hi Thiago,
thanks for the review.
That's a good question. I've looked into this a bit. I think this is
the solution we want eventually, but for that to happen we need to
update gcc to no longer use it (and start using gnulib), as well as
other components in our repo which use the libiberty version instead of
gnulib. So that's quite a project.
I've updated the patch with a large comment explaining why the inclusion
order is relevant, also discussing the alternative you mention here (
https://sourceware.org/pipermail/gdb-patches/2026-November/231883.html ).
Thanks,
- Tom
next prev parent reply other threads:[~2026-11-13 14:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 19:26 Tom de Vries
2026-11-12 22:53 ` Thiago Jung Bauermann
2026-11-13 14:52 ` Tom de Vries [this message]
2026-11-13 18:16 ` Tom Tromey
2026-11-18 15:57 ` Tom de Vries
2026-11-19 20:39 ` Tom Tromey
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=69e3799f-231e-4e51-a70a-aefd4429350e@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--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