aarch64: Do not link conform tests with -Wl,-z,force-bti (bug 33601)

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.

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
This commit is contained in:
Florian Weimer 2025-11-06 11:14:53 +01:00
parent 5bf8ee7ad5
commit 75b6b263e9
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -42,6 +42,7 @@ The following bugs were resolved with this release:
[33234] Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [33234] Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables
[33245] nptl: nptl: error in internal cancellation syscall handling [33245] nptl: nptl: error in internal cancellation syscall handling
[33361] nss: Group merge does not react to ERANGE during merge [33361] nss: Group merge does not react to ERANGE during merge
[33601] aarch64: Do not link conform tests with -Wl,-z,force-bti
Version 2.41 Version 2.41

View File

@ -2,11 +2,15 @@ long-double-fcts = yes
ifeq (yes,$(aarch64-bti)) ifeq (yes,$(aarch64-bti))
# Mark linker output BTI compatible, it warns on non-BTI inputs. # Mark linker output BTI compatible, it warns on non-BTI inputs.
# Do not do this for conform tests because they may not be compiled
# with the appropriate compiler flags.
ifneq ($(subdir),conform)
sysdep-LDFLAGS += -Wl,-z,force-bti sysdep-LDFLAGS += -Wl,-z,force-bti
# Make warnings fatal outside the test system. # Make warnings fatal outside the test system.
LDFLAGS-lib.so += -Wl,--fatal-warnings LDFLAGS-lib.so += -Wl,--fatal-warnings
LDFLAGS-rtld += -Wl,-z,force-bti,--fatal-warnings LDFLAGS-rtld += -Wl,-z,force-bti,--fatal-warnings
endif endif # $(subdir) != conform
endif # $(aarch64-bit)
ifeq ($(subdir),elf) ifeq ($(subdir),elf)
sysdep-dl-routines += \ sysdep-dl-routines += \