mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 22:03:17 +01:00
Several selftests Makefiles (e.g. prctl, breakpoints, etc) attempt to normalize the ARCH variable by converting x86_64 and i.86 to x86. However, it uses the conditional assignment operator '?='. When ARCH is passed as a command-line argument (e.g., during an rpmbuild process), the '?=' operator ignores the shell command and the sed transformation. This leads to an incorrect ARCH value being used, which causes build failures # make -C tools/testing/selftests TARGETS=prctl ARCH=x86_64 make: Entering directory '/build/tools/testing/selftests' make[1]: Entering directory '/build/tools/testing/selftests/prctl' make[1]: *** No targets. Stop. make[1]: Leaving directory '/build/tools/testing/selftests/prctl' make: *** [Makefile:197: all] Error 2 Change the assignment to use 'override' and ':=' to ensure the normalization logic is applied regardless of how the ARCH variable was initially defined. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Aleksei Oladko <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Wei Yang <[email protected]> Cc: Bala-Vignesh-Reddy <[email protected]> Cc: Chelsy Ratnawat <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
19 lines
410 B
Makefile
19 lines
410 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
|
|
override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/)
|
|
ifeq ($(ARCH),i386)
|
|
override ARCH := x86
|
|
CFLAGS := -DCONFIG_X86_32 -D__i386__
|
|
endif
|
|
ifeq ($(ARCH),x86_64)
|
|
override ARCH := x86
|
|
CFLAGS := -DCONFIG_X86_64 -D__x86_64__
|
|
endif
|
|
|
|
CFLAGS += $(KHDR_INCLUDES)
|
|
|
|
TEST_GEN_PROGS := msgque
|
|
|
|
include ../lib.mk
|
|
|