Re: [PATCH] Silence clang -Wignored-attributes when building with clang

Matt Turner <[email protected]> Tue, 4 Aug 2026 10:24:11 -0400
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <CAEdQ38E9=MsKM0Kv2dOrKCA-OTiVjHcjMzeEX9hL=7O5s8nrDw@mail.gmail.com>
On Wed, Jul 29, 2026 at 1:04=E2=80=AFPM Adhemerval Zanella Netto
<[email protected]> wrote:
>
>
>
> On 27/07/26 11:54, Matt Turner wrote:
> > Building glibc with clang trips -Wignored-attributes on the alias
> > redirections glibc uses intentionally, e.g. the long_double_symbol
> > machinery where a public name aliases a weak alias of an internal
> > symbol.
> >
> > These warnings are harmless: the alias attribute still generates
> > the correct ELF symbol table entries, and the GNU linker resolves
> > indirect alias chains at link time.  Clang warns that attributes
> > on the intermediate alias target won't be inherited by the outer
> > alias, but that attribute propagation is neither expected nor
> > needed here -- the aliasing semantics themselves are unaffected.
> >
> > Detect whether CC is clang (cc-clang) and add -Wno-ignored-attributes
> > to the warning flags.
>
> I could avoid add this flag by reworking how the weak alias were done
> for some routines (check 6b7067460f0ad8eb591735d21c60bcf3b52023df). It
> does work for x86_64 and aarch64 for clang 18 through 22 (I haven't
> tested 23 yet).
>
> Which ABI are you targeting?

I came across this while building an Alpha backend for LLVM/clang.