[PATCH] Fix libiberty.h inclusion on non-glibc hosts tree-wide
Jan Beulich
jbeulich@suse.com
Wed Nov 18 07:24:14 GMT 2026
On 18.11.2026 01:49, Nick Alcock wrote:
> In 2025, Iain Sandoe added memrchr support to libiberty.h. This requires
> a new AC_CHECK_FUNCS of memrchr in every project that transitively
> includes it, or builds on non-glibc, non-Linux hosts will fail (observed
> on FreeBSD 15).
>
> Fix trivial, but a tad invasive, since a lot of projects include
> libiberty.h, and it shows up a few places that don't include config.h at
> all (including some that include ansidecl.h, which requires config.h for
> proper operation).
>
> All relevant configury regenerated.
>
> Also touches GDB machinery, so gdb-patches is Cc:ed.
>
> Iain Sandoe Cc:ed: Iain, if you disagree with my rather nasty approach
> here, I'd be interested in anything better. (The need to use %top in
> binutils/arlex.l is slightly worrying. It's not in POSIX, but
> we need something like it or we can't include config.h before the
> system headers it must precede. (Including config.h in libiberty.h
> won't work for the same reason.)
What does this mean compatibility-wise? I.e. when did relevant tools (no
idea which one it would be on the BSDs) start supporting %top?
Jan
More information about the Binutils
mailing list