From: Leo Yan <leo.yan@arm.com>
To: "Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Ian Rogers" <irogers@google.com>,
"Namhyung Kim" <namhyung@kernel.org>,
"James Clark" <james.clark@linaro.org>,
"Kees Cook" <kees@kernel.org>, "Quentin Monnet" <qmo@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"John Fastabend" <john.fastabend@gmail.com>,
"KP Singh" <kpsingh@kernel.org>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Daniel Lezcano" <daniel.lezcano@kernel.org>,
"Zhang Rui" <rui.zhang@intel.com>,
"Lukasz Luba" <lukasz.luba@arm.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"William Breathitt Gray" <wbg@kernel.org>,
"Barry Song" <baohua@kernel.org>,
"Qinxin Xia" <xiaqinxin@huawei.com>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Kent Gibson" <warthog618@gmail.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
"Haiyang Zhang" <haiyangz@microsoft.com>,
"Wei Liu" <wei.liu@kernel.org>,
"Dexuan Cui" <decui@microsoft.com>,
"Long Li" <longli@microsoft.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Willy Tarreau" <w@1wt.eu>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Robert Moore" <robert.moore@intel.com>,
"Len Brown" <lenb@kernel.org>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
"Tejun Heo" <tj@kernel.org>, "David Vernet" <void@manifault.com>,
"Andrea Righi" <arighi@nvidia.com>,
"Changwoo Min" <changwoo@igalia.com>,
"Mark Brown" <broonie@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Gabriele Monaco" <gmonaco@redhat.com>,
"Shuah Khan" <shuah@kernel.org>, "Jiri Kosina" <jikos@kernel.org>,
"Benjamin Tissoires" <bentiss@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org, Leo Yan <leo.yan@arm.com>
Subject: [PATCH v7 05/23] selftests/nolibc: Use a dedicated cross cc-option helper
Date: Tue, 02 Jun 2026 15:40:39 +0100 [thread overview]
Message-ID: <20260602-tools_build_fix_zero_init-v7-5-631baf679fe7@arm.com> (raw)
In-Reply-To: <20260602-tools_build_fix_zero_init-v7-0-631baf679fe7@arm.com>
Makefile.nolibc uses cc-option for architecture-specific flag probes
such as -m32, -mmultiple and -mabi=elfv2. These probes need to include
CLANG_CROSS_FLAGS so that Clang tests the option for the selected target
instead of the host.
The file also includes tools/scripts/Makefile.include. In a sequential
change, Makefile.include will define its own cc-option helper.
Rename the nolibc helper to cross-cc-option and use it for the
architecture-specific probes that require CLANG_CROSS_FLAGS. This keeps
the cross-build checks explicit and avoids clashing with the common
tools cc-option helper.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/testing/selftests/nolibc/Makefile.nolibc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc
index f30bc68470cceec2b61805af0a4a9f2fb2de7c57..e88b1c15445f3c64dd78cc7edef5c9670a389b50 100644
--- a/tools/testing/selftests/nolibc/Makefile.nolibc
+++ b/tools/testing/selftests/nolibc/Makefile.nolibc
@@ -23,7 +23,7 @@ include $(srctree)/scripts/subarch.include
ARCH = $(SUBARCH)
endif
-cc-option = $(call __cc-option, $(CC),$(CLANG_CROSS_FLAGS),$(1),$(2))
+cross-cc-option = $(call __cc-option, $(CC),$(CLANG_CROSS_FLAGS),$(1),$(2))
# XARCH extends the kernel's ARCH with a few variants of the same
# architecture that only differ by the configuration, the toolchain
@@ -211,13 +211,13 @@ else
Q=@
endif
-CFLAGS_i386 = $(call cc-option,-m32)
+CFLAGS_i386 = $(call cross-cc-option,-m32)
CFLAGS_x32 = -mx32
CFLAGS_arm = -marm
CFLAGS_armthumb = -mthumb -march=armv6t2
-CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
-CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
-CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2)
+CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cross-cc-option,-mmultiple)
+CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cross-cc-option,-mmultiple)
+CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cross-cc-option,-mabi=elfv2)
CFLAGS_s390x = -m64
CFLAGS_mips32le = -EL -mabi=32 -fPIC
CFLAGS_mips32be = -EB -mabi=32
@@ -226,7 +226,7 @@ CFLAGS_mipsn32be = -EB -mabi=n32 -march=mips64r6
CFLAGS_mips64le = -EL -mabi=64 -march=mips64r6
CFLAGS_mips64be = -EB -mabi=64 -march=mips64r2
CFLAGS_loongarch = $(if $(LLVM),-fuse-ld=lld)
-CFLAGS_sparc32 = $(call cc-option,-m32) -mcpu=v8
+CFLAGS_sparc32 = $(call cross-cc-option,-m32) -mcpu=v8
CFLAGS_sh4 = -ml -m4
ifeq ($(origin XARCH),command line)
CFLAGS_XARCH = $(CFLAGS_$(XARCH))
--
2.34.1
next prev parent reply other threads:[~2026-06-02 14:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 14:40 [PATCH v7 00/23] tools build: Append -fzero-init-padding-bits=all option Leo Yan
2026-06-02 14:40 ` [PATCH v7 01/23] tools: lib: thermal: Fix typo Leo Yan
2026-06-02 14:40 ` [PATCH v7 02/23] tools/thermal: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 03/23] tools: lib: thermal: Initialize CFLAGS before including Makefile.include Leo Yan
2026-06-02 14:40 ` [PATCH v7 04/23] tools/thermal: " Leo Yan
2026-06-02 14:40 ` Leo Yan [this message]
2026-06-02 14:40 ` [PATCH v7 06/23] tools build: Append -fzero-init-padding-bits=all to extra cflags Leo Yan
2026-06-02 14:40 ` [PATCH v7 07/23] perf build: Append extra host flags Leo Yan
2026-06-02 14:40 ` [PATCH v7 08/23] tools build: Append extra host CFLAGS for fixdep Leo Yan
2026-06-02 14:40 ` [PATCH v7 09/23] tools: bootconfig: Append extra cflags Leo Yan
2026-06-02 14:40 ` [PATCH v7 10/23] tools: counter: " Leo Yan
2026-06-04 2:02 ` William Breathitt Gray
2026-06-02 14:40 ` [PATCH v7 11/23] tools: dma: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 12/23] tools: gpio: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 13/23] tools: hv: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 14/23] tools: iio: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 15/23] tools: mm: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 16/23] tools: objtool: Append extra host cflags Leo Yan
2026-06-02 14:40 ` [PATCH v7 17/23] tools: power: acpi: Append extra cflags Leo Yan
2026-06-02 14:40 ` [PATCH v7 18/23] tools: power: x86/intel-speed-select: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 19/23] tools: sched_ext: " Leo Yan
2026-06-02 21:27 ` Tejun Heo
2026-06-02 14:40 ` [PATCH v7 20/23] tools: spi: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 21/23] tools: tracing: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 22/23] tools: usb: " Leo Yan
2026-06-02 14:40 ` [PATCH v7 23/23] selftests: Include tools Makefile.include Leo Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260602-tools_build_fix_zero_init-v7-5-631baf679fe7@arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrii@kernel.org \
--cc=andy@kernel.org \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=baohua@kernel.org \
--cc=bentiss@kernel.org \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=changwoo@igalia.com \
--cc=daniel.lezcano@kernel.org \
--cc=daniel@iogearbox.net \
--cc=decui@microsoft.com \
--cc=dlechner@baylibre.com \
--cc=eddyz87@gmail.com \
--cc=gmonaco@redhat.com \
--cc=haiyangz@microsoft.com \
--cc=haoluo@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kys@microsoft.com \
--cc=lenb@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=longli@microsoft.com \
--cc=lukasz.luba@arm.com \
--cc=mark.rutland@arm.com \
--cc=martin.lau@linux.dev \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nsc@kernel.org \
--cc=nuno.sa@analog.com \
--cc=peterz@infradead.org \
--cc=qmo@kernel.org \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=rostedt@goodmis.org \
--cc=rui.zhang@intel.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tj@kernel.org \
--cc=void@manifault.com \
--cc=w@1wt.eu \
--cc=warthog618@gmail.com \
--cc=wbg@kernel.org \
--cc=wei.liu@kernel.org \
--cc=xiaqinxin@huawei.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox