[PATCH v4 3/4] selftests/x86: don't clobber CFLAGS
From: Ilpo Järvinen
Date: Tue Sep 03 2024 - 10:46:58 EST
The x86 selftests makefile clobbers CFLAGS preventing lib.mk from
making the necessary adjustments into CFLAGS. This would lead to a
build failure after upcoming change which wants to add -DHAVE_CPUID=
into CFLAGS.
Reorder CFLAGS initialization in x86 selftest. Place the constant part
of CFLAGS initialization before inclusion of lib.mk but leave adding
KHDR_INCLUDES into CFLAGS into the existing position because
KHDR_INCLUDES might be generated inside lib.mk.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
---
v4:
- New patch
tools/testing/selftests/x86/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 5c8757a25998..88a6576de92f 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
+CFLAGS := -O2 -g -std=gnu99 -pthread -Wall
+
all:
include ../lib.mk
@@ -35,7 +37,7 @@ BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64)
BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
-CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
+CFLAGS += $(KHDR_INCLUDES)
# call32_from_64 in thunks.S uses absolute addresses.
ifeq ($(CAN_BUILD_WITH_NOPIE),1)
--
2.39.2