[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3526b34a6ba674c978015a0e3a106e47dd524930.1691783604.git.falcon@tinylab.org>
Date: Sat, 12 Aug 2023 04:31:33 +0800
From: Zhangjin Wu <falcon@...ylab.org>
To: falcon@...ylab.org, w@....eu
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
tanyuan@...ylab.org, thomas@...ch.de
Subject: [PATCH v2 4/7] selftests/nolibc: allow customize CROSS_COMPILE by architecture
Some cross compilers are not just prefixed with XARCH, customize them by
architecture may simplify the test a lot, especially, when iterate with
XARCH.
After customizing this for every architecture or its variant, the
minimal test argument will be architecture or variant itself, no
CROSS_COMPILE required to be passed.
If the prefix of installed cross compiler is not the same as the one
customized, we can also pass CROSS_COMPILE as before or even pass
CROSS_COMPILE_$(XARCH) and CC from command line.
Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
---
tools/testing/selftests/nolibc/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 91ccfc27780f..5aff60d31d72 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for nolibc tests
-include ../../../scripts/Makefile.include
# We need this for the "cc-option" macro.
include ../../../build/Build.include
@@ -55,6 +54,12 @@ IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi
IMAGE = $(IMAGE_$(XARCH))
IMAGE_NAME = $(notdir $(IMAGE))
+# CROSS_COMPILE: cross toolchain prefix by architecture
+CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH))
+
+# Make CC is always prefixed with $(CROSS_COMPILE)
+include ../../../scripts/Makefile.include
+
# default kernel configurations that appear to be usable
DEFCONFIG_i386 = defconfig
DEFCONFIG_x86_64 = defconfig
--
2.25.1
Powered by blists - more mailing lists