[PATCH] aarch64: Do not link conform tests with -Wl, -z, force-bti (bug 33601)
Yury Khrustalev
yury.khrustalev@arm.com
Wed Nov 12 16:39:14 GMT 2025
On Thu, Nov 06, 2025 at 08:54:55PM +0100, Florian Weimer wrote:
> * Wilco Dijkstra:
>
> > Hi Florian,
> >
> >> If the toolchain does not default to generate BTI markers in GCC,
> >> the main program for conform runtime tests will not have the
> >> BTI marker that -Wl,-z,force-bti requires. Without -Wl,-z,force-bti,
> >> the link editor will not tell the dynamic linker to enable BTI,
> >> and the missing BTI marker is harmless.
> >
> > +ifneq ($(subdir),confirm)
> >
> > Eh, did you mean conform here?
> >
> > OK with that change.
> >
> > Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
>
> It's not correct either way. 8-/
>
> This:
>
> commit 2c421fc4302ecb729823ca442f9dfab95afba752
> Author: Wilco Dijkstra <wilco.dijkstra@arm.com>
> Date: Wed May 14 16:32:31 2025 +0000
>
> ...
>
> removed
>
> LIBC_CONFIG_VAR([aarch64-bti], [$libc_cv_aarch64_bti])
>
> so the sysdeps/aarch64/Makefile check is a no-op since then, and the bug
> isn't in the current upstream sources, but it's still present in glibc
> 2.41 and earlier.
>
> Should I apply the fixed patch there?
>
Apologies for the delay. I think it makes sense to apply this patch to
2.41 and earlier if necessary.
However, I cannot reproduce an issue. I have a GCC 14.2.0 that supports
BTI but does not enable branch protection by default, so, if I'm not
mistaken, this should trigger 33601 [1] but it does not: with and without
this patch (with confirm -> conform), I get some failed conform tests
but none of them have BTI in the test output logs. So, I'm a bit
confused.
One thing that I'd like to test is that, when we enforce BTI (see [2]),
we shouldn't see conform tests failing when executed on a system that
supports BTI just because we don't link them with BTI marking, but I
think this should be OK, however I can't verify it right now. It's
probably OK anyway since the issue does not exist in the trunk where we
plan to enable BTI enforcement.
[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=33601
[2]: https://inbox.sourceware.org/libc-alpha/20251031153704.3883875-1-yury.khrustalev@arm.com/
Thanks,
Yury
More information about the Libc-alpha
mailing list