mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-10 13:45:12 -04:00
basic-gcs has it's own make rule to handle the special compiler
invocation to build against nolibc. This rule does not respect the
$(CFLAGS) passed by the Makefile from the parent directory.
However these $(CFLAGS) set up the include path to include the UAPI
headers from the current kernel.
Due to this the asm/hwcap.h header is used from the toolchain instead of
the UAPI and the definition of HWCAP_GCS is not found.
Restructure the rule for basic-gcs to respect the $(CFLAGS).
Also drop those options which are already provided by $(CFLAGS).
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Closes: https://lore.kernel.org/lkml/CA+G9fYv77X+kKz2YT6xw7=9UrrotTbQ6fgNac7oohOg8BgGvtw@mail.gmail.com/
Fixes: a985fe6383 ("kselftest/arm64/gcs: Use nolibc's getauxval()")
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
31 lines
878 B
Makefile
31 lines
878 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2023 ARM Limited
|
|
#
|
|
# In order to avoid interaction with the toolchain and dynamic linker the
|
|
# portions of these tests that interact with the GCS are implemented using
|
|
# nolibc.
|
|
#
|
|
|
|
TEST_GEN_PROGS := basic-gcs libc-gcs gcs-locking gcs-stress gcspushm gcsstr
|
|
TEST_GEN_PROGS_EXTENDED := gcs-stress-thread
|
|
|
|
LDLIBS+=-lpthread
|
|
|
|
include ../../lib.mk
|
|
|
|
$(OUTPUT)/basic-gcs: basic-gcs.c
|
|
$(CC) $(CFLAGS) -fno-asynchronous-unwind-tables -fno-ident -s -nostdlib -nostdinc \
|
|
-static -I../../../../include/nolibc -include ../../../../include/nolibc/nolibc.h \
|
|
-I../../../../../usr/include \
|
|
-std=gnu99 -I../.. -g \
|
|
-ffreestanding $^ -o $@ -lgcc
|
|
|
|
$(OUTPUT)/gcs-stress-thread: gcs-stress-thread.S
|
|
$(CC) -nostdlib $^ -o $@
|
|
|
|
$(OUTPUT)/gcspushm: gcspushm.S
|
|
$(CC) -nostdlib $^ -o $@
|
|
|
|
$(OUTPUT)/gcsstr: gcsstr.S
|
|
$(CC) -nostdlib $^ -o $@
|