* [PATCH v4 01/30] tools: lib: thermal: Fix typo
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-16 11:50 ` Daniel Lezcano
2026-03-11 8:29 ` [PATCH v4 02/30] tools/thermal: " Leo Yan
` (29 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
s/CFGLAS/CFLAGS
Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/lib/thermal/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile
index 41aa7a324ff4d76351b89d7d7cf382df3fc14052..09d8f4ba6a0ab7ab9c99ac7f64d52d0268bee340 100644
--- a/tools/lib/thermal/Makefile
+++ b/tools/lib/thermal/Makefile
@@ -66,8 +66,8 @@ override CFLAGS += -fPIC
override CFLAGS += $(NL3_CFLAGS)
override CFLAGS += $(INCLUDES)
override CFLAGS += -fvisibility=hidden
-override CFGLAS += -Wl,-L.
-override CFGLAS += -Wl,-lthermal
+override CFLAGS += -Wl,-L.
+override CFLAGS += -Wl,-lthermal
all:
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 01/30] tools: lib: thermal: Fix typo
2026-03-11 8:29 ` [PATCH v4 01/30] tools: lib: thermal: Fix typo Leo Yan
@ 2026-03-16 11:50 ` Daniel Lezcano
0 siblings, 0 replies; 57+ messages in thread
From: Daniel Lezcano @ 2026-03-16 11:50 UTC (permalink / raw)
To: Leo Yan, Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim,
James Clark, Kees Cook, Quentin Monnet, Nathan Chancellor,
Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On 3/11/26 09:29, Leo Yan wrote:
> s/CFGLAS/CFLAGS
>
> Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
Acked-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Thanks !
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 02/30] tools/thermal: Fix typo
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
2026-03-11 8:29 ` [PATCH v4 01/30] tools: lib: thermal: Fix typo Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-16 11:51 ` Daniel Lezcano
2026-03-11 8:29 ` [PATCH v4 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include Leo Yan
` (28 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
s/CFGLAS/CFLAGS
Fixes: 3b7c5e8adf9c ("tools/thermal: Add util library")
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/thermal/lib/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/thermal/lib/Makefile b/tools/thermal/lib/Makefile
index 056d212f25cf51cd8c02260fbe2ef28dda5e4acb..8c9a37f999b826855dad11c0d9574b41d5b24244 100644
--- a/tools/thermal/lib/Makefile
+++ b/tools/thermal/lib/Makefile
@@ -60,8 +60,8 @@ override CFLAGS += $(EXTRA_WARNINGS)
override CFLAGS += -Werror -Wall
override CFLAGS += -fPIC
override CFLAGS += $(INCLUDES)
-override CFGLAS += -Wl,-L.
-override CFGLAS += -Wl,-lthermal
+override CFLAGS += -Wl,-L.
+override CFLAGS += -Wl,-lthermal
all:
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 02/30] tools/thermal: Fix typo
2026-03-11 8:29 ` [PATCH v4 02/30] tools/thermal: " Leo Yan
@ 2026-03-16 11:51 ` Daniel Lezcano
0 siblings, 0 replies; 57+ messages in thread
From: Daniel Lezcano @ 2026-03-16 11:51 UTC (permalink / raw)
To: Leo Yan, Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim,
James Clark, Kees Cook, Quentin Monnet, Nathan Chancellor,
Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On 3/11/26 09:29, Leo Yan wrote:
> s/CFGLAS/CFLAGS
>
> Fixes: 3b7c5e8adf9c ("tools/thermal: Add util library")
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
Acked-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Thanks !
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
2026-03-11 8:29 ` [PATCH v4 01/30] tools: lib: thermal: Fix typo Leo Yan
2026-03-11 8:29 ` [PATCH v4 02/30] tools/thermal: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-16 11:51 ` Daniel Lezcano
2026-03-11 8:29 ` [PATCH v4 04/30] tools/thermal: " Leo Yan
` (27 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
change. This could alter the initialization of CFLAGS in the thermal
Makefile, as the default options "-g -Wall" would never be set once
EXTRA_CFLAGS is expanded.
Prepare for this by moving the CFLAGS initialization before including
tools/scripts/Makefile.include, so it is not affected by the extended
EXTRA_CFLAGS.
Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
place it last so that the extra flags propagate properly and can
override the default options.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/lib/thermal/Makefile | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile
index 09d8f4ba6a0ab7ab9c99ac7f64d52d0268bee340..b55fa42cefa47628b7f2fac32fc08fcd82580a0e 100644
--- a/tools/lib/thermal/Makefile
+++ b/tools/lib/thermal/Makefile
@@ -23,6 +23,14 @@ INSTALL = install
DESTDIR ?=
DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
+# Defer assigning EXTRA_CFLAGS to CFLAGS until after including
+# tools/scripts/Makefile.include, as it may add flags to EXTRA_CFLAGS.
+ifdef EXTRA_CFLAGS
+ CFLAGS :=
+else
+ CFLAGS := -g -Wall
+endif
+
include $(srctree)/tools/scripts/Makefile.include
include $(srctree)/tools/scripts/Makefile.arch
@@ -39,13 +47,6 @@ libdir = $(prefix)/$(libdir_relative)
libdir_SQ = $(subst ','\'',$(libdir))
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
-# Set compile option CFLAGS
-ifdef EXTRA_CFLAGS
- CFLAGS := $(EXTRA_CFLAGS)
-else
- CFLAGS := -g -Wall
-endif
-
NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null)
ifeq ($(NL3_CFLAGS),)
NL3_CFLAGS = -I/usr/include/libnl3
@@ -68,6 +69,7 @@ override CFLAGS += $(INCLUDES)
override CFLAGS += -fvisibility=hidden
override CFLAGS += -Wl,-L.
override CFLAGS += -Wl,-lthermal
+override CFLAGS += $(EXTRA_CFLAGS)
all:
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include
2026-03-11 8:29 ` [PATCH v4 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include Leo Yan
@ 2026-03-16 11:51 ` Daniel Lezcano
0 siblings, 0 replies; 57+ messages in thread
From: Daniel Lezcano @ 2026-03-16 11:51 UTC (permalink / raw)
To: Leo Yan, Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim,
James Clark, Kees Cook, Quentin Monnet, Nathan Chancellor,
Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On 3/11/26 09:29, Leo Yan wrote:
> tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
> change. This could alter the initialization of CFLAGS in the thermal
> Makefile, as the default options "-g -Wall" would never be set once
> EXTRA_CFLAGS is expanded.
>
> Prepare for this by moving the CFLAGS initialization before including
> tools/scripts/Makefile.include, so it is not affected by the extended
> EXTRA_CFLAGS.
>
> Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
> place it last so that the extra flags propagate properly and can
> override the default options.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
Acked-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Thanks !
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 04/30] tools/thermal: Initialize CFLAGS before including Makefile.include
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (2 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS Leo Yan
` (26 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
change. This could alter the initialization of CFLAGS in the thermal
Makefile, as the default options "-g -Wall" would never be set once
EXTRA_CFLAGS is expanded.
Prepare for this by moving the CFLAGS initialization before including
tools/scripts/Makefile.include, so it is not affected by the extended
EXTRA_CFLAGS.
Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
place it last so that the extra flags propagate properly and can
override the default options.
Acked-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/thermal/lib/Makefile | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/thermal/lib/Makefile b/tools/thermal/lib/Makefile
index 8c9a37f999b826855dad11c0d9574b41d5b24244..333b711bc7f0f9610e165ff7dc72c42980c59c99 100644
--- a/tools/thermal/lib/Makefile
+++ b/tools/thermal/lib/Makefile
@@ -23,6 +23,14 @@ INSTALL = install
DESTDIR ?=
DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
+# Defer assigning EXTRA_CFLAGS to CFLAGS until after including
+# tools/scripts/Makefile.include, as it may add flags to EXTRA_CFLAGS.
+ifdef EXTRA_CFLAGS
+ CFLAGS :=
+else
+ CFLAGS := -g -Wall
+endif
+
include $(srctree)/tools/scripts/Makefile.include
include $(srctree)/tools/scripts/Makefile.arch
@@ -39,13 +47,6 @@ libdir = $(prefix)/$(libdir_relative)
libdir_SQ = $(subst ','\'',$(libdir))
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
-# Set compile option CFLAGS
-ifdef EXTRA_CFLAGS
- CFLAGS := $(EXTRA_CFLAGS)
-else
- CFLAGS := -g -Wall
-endif
-
INCLUDES = \
-I/usr/include/libnl3 \
-I$(srctree)/tools/lib/thermal/include \
@@ -62,6 +63,7 @@ override CFLAGS += -fPIC
override CFLAGS += $(INCLUDES)
override CFLAGS += -Wl,-L.
override CFLAGS += -Wl,-lthermal
+override CFLAGS += $(EXTRA_CFLAGS)
all:
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (3 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 04/30] tools/thermal: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-12 17:19 ` Ian Rogers
2026-03-11 8:29 ` [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS) Leo Yan
` (25 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Prepare for future changes where EXTRA_CFLAGS may include flags not
applicable to the host compiler.
Move the HOST_CFLAGS assignment before appending EXTRA_CFLAGS to
CFLAGS so that HOST_CFLAGS does not inherit flags from EXTRA_CFLAGS.
Acked-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/bpf/bpftool/Makefile | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 519ea5cb8ab1c0ee31acc67fc5f96b40e21005c2..3e7d8359e1b2a81a29a47544be8539e3b191a0e8 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -81,6 +81,12 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
ifneq ($(BPFTOOL_VERSION),)
CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
endif
+
+# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
+# including flags that are not applicable to the host compiler.
+HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
+ $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
+
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
endif
@@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
LDFLAGS += $(EXTRA_LDFLAGS)
endif
-HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
- $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
HOST_LDFLAGS := $(LDFLAGS)
INSTALL ?= install
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-11 8:29 ` [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS Leo Yan
@ 2026-03-12 17:19 ` Ian Rogers
2026-03-13 15:56 ` Leo Yan
0 siblings, 1 reply; 57+ messages in thread
From: Ian Rogers @ 2026-03-12 17:19 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, Mar 11, 2026 at 1:30 AM Leo Yan <leo.yan@arm.com> wrote:
>
> Prepare for future changes where EXTRA_CFLAGS may include flags not
> applicable to the host compiler.
>
> Move the HOST_CFLAGS assignment before appending EXTRA_CFLAGS to
> CFLAGS so that HOST_CFLAGS does not inherit flags from EXTRA_CFLAGS.
>
> Acked-by: Quentin Monnet <qmo@kernel.org>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/bpf/bpftool/Makefile | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 519ea5cb8ab1c0ee31acc67fc5f96b40e21005c2..3e7d8359e1b2a81a29a47544be8539e3b191a0e8 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -81,6 +81,12 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
> ifneq ($(BPFTOOL_VERSION),)
> CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
> endif
> +
> +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
> +# including flags that are not applicable to the host compiler.
> +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> +
> ifneq ($(EXTRA_CFLAGS),)
> CFLAGS += $(EXTRA_CFLAGS)
> endif
> @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
> LDFLAGS += $(EXTRA_LDFLAGS)
> endif
>
> -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> HOST_LDFLAGS := $(LDFLAGS)
Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target
flags in EXTRA_LDFLAGS will be added for the host.
Thanks,
Ian
> INSTALL ?= install
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-12 17:19 ` Ian Rogers
@ 2026-03-13 15:56 ` Leo Yan
2026-03-13 16:07 ` Quentin Monnet
0 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-13 15:56 UTC (permalink / raw)
To: Ian Rogers
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Thu, Mar 12, 2026 at 10:19:01AM -0700, Ian Rogers wrote:
> On Wed, Mar 11, 2026 at 1:30 AM Leo Yan <leo.yan@arm.com> wrote:
> >
> > Prepare for future changes where EXTRA_CFLAGS may include flags not
> > applicable to the host compiler.
> >
> > Move the HOST_CFLAGS assignment before appending EXTRA_CFLAGS to
> > CFLAGS so that HOST_CFLAGS does not inherit flags from EXTRA_CFLAGS.
> >
> > Acked-by: Quentin Monnet <qmo@kernel.org>
> > Signed-off-by: Leo Yan <leo.yan@arm.com>
> > ---
> > tools/bpf/bpftool/Makefile | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > index 519ea5cb8ab1c0ee31acc67fc5f96b40e21005c2..3e7d8359e1b2a81a29a47544be8539e3b191a0e8 100644
> > --- a/tools/bpf/bpftool/Makefile
> > +++ b/tools/bpf/bpftool/Makefile
> > @@ -81,6 +81,12 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
> > ifneq ($(BPFTOOL_VERSION),)
> > CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
> > endif
> > +
> > +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
> > +# including flags that are not applicable to the host compiler.
> > +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> > + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> > +
> > ifneq ($(EXTRA_CFLAGS),)
> > CFLAGS += $(EXTRA_CFLAGS)
> > endif
> > @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
> > LDFLAGS += $(EXTRA_LDFLAGS)
> > endif
> >
> > -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> > - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> > HOST_LDFLAGS := $(LDFLAGS)
>
> Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target
> flags in EXTRA_LDFLAGS will be added for the host.
Though this series is irrelevant to LDFLAGS, I am fine to move
HOST_LDFLAGS together.
Quentin, how about you think?
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-13 15:56 ` Leo Yan
@ 2026-03-13 16:07 ` Quentin Monnet
2026-03-13 16:24 ` Leo Yan
0 siblings, 1 reply; 57+ messages in thread
From: Quentin Monnet @ 2026-03-13 16:07 UTC (permalink / raw)
To: Leo Yan, Ian Rogers
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
Bill Wendling, Justin Stitt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Adrian Hunter, Masami Hiramatsu,
William Breathitt Gray, Barry Song, Qinxin Xia,
Bartosz Golaszewski, Kent Gibson, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Long Li, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko, Andrew Morton, Willy Tarreau,
Thomas Weißschuh, Josh Poimboeuf, Robert Moore, Len Brown,
Srinivas Pandruvada, Tejun Heo, David Vernet, Andrea Righi,
Changwoo Min, Mark Brown, Steven Rostedt, Gabriele Monaco,
Shuah Khan, Jiri Kosina, Benjamin Tissoires, linux-kbuild,
linux-kernel, llvm, bpf, linux-perf-users
2026-03-13 15:56 UTC+0000 ~ Leo Yan <leo.yan@arm.com>
> On Thu, Mar 12, 2026 at 10:19:01AM -0700, Ian Rogers wrote:
>> On Wed, Mar 11, 2026 at 1:30 AM Leo Yan <leo.yan@arm.com> wrote:
>>>
>>> Prepare for future changes where EXTRA_CFLAGS may include flags not
>>> applicable to the host compiler.
>>>
>>> Move the HOST_CFLAGS assignment before appending EXTRA_CFLAGS to
>>> CFLAGS so that HOST_CFLAGS does not inherit flags from EXTRA_CFLAGS.
>>>
>>> Acked-by: Quentin Monnet <qmo@kernel.org>
>>> Signed-off-by: Leo Yan <leo.yan@arm.com>
>>> ---
>>> tools/bpf/bpftool/Makefile | 8 ++++++--
>>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
>>> index 519ea5cb8ab1c0ee31acc67fc5f96b40e21005c2..3e7d8359e1b2a81a29a47544be8539e3b191a0e8 100644
>>> --- a/tools/bpf/bpftool/Makefile
>>> +++ b/tools/bpf/bpftool/Makefile
>>> @@ -81,6 +81,12 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
>>> ifneq ($(BPFTOOL_VERSION),)
>>> CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
>>> endif
>>> +
>>> +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
>>> +# including flags that are not applicable to the host compiler.
>>> +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
>>> + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
>>> +
>>> ifneq ($(EXTRA_CFLAGS),)
>>> CFLAGS += $(EXTRA_CFLAGS)
>>> endif
>>> @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
>>> LDFLAGS += $(EXTRA_LDFLAGS)
>>> endif
>>>
>>> -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
>>> - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
>>> HOST_LDFLAGS := $(LDFLAGS)
>>
>> Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target
>> flags in EXTRA_LDFLAGS will be added for the host.
>
> Though this series is irrelevant to LDFLAGS, I am fine to move
> HOST_LDFLAGS together.
If we move the HOST_LDFLAGS earlier so that they no longer receive the
EXTRA_LDFLAGS, then we lose the possibility to use any EXTRA variable to
pass additional flags to HOST_LDFLAGS. So OK to move, but maybe add a
"HOST_LDFLAGS += $(HOST_EXTRALDFLAGS)" to it for consistency with the
processing of HOST_CFLAGS?
Quentin
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-13 16:07 ` Quentin Monnet
@ 2026-03-13 16:24 ` Leo Yan
2026-03-13 16:26 ` Quentin Monnet
0 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-13 16:24 UTC (permalink / raw)
To: Quentin Monnet
Cc: Ian Rogers, Arnaldo Carvalho de Melo, Namhyung Kim, James Clark,
Kees Cook, Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
Bill Wendling, Justin Stitt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Adrian Hunter, Masami Hiramatsu,
William Breathitt Gray, Barry Song, Qinxin Xia,
Bartosz Golaszewski, Kent Gibson, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Long Li, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko, Andrew Morton, Willy Tarreau,
Thomas Weißschuh, Josh Poimboeuf, Robert Moore, Len Brown,
Srinivas Pandruvada, Tejun Heo, David Vernet, Andrea Righi,
Changwoo Min, Mark Brown, Steven Rostedt, Gabriele Monaco,
Shuah Khan, Jiri Kosina, Benjamin Tissoires, linux-kbuild,
linux-kernel, llvm, bpf, linux-perf-users
On Fri, Mar 13, 2026 at 04:07:27PM +0000, Quentin Monnet wrote:
[...]
> >>> +
> >>> +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
> >>> +# including flags that are not applicable to the host compiler.
> >>> +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> >>> + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> >>> +
> >>> ifneq ($(EXTRA_CFLAGS),)
> >>> CFLAGS += $(EXTRA_CFLAGS)
> >>> endif
> >>> @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
> >>> LDFLAGS += $(EXTRA_LDFLAGS)
> >>> endif
> >>>
> >>> -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
> >>> - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
> >>> HOST_LDFLAGS := $(LDFLAGS)
> >>
> >> Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target
> >> flags in EXTRA_LDFLAGS will be added for the host.
> >
> > Though this series is irrelevant to LDFLAGS, I am fine to move
> > HOST_LDFLAGS together.
>
>
> If we move the HOST_LDFLAGS earlier so that they no longer receive the
> EXTRA_LDFLAGS, then we lose the possibility to use any EXTRA variable to
> pass additional flags to HOST_LDFLAGS. So OK to move, but maybe add a
> "HOST_LDFLAGS += $(HOST_EXTRALDFLAGS)" to it for consistency with the
> processing of HOST_CFLAGS?
Adding HOST_EXTRALDFLAGS seems a bit over designed to me, as there is
no use case for it currently. To avoid complexity, let's keep this
patch as it is, we can add HOST_EXTRALDFLAGS if later have requirement.
P.s. I saw that you already replied the same comment in the previous
version. I should have confirmed at that time, sorry for the duplicate
discussion.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
2026-03-13 16:24 ` Leo Yan
@ 2026-03-13 16:26 ` Quentin Monnet
0 siblings, 0 replies; 57+ messages in thread
From: Quentin Monnet @ 2026-03-13 16:26 UTC (permalink / raw)
To: Leo Yan
Cc: Ian Rogers, Arnaldo Carvalho de Melo, Namhyung Kim, James Clark,
Kees Cook, Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
Bill Wendling, Justin Stitt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Adrian Hunter, Masami Hiramatsu,
William Breathitt Gray, Barry Song, Qinxin Xia,
Bartosz Golaszewski, Kent Gibson, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Long Li, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko, Andrew Morton, Willy Tarreau,
Thomas Weißschuh, Josh Poimboeuf, Robert Moore, Len Brown,
Srinivas Pandruvada, Tejun Heo, David Vernet, Andrea Righi,
Changwoo Min, Mark Brown, Steven Rostedt, Gabriele Monaco,
Shuah Khan, Jiri Kosina, Benjamin Tissoires, linux-kbuild,
linux-kernel, llvm, bpf, linux-perf-users
2026-03-13 16:24 UTC+0000 ~ Leo Yan <leo.yan@arm.com>
> On Fri, Mar 13, 2026 at 04:07:27PM +0000, Quentin Monnet wrote:
>
> [...]
>
>>>>> +
>>>>> +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid
>>>>> +# including flags that are not applicable to the host compiler.
>>>>> +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
>>>>> + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
>>>>> +
>>>>> ifneq ($(EXTRA_CFLAGS),)
>>>>> CFLAGS += $(EXTRA_CFLAGS)
>>>>> endif
>>>>> @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),)
>>>>> LDFLAGS += $(EXTRA_LDFLAGS)
>>>>> endif
>>>>>
>>>>> -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
>>>>> - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
>>>>> HOST_LDFLAGS := $(LDFLAGS)
>>>>
>>>> Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target
>>>> flags in EXTRA_LDFLAGS will be added for the host.
>>>
>>> Though this series is irrelevant to LDFLAGS, I am fine to move
>>> HOST_LDFLAGS together.
>>
>>
>> If we move the HOST_LDFLAGS earlier so that they no longer receive the
>> EXTRA_LDFLAGS, then we lose the possibility to use any EXTRA variable to
>> pass additional flags to HOST_LDFLAGS. So OK to move, but maybe add a
>> "HOST_LDFLAGS += $(HOST_EXTRALDFLAGS)" to it for consistency with the
>> processing of HOST_CFLAGS?
>
> Adding HOST_EXTRALDFLAGS seems a bit over designed to me, as there is
> no use case for it currently. To avoid complexity, let's keep this
> patch as it is, we can add HOST_EXTRALDFLAGS if later have requirement.
>
> P.s. I saw that you already replied the same comment in the previous
> version. I should have confirmed at that time, sorry for the duplicate
> discussion.
That's fine :) - And agreed, it's probably best to leave it as-is for
now. Thanks!
Quentin
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS)
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (4 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 9:02 ` bot+bpf-ci
2026-03-11 8:29 ` [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include Leo Yan
` (24 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
tools/scripts/Makefile.include already appends $(CLANG_CROSS_FLAGS) to
CFLAGS:
CFLAGS += $(CLANG_CROSS_FLAGS)
Since Makefile.include is included, the libbpf Makefile appends
$(CLANG_CROSS_FLAGS) again, resulting in duplicate flags.
Remove the redundant append.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/lib/bpf/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 168140f8e6461bd06db40e23d21a3fb8847ccbf4..b1fbd0211c5edde7be3d98630b16e53e028d9116 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -84,7 +84,6 @@ override CFLAGS += -Werror -Wall
override CFLAGS += $(INCLUDES)
override CFLAGS += -fvisibility=hidden
override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-override CFLAGS += $(CLANG_CROSS_FLAGS)
# flags specific for shared library
SHLIB_FLAGS := -DSHARED -fPIC
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS)
2026-03-11 8:29 ` [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS) Leo Yan
@ 2026-03-11 9:02 ` bot+bpf-ci
2026-03-11 9:35 ` Leo Yan
0 siblings, 1 reply; 57+ messages in thread
From: bot+bpf-ci @ 2026-03-11 9:02 UTC (permalink / raw)
To: leo.yan, acme, irogers, namhyung, james.clark, kees, qmo, nathan,
nsc, nick.desaulniers+lkml, morbo, justinstitt, ast, daniel,
andrii, martin.lau, eddyz87, song, yonghong.song, john.fastabend,
kpsingh, sdf, haoluo, jolsa, rafael, daniel.lezcano, rui.zhang,
lukasz.luba, peterz, mingo, mark.rutland, alexander.shishkin,
adrian.hunter, mhiramat, wbg, baohua, xiaqinxin, brgl, warthog618,
kys, haiyangz, wei.liu, decui, longli, jic23, dlechner, nuno.sa,
andy, akpm, w, linux, jpoimboe, robert.moore, lenb,
srinivas.pandruvada, tj, void, arighi, changwoo, broonie, rostedt,
gmonaco, shuah, jikos, bentiss
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, leo.yan,
ast, andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 168140f8e646..b1fbd0211c5e 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -84,7 +84,6 @@ override CFLAGS += -Werror -Wall
> override CFLAGS += $(INCLUDES)
> override CFLAGS += -fvisibility=hidden
> override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -override CFLAGS += $(CLANG_CROSS_FLAGS)
At this commit, doesn't this removal lose CLANG_CROSS_FLAGS entirely
from the libbpf build?
The libbpf Makefile includes Makefile.include at the top, which does
append CLANG_CROSS_FLAGS to CFLAGS. But then the libbpf Makefile
overwrites CFLAGS with :=
CFLAGS := -g -O2
which destroys everything Makefile.include appended. The removed line
above was the only thing that re-added the cross-compile flags after
that overwrite.
The next commit in the series (233d70853154 "libbpf: Initialize CFLAGS
before including Makefile.include") fixes this by moving the CFLAGS
initialization before the include, so Makefile.include's addition
survives. But at this commit, cross-compilation with Clang appears
broken.
Could these two patches be squashed or reordered so that the
initialization move comes first?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22943905432
^ permalink raw reply [flat|nested] 57+ messages in thread* Re: [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS)
2026-03-11 9:02 ` bot+bpf-ci
@ 2026-03-11 9:35 ` Leo Yan
0 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 9:35 UTC (permalink / raw)
To: bot+bpf-ci
Cc: acme, irogers, namhyung, james.clark, kees, qmo, nathan, nsc,
nick.desaulniers+lkml, morbo, justinstitt, ast, daniel, andrii,
martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh,
sdf, haoluo, jolsa, rafael, daniel.lezcano, rui.zhang,
lukasz.luba, peterz, mingo, mark.rutland, alexander.shishkin,
adrian.hunter, mhiramat, wbg, baohua, xiaqinxin, brgl, warthog618,
kys, haiyangz, wei.liu, decui, longli, jic23, dlechner, nuno.sa,
andy, akpm, w, linux, jpoimboe, robert.moore, lenb,
srinivas.pandruvada, tj, void, arighi, changwoo, broonie, rostedt,
gmonaco, shuah, jikos, bentiss, linux-kbuild, linux-kernel, llvm,
bpf, linux-perf-users, martin.lau, clm, ihor.solodrai
On Wed, Mar 11, 2026 at 09:02:13AM +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > index 168140f8e646..b1fbd0211c5e 100644
> > --- a/tools/lib/bpf/Makefile
> > +++ b/tools/lib/bpf/Makefile
> > @@ -84,7 +84,6 @@ override CFLAGS += -Werror -Wall
> > override CFLAGS += $(INCLUDES)
> > override CFLAGS += -fvisibility=hidden
> > override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> > -override CFLAGS += $(CLANG_CROSS_FLAGS)
>
> At this commit, doesn't this removal lose CLANG_CROSS_FLAGS entirely
> from the libbpf build?
>
> The libbpf Makefile includes Makefile.include at the top, which does
> append CLANG_CROSS_FLAGS to CFLAGS. But then the libbpf Makefile
> overwrites CFLAGS with :=
>
> CFLAGS := -g -O2
>
> which destroys everything Makefile.include appended. The removed line
> above was the only thing that re-added the cross-compile flags after
> that overwrite.
>
> The next commit in the series (233d70853154 "libbpf: Initialize CFLAGS
> before including Makefile.include") fixes this by moving the CFLAGS
> initialization before the include, so Makefile.include's addition
> survives. But at this commit, cross-compilation with Clang appears
> broken.
>
> Could these two patches be squashed or reordered so that the
> initialization move comes first?
To be honest, I feel much more comfortable being corrected by a human
rather than a bot :)
The comment is fair enough, I will squash the two patches.
Thanks,
Leo
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (5 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 06/30] libbpf: Remove duplicate $(CLANG_CROSS_FLAGS) Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-16 10:18 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 08/30] tools build: Append -fzero-init-padding-bits=all to extra cflags Leo Yan
` (23 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
change. This could alter the initialization of CFLAGS, as the default
options "-g -O2" would never be set once EXTRA_CFLAGS is expanded.
Prepare for this by moving the CFLAGS initialization before including
tools/scripts/Makefile.include, so it is not affected by the extended
EXTRA_CFLAGS.
Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
place it last so that the extra flags propagate properly and can
override the default options.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/lib/bpf/Makefile | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index b1fbd0211c5edde7be3d98630b16e53e028d9116..eca584fb061e16013e76827e4203f6be0477a73e 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -49,6 +49,14 @@ man_dir_SQ = '$(subst ','\'',$(man_dir))'
export man_dir man_dir_SQ INSTALL
export DESTDIR DESTDIR_SQ
+# Defer assigning EXTRA_CFLAGS to CFLAGS until after including
+# tools/scripts/Makefile.include, as it may add flags to EXTRA_CFLAGS.
+ifdef EXTRA_CFLAGS
+ CFLAGS :=
+else
+ CFLAGS := -g -O2
+endif
+
include $(srctree)/tools/scripts/Makefile.include
# copy a bit from Linux kbuild
@@ -70,13 +78,6 @@ LIB_TARGET = libbpf.a libbpf.so.$(LIBBPF_VERSION)
LIB_FILE = libbpf.a libbpf.so*
PC_FILE = libbpf.pc
-# Set compile option CFLAGS
-ifdef EXTRA_CFLAGS
- CFLAGS := $(EXTRA_CFLAGS)
-else
- CFLAGS := -g -O2
-endif
-
# Append required CFLAGS
override CFLAGS += -std=gnu89
override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum
@@ -84,6 +85,7 @@ override CFLAGS += -Werror -Wall
override CFLAGS += $(INCLUDES)
override CFLAGS += -fvisibility=hidden
override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+override CFLAGS += $(EXTRA_CFLAGS)
# flags specific for shared library
SHLIB_FLAGS := -DSHARED -fPIC
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include
2026-03-11 8:29 ` [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include Leo Yan
@ 2026-03-16 10:18 ` Leo Yan
2026-03-16 14:17 ` Alexei Starovoitov
0 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-16 10:18 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
Hi BPF maintainers,
On Wed, Mar 11, 2026 at 08:29:32AM +0000, Leo Yan wrote:
> tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
> change. This could alter the initialization of CFLAGS, as the default
> options "-g -O2" would never be set once EXTRA_CFLAGS is expanded.
>
> Prepare for this by moving the CFLAGS initialization before including
> tools/scripts/Makefile.include, so it is not affected by the extended
> EXTRA_CFLAGS.
>
> Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
> place it last so that the extra flags propagate properly and can
> override the default options.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
Before sending a new version, I'd check if you have a chance to review
the libbpf patches. The libbpf change is crucial for this series.
Another reason for pinging because I received a bpf-ci report about test
failures for this series [1]. The failures looks to be unrelated, as
the tests fail starting from the first patch, which is irrelevant to BPF
code [2]. I tried reaching kernel-ci@meta.com last week but haven't
received a response yet.
If bpf-ci testing is mandatory for libbpf patches, could you advise me
on the correct workflow (e.g., whether the patches should be based on a
specific branch)?
Thanks.
[1] https://github.com/kernel-patches/bpf/actions/runs/22944268645
[2] https://patchwork.kernel.org/project/netdevbpf/patch/20260311-tools_build_fix_zero_init-v4-1-9e35bdb99cb3@arm.com/
> ---
> tools/lib/bpf/Makefile | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index b1fbd0211c5edde7be3d98630b16e53e028d9116..eca584fb061e16013e76827e4203f6be0477a73e 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -49,6 +49,14 @@ man_dir_SQ = '$(subst ','\'',$(man_dir))'
> export man_dir man_dir_SQ INSTALL
> export DESTDIR DESTDIR_SQ
>
> +# Defer assigning EXTRA_CFLAGS to CFLAGS until after including
> +# tools/scripts/Makefile.include, as it may add flags to EXTRA_CFLAGS.
> +ifdef EXTRA_CFLAGS
> + CFLAGS :=
> +else
> + CFLAGS := -g -O2
> +endif
> +
> include $(srctree)/tools/scripts/Makefile.include
>
> # copy a bit from Linux kbuild
> @@ -70,13 +78,6 @@ LIB_TARGET = libbpf.a libbpf.so.$(LIBBPF_VERSION)
> LIB_FILE = libbpf.a libbpf.so*
> PC_FILE = libbpf.pc
>
> -# Set compile option CFLAGS
> -ifdef EXTRA_CFLAGS
> - CFLAGS := $(EXTRA_CFLAGS)
> -else
> - CFLAGS := -g -O2
> -endif
> -
> # Append required CFLAGS
> override CFLAGS += -std=gnu89
> override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum
> @@ -84,6 +85,7 @@ override CFLAGS += -Werror -Wall
> override CFLAGS += $(INCLUDES)
> override CFLAGS += -fvisibility=hidden
> override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> +override CFLAGS += $(EXTRA_CFLAGS)
>
> # flags specific for shared library
> SHLIB_FLAGS := -DSHARED -fPIC
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include
2026-03-16 10:18 ` Leo Yan
@ 2026-03-16 14:17 ` Alexei Starovoitov
0 siblings, 0 replies; 57+ messages in thread
From: Alexei Starovoitov @ 2026-03-16 14:17 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, Linux Kbuild mailing list, LKML,
clang-built-linux, bpf, linux-perf-use.
On Mon, Mar 16, 2026 at 3:18 AM Leo Yan <leo.yan@arm.com> wrote:
>
> Hi BPF maintainers,
>
> On Wed, Mar 11, 2026 at 08:29:32AM +0000, Leo Yan wrote:
> > tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future
> > change. This could alter the initialization of CFLAGS, as the default
> > options "-g -O2" would never be set once EXTRA_CFLAGS is expanded.
> >
> > Prepare for this by moving the CFLAGS initialization before including
> > tools/scripts/Makefile.include, so it is not affected by the extended
> > EXTRA_CFLAGS.
> >
> > Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and
> > place it last so that the extra flags propagate properly and can
> > override the default options.
> >
> > Signed-off-by: Leo Yan <leo.yan@arm.com>
>
> Before sending a new version, I'd check if you have a chance to review
> the libbpf patches. The libbpf change is crucial for this series.
>
> Another reason for pinging because I received a bpf-ci report about test
> failures for this series [1]. The failures looks to be unrelated, as
> the tests fail starting from the first patch, which is irrelevant to BPF
> code [2]. I tried reaching kernel-ci@meta.com last week but haven't
> received a response yet.
>
> If bpf-ci testing is mandatory for libbpf patches, could you advise me
> on the correct workflow (e.g., whether the patches should be based on a
> specific branch)?
yes. It is mandatory and libbpf patches must go through bpf-next tree,
so pls send them separately.
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 08/30] tools build: Append -fzero-init-padding-bits=all to extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (6 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 07/30] libbpf: Initialize CFLAGS before including Makefile.include Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-12 18:31 ` Namhyung Kim
2026-03-11 8:29 ` [PATCH v4 09/30] bpftool: Append extra host flags Leo Yan
` (22 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
GCC-15 release claims [1]:
{0} initializer in C or C++ for unions no longer guarantees clearing
of the whole union (except for static storage duration initialization),
it just initializes the first union member to zero. If initialization
of the whole union including padding bits is desirable, use {} (valid
in C23 or C++) or use -fzero-init-padding-bits=unions option to
restore old GCC behavior.
As a result, this new behaviour might cause unexpected data when we
initialize a union with using the '{ 0 }' initializer.
Since commit dce4aab8441d ("kbuild: Use -fzero-init-padding-bits=all"),
the kernel has enabled -fzero-init-padding-bits=all to zero padding bits
in unions and structures. This commit applies the same option for tools
building.
The option is not supported by any version older than GCC 15, nor is it
supported by LLVM. This patch adds the cc-option and host-cc-option
functions to dynamically detect compiler option and append it to the
EXTRA_CFLAGS and HOST_EXTRACFLAGS respectively.
[1] https://gcc.gnu.org/gcc-15/changes.html
Acked-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/scripts/Makefile.include | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index b5ecf137febcae59f506e107a7f2e2ad72f4bef4..a2397ceae512c1bc54adb15cb1a111ff34e28e43 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -137,6 +137,36 @@ else
EXTRA_WARNINGS += -Wshadow
endif
+# output directory for tests below
+TMPOUT = .tmp_$$$$
+
+# try-run
+# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
+# Exit code chooses option. "$$TMP" serves as a temporary file and is
+# automatically cleaned up.
+try-run = $(shell set -e; \
+ TMP=$(TMPOUT)/tmp; \
+ trap "rm -rf $(TMPOUT)" EXIT; \
+ mkdir -p $(TMPOUT); \
+ if ($(1)) >/dev/null 2>&1; \
+ then echo "$(2)"; \
+ else echo "$(3)"; \
+ fi)
+
+# cc-option
+# Usage: CFLAGS += $(call cc-option,-march=winchip-c6,-march=i586)
+cc-option = $(call try-run, \
+ $(CC) -Werror $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+
+host-cc-option = $(call try-run, \
+ $(HOSTCC) -Werror $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+
+# Explicitly clear padding bits with the initializer '{ 0 }'
+FLAG_ZERO_INIT := $(call cc-option,-fzero-init-padding-bits=all)
+override EXTRA_CFLAGS += $(FLAG_ZERO_INIT)
+HOST_FLAG_ZERO_INIT := $(call host-cc-option,-fzero-init-padding-bits=all)
+override HOST_EXTRACFLAGS += $(HOST_FLAG_ZERO_INIT)
+
ifneq ($(findstring $(MAKEFLAGS), w),w)
PRINT_DIR = --no-print-directory
else
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 08/30] tools build: Append -fzero-init-padding-bits=all to extra cflags
2026-03-11 8:29 ` [PATCH v4 08/30] tools build: Append -fzero-init-padding-bits=all to extra cflags Leo Yan
@ 2026-03-12 18:31 ` Namhyung Kim
0 siblings, 0 replies; 57+ messages in thread
From: Namhyung Kim @ 2026-03-12 18:31 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, Mar 11, 2026 at 08:29:33AM +0000, Leo Yan wrote:
> GCC-15 release claims [1]:
>
> {0} initializer in C or C++ for unions no longer guarantees clearing
> of the whole union (except for static storage duration initialization),
> it just initializes the first union member to zero. If initialization
> of the whole union including padding bits is desirable, use {} (valid
> in C23 or C++) or use -fzero-init-padding-bits=unions option to
> restore old GCC behavior.
>
> As a result, this new behaviour might cause unexpected data when we
> initialize a union with using the '{ 0 }' initializer.
>
> Since commit dce4aab8441d ("kbuild: Use -fzero-init-padding-bits=all"),
> the kernel has enabled -fzero-init-padding-bits=all to zero padding bits
> in unions and structures. This commit applies the same option for tools
> building.
>
> The option is not supported by any version older than GCC 15, nor is it
> supported by LLVM. This patch adds the cc-option and host-cc-option
> functions to dynamically detect compiler option and append it to the
> EXTRA_CFLAGS and HOST_EXTRACFLAGS respectively.
>
> [1] https://gcc.gnu.org/gcc-15/changes.html
>
> Acked-by: Quentin Monnet <qmo@kernel.org>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/scripts/Makefile.include | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
> index b5ecf137febcae59f506e107a7f2e2ad72f4bef4..a2397ceae512c1bc54adb15cb1a111ff34e28e43 100644
> --- a/tools/scripts/Makefile.include
> +++ b/tools/scripts/Makefile.include
> @@ -137,6 +137,36 @@ else
> EXTRA_WARNINGS += -Wshadow
> endif
>
> +# output directory for tests below
> +TMPOUT = .tmp_$$$$
> +
> +# try-run
> +# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
> +# Exit code chooses option. "$$TMP" serves as a temporary file and is
> +# automatically cleaned up.
> +try-run = $(shell set -e; \
> + TMP=$(TMPOUT)/tmp; \
> + trap "rm -rf $(TMPOUT)" EXIT; \
> + mkdir -p $(TMPOUT); \
> + if ($(1)) >/dev/null 2>&1; \
> + then echo "$(2)"; \
> + else echo "$(3)"; \
> + fi)
> +
> +# cc-option
> +# Usage: CFLAGS += $(call cc-option,-march=winchip-c6,-march=i586)
> +cc-option = $(call try-run, \
> + $(CC) -Werror $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
> +
> +host-cc-option = $(call try-run, \
> + $(HOSTCC) -Werror $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
> +
> +# Explicitly clear padding bits with the initializer '{ 0 }'
> +FLAG_ZERO_INIT := $(call cc-option,-fzero-init-padding-bits=all)
> +override EXTRA_CFLAGS += $(FLAG_ZERO_INIT)
> +HOST_FLAG_ZERO_INIT := $(call host-cc-option,-fzero-init-padding-bits=all)
> +override HOST_EXTRACFLAGS += $(HOST_FLAG_ZERO_INIT)
> +
> ifneq ($(findstring $(MAKEFLAGS), w),w)
> PRINT_DIR = --no-print-directory
> else
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 09/30] bpftool: Append extra host flags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (7 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 08/30] tools build: Append -fzero-init-padding-bits=all to extra cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 10/30] perf build: " Leo Yan
` (21 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append HOST_EXTRACFLAGS to HOST_CFLAGS so that additional flags can be
applied to the host compiler.
Acked-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/bpf/bpftool/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 3e7d8359e1b2a81a29a47544be8539e3b191a0e8..762fcf0e62a189625053798dddeaf17d409fe248 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -86,6 +86,7 @@ endif
# including flags that are not applicable to the host compiler.
HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\
$(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS)))
+HOST_CFLAGS += $(HOST_EXTRACFLAGS)
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 10/30] perf build: Append extra host flags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (8 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 09/30] bpftool: Append extra host flags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-12 18:31 ` Namhyung Kim
2026-03-11 8:29 ` [PATCH v4 11/30] tools/bpf: build: Append extra cflags Leo Yan
` (20 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append HOST_EXTRACFLAGS to HOST_CFLAGS so that additional flags can be
applied to the host compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/perf/Makefile.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index a8dc72cfe48eec52bd9e2352c46c88f5d8047765..f4004ec148a19c784bfe3ee9b5cc3901a3db25a3 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -17,7 +17,7 @@ detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
-HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
+HOSTCFLAGS := $(HOST_EXTRACFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
# This is required because the kernel is built with this and some of the code
# borrowed from kernel headers depends on it, e.g. put_unaligned_*().
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 10/30] perf build: Append extra host flags
2026-03-11 8:29 ` [PATCH v4 10/30] perf build: " Leo Yan
@ 2026-03-12 18:31 ` Namhyung Kim
0 siblings, 0 replies; 57+ messages in thread
From: Namhyung Kim @ 2026-03-12 18:31 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, Mar 11, 2026 at 08:29:35AM +0000, Leo Yan wrote:
> Append HOST_EXTRACFLAGS to HOST_CFLAGS so that additional flags can be
> applied to the host compiler.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/perf/Makefile.config | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index a8dc72cfe48eec52bd9e2352c46c88f5d8047765..f4004ec148a19c784bfe3ee9b5cc3901a3db25a3 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -17,7 +17,7 @@ detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
> detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>
> CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
> -HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
> +HOSTCFLAGS := $(HOST_EXTRACFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
>
> # This is required because the kernel is built with this and some of the code
> # borrowed from kernel headers depends on it, e.g. put_unaligned_*().
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 11/30] tools/bpf: build: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (9 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 10/30] perf build: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 12/30] tools build: Append extra host cflags Leo Yan
` (19 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/bpf/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
index fd2585af1252669c59228af3a77320e449e1a1ab..9c19e81f3c274767c3b9b94c907cbbe3ce9fe78c 100644
--- a/tools/bpf/Makefile
+++ b/tools/bpf/Makefile
@@ -11,6 +11,7 @@ INSTALL ?= install
CFLAGS += -Wall -O2
CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi \
-I$(srctree)/tools/include
+CFLAGS += $(EXTRA_CFLAGS)
# This will work when bpf is built in tools env. where srctree
# isn't set and when invoked from selftests build, where srctree
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 12/30] tools build: Append extra host cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (10 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 11/30] tools/bpf: build: Append extra cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-12 0:29 ` Ian Rogers
2026-03-11 8:29 ` [PATCH v4 13/30] tools: bootconfig: Append extra cflags Leo Yan
` (18 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append HOST_EXTRACFLAGS to HOSTCFLAGS so that additional flags can be
applied to the host compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/build/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 3a5a3808ab2a1dedd40f35ea322913e8a0788130..a86ce3d99e2bb1c005942d9c32191e6eaa55cf50 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -40,14 +40,16 @@ endif
FIXDEP := $(OUTPUT)fixdep
FIXDEP_IN := $(OUTPUT)fixdep-in.o
+HOSTCFLAGS := $(HOST_EXTRACFLAGS) $(KBUILD_HOSTCFLAGS)
+
# To track fixdep's dependencies properly, fixdep needs to run on itself.
# Build it twice the first time.
$(FIXDEP_IN): FORCE
$(Q)if [ ! -f $(FIXDEP) ]; then \
- $(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"; \
+ $(MAKE) $(build)=fixdep HOSTCFLAGS="$(HOSTCFLAGS)"; \
rm -f $(FIXDEP).o; \
fi
- $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"
+ $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(HOSTCFLAGS)"
$(FIXDEP): $(FIXDEP_IN)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 12/30] tools build: Append extra host cflags
2026-03-11 8:29 ` [PATCH v4 12/30] tools build: Append extra host cflags Leo Yan
@ 2026-03-12 0:29 ` Ian Rogers
0 siblings, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2026-03-12 0:29 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, Mar 11, 2026 at 1:31 AM Leo Yan <leo.yan@arm.com> wrote:
>
> Append HOST_EXTRACFLAGS to HOSTCFLAGS so that additional flags can be
> applied to the host compiler.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/build/Makefile | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index 3a5a3808ab2a1dedd40f35ea322913e8a0788130..a86ce3d99e2bb1c005942d9c32191e6eaa55cf50 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -40,14 +40,16 @@ endif
> FIXDEP := $(OUTPUT)fixdep
> FIXDEP_IN := $(OUTPUT)fixdep-in.o
>
> +HOSTCFLAGS := $(HOST_EXTRACFLAGS) $(KBUILD_HOSTCFLAGS)
Hi Leo, should HOST_EXTRACFLAGS appear after KBUILD_HOSTCFLAGS here?
This allows the extra flags to override the build system's flags.
Thanks,
Ian
>
> +
> # To track fixdep's dependencies properly, fixdep needs to run on itself.
> # Build it twice the first time.
> $(FIXDEP_IN): FORCE
> $(Q)if [ ! -f $(FIXDEP) ]; then \
> - $(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"; \
> + $(MAKE) $(build)=fixdep HOSTCFLAGS="$(HOSTCFLAGS)"; \
> rm -f $(FIXDEP).o; \
> fi
> - $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"
> + $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(HOSTCFLAGS)"
>
>
> $(FIXDEP): $(FIXDEP_IN)
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 13/30] tools: bootconfig: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (11 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 12/30] tools build: Append extra host cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 14/30] tools: counter: " Leo Yan
` (17 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/bootconfig/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bootconfig/Makefile b/tools/bootconfig/Makefile
index 90eb47c9d8de67b0ccc74a8de0af3a7e0b97feeb..4490df707585acf356153b78cb87760f622a6190 100644
--- a/tools/bootconfig/Makefile
+++ b/tools/bootconfig/Makefile
@@ -11,6 +11,7 @@ endif
LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
override CFLAGS += -Wall -g -I$(CURDIR)/include
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := bootconfig
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 14/30] tools: counter: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (12 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 13/30] tools: bootconfig: Append extra cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 15/30] tools: dma: " Leo Yan
` (16 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/counter/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/counter/Makefile b/tools/counter/Makefile
index d82d35a520f610260abb43f6ae28e56d73268231..1495c0e03d9c00653a24bc92b24d83340dbb4909 100644
--- a/tools/counter/Makefile
+++ b/tools/counter/Makefile
@@ -14,6 +14,7 @@ MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include \
-I$(srctree)/tools/include
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := counter_example counter_watch_events
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 15/30] tools: dma: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (13 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 14/30] tools: counter: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 16/30] tools: gpio: " Leo Yan
` (15 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Qinxin Xia <xiaqinxin@huawei.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/dma/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/dma/Makefile b/tools/dma/Makefile
index e4abf37bf020ca613b6dca340299198cb887126a..86d3d2e361110b664b885c0e9423660a2d5e8221 100644
--- a/tools/dma/Makefile
+++ b/tools/dma/Makefile
@@ -17,6 +17,7 @@ endif
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := dma_map_benchmark
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 16/30] tools: gpio: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (14 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 15/30] tools: dma: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 17/30] tools: hv: " Leo Yan
` (14 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan,
Bartosz Golaszewski
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/gpio/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 342e056c8c665ac075041ff7c7ca7ba94c691187..05a0057ec361626f41ca87e5295691364f03d2cb 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -17,6 +17,7 @@ endif
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon gpio-watch
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 17/30] tools: hv: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (15 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 16/30] tools: gpio: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 18/30] tools: iio: " Leo Yan
` (13 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/hv/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 34ffcec264ab0fdf7075d25456ef012cb866796b..a85f2208a8e3c9532b0d2cc750fc2a872ab4bb07 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -18,6 +18,7 @@ MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
override CFLAGS += -Wno-address-of-packed-member
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
ifneq ($(ARCH), aarch64)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 18/30] tools: iio: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (16 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 17/30] tools: hv: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-22 12:00 ` Jonathan Cameron
2026-03-11 8:29 ` [PATCH v4 19/30] tools: mm: " Leo Yan
` (12 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/iio/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index 3bcce0b7d10f42208765be83dac047faa2e0ceb1..f0428421792d1cbe5ff71b01b67f23eb908fa714 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -13,6 +13,7 @@ endif
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := iio_event_monitor lsiio iio_generic_buffer
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 18/30] tools: iio: Append extra cflags
2026-03-11 8:29 ` [PATCH v4 18/30] tools: iio: " Leo Yan
@ 2026-03-22 12:00 ` Jonathan Cameron
0 siblings, 0 replies; 57+ messages in thread
From: Jonathan Cameron @ 2026-03-22 12:00 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
David Lechner, Nuno Sá, Andy Shevchenko, Andrew Morton,
Willy Tarreau, Thomas Weißschuh, Josh Poimboeuf,
Robert Moore, Len Brown, Srinivas Pandruvada, Tejun Heo,
David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, 11 Mar 2026 08:29:43 +0000
Leo Yan <leo.yan@arm.com> wrote:
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
Given discussion leading to:
https://lore.kernel.org/all/20260311113537.70c4bacd2021c8d29c7dcf68@linux-foundation.org/
I'm assuming I don't need to do anything beyond.
Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Shout if otherwise.
> ---
> tools/iio/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/iio/Makefile b/tools/iio/Makefile
> index 3bcce0b7d10f42208765be83dac047faa2e0ceb1..f0428421792d1cbe5ff71b01b67f23eb908fa714 100644
> --- a/tools/iio/Makefile
> +++ b/tools/iio/Makefile
> @@ -13,6 +13,7 @@ endif
> MAKEFLAGS += -r
>
> override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
> +override CFLAGS += $(EXTRA_CFLAGS)
>
> ALL_TARGETS := iio_event_monitor lsiio iio_generic_buffer
> ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 19/30] tools: mm: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (17 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 18/30] tools: iio: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 20/30] tools: objtool: Append extra host cflags Leo Yan
` (11 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/mm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/mm/Makefile b/tools/mm/Makefile
index f5725b5c23aa261994b5b42f37c443bee2edebf2..d48491da2edc95fca57c0707c42961fde7b02072 100644
--- a/tools/mm/Makefile
+++ b/tools/mm/Makefile
@@ -10,6 +10,7 @@ LIB_DIR = ../lib/api
LIBS = $(LIB_DIR)/libapi.a
CFLAGS += -Wall -Wextra -I../lib/ -pthread
+CFLAGS += $(EXTRA_CFLAGS)
LDFLAGS += $(LIBS) -pthread
all: $(BUILD_TARGETS)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 20/30] tools: objtool: Append extra host cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (18 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 19/30] tools: mm: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 21/30] tools: power: acpi: Append extra cflags Leo Yan
` (10 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append HOST_EXTRACFLAGS to HOSTCFLAGS so that additional flags can be
applied to the host compiler.
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/objtool/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 76bcd4e85de345048bba0a6e0066c3cf61dac979..716e84cc33eaccb0e4ae592746eb1888edc2f850 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -60,6 +60,8 @@ INCLUDES := -I$(srctree)/tools/include \
-I$(srctree)/tools/objtool/arch/$(SRCARCH)/include \
-I$(LIBSUBCMD_OUTPUT)/include
+HOSTCFLAGS += $(HOST_EXTRACFLAGS)
+
OBJTOOL_CFLAGS := -std=gnu11 -fomit-frame-pointer -O2 -g $(WARNINGS) \
$(INCLUDES) $(LIBELF_FLAGS) $(LIBXXHASH_CFLAGS) $(HOSTCFLAGS)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 21/30] tools: power: acpi: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (19 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 20/30] tools: objtool: Append extra host cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 22/30] tools: power: x86/intel-speed-select: " Leo Yan
` (9 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/power/acpi/Makefile.config | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config
index cd7106876a5f39dfda38e286c54c3a7c268b34a2..11088deab42ee5a793f978feb9f4f7bb7024c48c 100644
--- a/tools/power/acpi/Makefile.config
+++ b/tools/power/acpi/Makefile.config
@@ -69,6 +69,7 @@ KERNEL_INCLUDE := $(OUTPUT)include
ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
CFLAGS += $(WARNINGS)
+CFLAGS += $(EXTRA_CFLAGS)
MKDIR = mkdir
ifeq ($(strip $(V)),false)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 22/30] tools: power: x86/intel-speed-select: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (20 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 21/30] tools: power: acpi: Append extra cflags Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 23/30] tools: sched_ext: " Leo Yan
` (8 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/power/x86/intel-speed-select/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/power/x86/intel-speed-select/Makefile b/tools/power/x86/intel-speed-select/Makefile
index 6b299aae2ded89c3a70a3649996e258b98001ee7..5947afce9fde7c054647fa3ee0c661b60b863f29 100644
--- a/tools/power/x86/intel-speed-select/Makefile
+++ b/tools/power/x86/intel-speed-select/Makefile
@@ -20,6 +20,7 @@ NL3_CFLAGS = -I/usr/include/libnl3
endif
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include $(NL3_CFLAGS)
+override CFLAGS += $(EXTRA_CFLAGS)
override LDFLAGS += -lnl-genl-3 -lnl-3
ALL_TARGETS := intel-speed-select
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 23/30] tools: sched_ext: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (21 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 22/30] tools: power: x86/intel-speed-select: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 24/30] tools: spi: " Leo Yan
` (7 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/sched_ext/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/sched_ext/Makefile b/tools/sched_ext/Makefile
index 21554f0896923fa9c2e5b98c85d65d964152e592..e0d705b2fe0ca763fece5137ea43ccb776d18012 100644
--- a/tools/sched_ext/Makefile
+++ b/tools/sched_ext/Makefile
@@ -92,6 +92,7 @@ endif
CFLAGS += -g -O2 -rdynamic -pthread -Wall -Werror $(GENFLAGS) \
-I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \
-I$(TOOLSINCDIR) -I$(APIDIR) -I$(CURDIR)/include
+CFLAGS += $(EXTRA_CFLAGS)
# Silence some warnings when compiled with clang
ifneq ($(LLVM),)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 24/30] tools: spi: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (22 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 23/30] tools: sched_ext: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 25/30] tools: tracing: " Leo Yan
` (6 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/spi/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/spi/Makefile b/tools/spi/Makefile
index 7fccd245a53515ab019529c8e5e91a044eaaa68b..82f9bc6365911b962422633147b108fabc70a2db 100644
--- a/tools/spi/Makefile
+++ b/tools/spi/Makefile
@@ -13,6 +13,7 @@ endif
MAKEFLAGS += -r
CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+CFLAGS += $(EXTRA_CFLAGS)
ALL_TARGETS := spidev_test spidev_fdx
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 25/30] tools: tracing: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (23 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 24/30] tools: spi: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 26/30] tools: usb: " Leo Yan
` (5 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/tracing/latency/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/tracing/latency/Makefile b/tools/tracing/latency/Makefile
index 257a56b1899f23837de533353e9c2cebdb6035bd..d32a6a13753035355f0e3a05bf88870b8aa55f64 100644
--- a/tools/tracing/latency/Makefile
+++ b/tools/tracing/latency/Makefile
@@ -57,6 +57,7 @@ ifeq ($(config),1)
endif
CFLAGS += $(INCLUDES) $(LIB_INCLUDES)
+CFLAGS += $(EXTRA_CFLAGS)
export CFLAGS OUTPUT srctree
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 26/30] tools: usb: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (24 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 25/30] tools: tracing: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:29 ` [PATCH v4 27/30] selftests/bpf: " Leo Yan
` (4 subsequent siblings)
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/usb/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index c6235667dd46223b646bbab5c82c810221750182..42362dcdf2743dace62a5385a7d2707c42bdd3c0 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -14,6 +14,7 @@ endif
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -Wextra -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(srctree)/tools/include
+override CFLAGS += $(EXTRA_CFLAGS)
override LDFLAGS += -lpthread
ALL_TARGETS := testusb ffs-test
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* [PATCH v4 27/30] selftests/bpf: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (25 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 26/30] tools: usb: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-12 17:24 ` Ian Rogers
2026-03-11 8:29 ` [PATCH v4 28/30] selftests/hid: " Leo Yan
` (3 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
urandom_read is built with clang. Introduce URANDOM_READ_CFLAGS to copy
the compiler flags without appending EXTRA_CFLAGS, which may contain
incompatible options with clang.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/testing/selftests/bpf/Makefile | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 72a9ba41f95ebb825d25799c07ba3f0311243e45..27112f08c9a5b6cabc41902207d00897070b41b4 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -71,6 +71,12 @@ ifneq ($(LLVM),)
CFLAGS += -Wno-unused-command-line-argument
endif
+# urandom_read is built with clang. Copy $(CFLAGS) before EXTRA_CFLAGS are
+# appended so that it does not inherit potentially incompatible options.
+URANDOM_READ_CFLAGS := $(CFLAGS)
+
+CFLAGS += $(EXTRA_CFLAGS)
+
# Check whether bpf cpu=v4 is supported or not by clang
ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),)
CLANG_CPUV4 := 1
@@ -255,7 +261,7 @@ endif
$(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom_read.map
$(call msg,LIB,,$@)
$(Q)$(CLANG) $(CLANG_TARGET_ARCH) \
- $(filter-out -static,$(CFLAGS) $(LDFLAGS)) \
+ $(filter-out -static,$(URANDOM_READ_CFLAGS) $(LDFLAGS)) \
$(filter %.c,$^) $(filter-out -static,$(LDLIBS)) \
-Wno-unused-command-line-argument \
-fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
@@ -265,7 +271,7 @@ $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom
$(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
$(call msg,BINARY,,$@)
$(Q)$(CLANG) $(CLANG_TARGET_ARCH) \
- $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
+ $(filter-out -static,$(URANDOM_READ_CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
-Wno-unused-command-line-argument \
-lurandom_read $(filter-out -static,$(LDLIBS)) -L$(OUTPUT) \
-fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 27/30] selftests/bpf: Append extra cflags
2026-03-11 8:29 ` [PATCH v4 27/30] selftests/bpf: " Leo Yan
@ 2026-03-12 17:24 ` Ian Rogers
2026-03-13 16:11 ` Leo Yan
0 siblings, 1 reply; 57+ messages in thread
From: Ian Rogers @ 2026-03-12 17:24 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Wed, Mar 11, 2026 at 1:33 AM Leo Yan <leo.yan@arm.com> wrote:
>
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
>
> urandom_read is built with clang. Introduce URANDOM_READ_CFLAGS to copy
> the compiler flags without appending EXTRA_CFLAGS, which may contain
> incompatible options with clang.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/testing/selftests/bpf/Makefile | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 72a9ba41f95ebb825d25799c07ba3f0311243e45..27112f08c9a5b6cabc41902207d00897070b41b4 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -71,6 +71,12 @@ ifneq ($(LLVM),)
> CFLAGS += -Wno-unused-command-line-argument
> endif
>
> +# urandom_read is built with clang. Copy $(CFLAGS) before EXTRA_CFLAGS are
> +# appended so that it does not inherit potentially incompatible options.
> +URANDOM_READ_CFLAGS := $(CFLAGS)
Later in the Makefile, include ../lib.mk is executed and it appends
CFLAGS like -D_GNU_SOURCE= which will be missing from
URANDOM_READ_CFLAGS here. Perhaps move these assignments below the
include?
Thanks,
Ian
> +
> +CFLAGS += $(EXTRA_CFLAGS)
> +
> # Check whether bpf cpu=v4 is supported or not by clang
> ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),)
> CLANG_CPUV4 := 1
> @@ -255,7 +261,7 @@ endif
> $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom_read.map
> $(call msg,LIB,,$@)
> $(Q)$(CLANG) $(CLANG_TARGET_ARCH) \
> - $(filter-out -static,$(CFLAGS) $(LDFLAGS)) \
> + $(filter-out -static,$(URANDOM_READ_CFLAGS) $(LDFLAGS)) \
> $(filter %.c,$^) $(filter-out -static,$(LDLIBS)) \
> -Wno-unused-command-line-argument \
> -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
> @@ -265,7 +271,7 @@ $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom
> $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
> $(call msg,BINARY,,$@)
> $(Q)$(CLANG) $(CLANG_TARGET_ARCH) \
> - $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
> + $(filter-out -static,$(URANDOM_READ_CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
> -Wno-unused-command-line-argument \
> -lurandom_read $(filter-out -static,$(LDLIBS)) -L$(OUTPUT) \
> -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 27/30] selftests/bpf: Append extra cflags
2026-03-12 17:24 ` Ian Rogers
@ 2026-03-13 16:11 ` Leo Yan
0 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-13 16:11 UTC (permalink / raw)
To: Ian Rogers
Cc: Arnaldo Carvalho de Melo, Namhyung Kim, James Clark, Kees Cook,
Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users
On Thu, Mar 12, 2026 at 10:24:48AM -0700, Ian Rogers wrote:
> On Wed, Mar 11, 2026 at 1:33 AM Leo Yan <leo.yan@arm.com> wrote:
> >
> > Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> > the compiler.
> >
> > urandom_read is built with clang. Introduce URANDOM_READ_CFLAGS to copy
> > the compiler flags without appending EXTRA_CFLAGS, which may contain
> > incompatible options with clang.
> >
> > Signed-off-by: Leo Yan <leo.yan@arm.com>
> > ---
> > tools/testing/selftests/bpf/Makefile | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > index 72a9ba41f95ebb825d25799c07ba3f0311243e45..27112f08c9a5b6cabc41902207d00897070b41b4 100644
> > --- a/tools/testing/selftests/bpf/Makefile
> > +++ b/tools/testing/selftests/bpf/Makefile
> > @@ -71,6 +71,12 @@ ifneq ($(LLVM),)
> > CFLAGS += -Wno-unused-command-line-argument
> > endif
> >
> > +# urandom_read is built with clang. Copy $(CFLAGS) before EXTRA_CFLAGS are
> > +# appended so that it does not inherit potentially incompatible options.
> > +URANDOM_READ_CFLAGS := $(CFLAGS)
>
> Later in the Makefile, include ../lib.mk is executed and it appends
> CFLAGS like -D_GNU_SOURCE= which will be missing from
> URANDOM_READ_CFLAGS here. Perhaps move these assignments below the
> include?
Will do, thanks!
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 28/30] selftests/hid: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (26 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 27/30] selftests/bpf: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-13 13:33 ` Benjamin Tissoires
2026-03-11 8:29 ` [PATCH v4 29/30] selftests/nolibc: " Leo Yan
` (2 subsequent siblings)
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/testing/selftests/hid/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile
index 50ec9e0406abaf316fba232c5da1967e27d0fa9b..686c5f79ca592c2ce94e37b39ab5c3ebe8483f79 100644
--- a/tools/testing/selftests/hid/Makefile
+++ b/tools/testing/selftests/hid/Makefile
@@ -26,6 +26,7 @@ HOSTPKG_CONFIG := pkg-config
CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT)
CFLAGS += -I$(OUTPUT)/tools/include
+CFLAGS += $(EXTRA_CFLAGS)
LDLIBS += -lelf -lz -lrt -lpthread
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 28/30] selftests/hid: Append extra cflags
2026-03-11 8:29 ` [PATCH v4 28/30] selftests/hid: " Leo Yan
@ 2026-03-13 13:33 ` Benjamin Tissoires
0 siblings, 0 replies; 57+ messages in thread
From: Benjamin Tissoires @ 2026-03-13 13:33 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On Mar 11 2026, Leo Yan wrote:
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/testing/selftests/hid/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile
> index 50ec9e0406abaf316fba232c5da1967e27d0fa9b..686c5f79ca592c2ce94e37b39ab5c3ebe8483f79 100644
> --- a/tools/testing/selftests/hid/Makefile
> +++ b/tools/testing/selftests/hid/Makefile
> @@ -26,6 +26,7 @@ HOSTPKG_CONFIG := pkg-config
>
> CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT)
> CFLAGS += -I$(OUTPUT)/tools/include
> +CFLAGS += $(EXTRA_CFLAGS)
Acked-by: Benjamin Tissoires <bentiss@kernel.org>
Cheers,
Benjamin
>
> LDLIBS += -lelf -lz -lrt -lpthread
>
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH v4 29/30] selftests/nolibc: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (27 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 28/30] selftests/hid: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-16 22:27 ` Thomas Weißschuh
2026-03-11 8:29 ` [PATCH v4 30/30] selftests/sched_ext: " Leo Yan
2026-03-11 8:44 ` [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Daniel Lezcano
30 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Include tools/scripts/Makefile.include, which may provide additional
flags in EXTRA_CFLAGS, and append to CFLAGS.
Since Makefile.include already defines cc-option, remove the redundant
definition and include.
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/testing/selftests/nolibc/Makefile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 0370489d938b540721a4fb814ebb68c463760e73..d1a9c1d5988bdc6a8778ef418aaa4c5ac1d26a10 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -3,15 +3,13 @@
TEST_GEN_PROGS := nolibc-test libc-test
include ../lib.mk
-include $(top_srcdir)/scripts/Makefile.compiler
-
-cc-option = $(call __cc-option, $(CC),,$(1),$(2))
+include $(top_srcdir)/tools/scripts/Makefile.include
include Makefile.include
$(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
-isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
- $(CFLAGS_NOLIBC_TEST)
+ $(CFLAGS_NOLIBC_TEST) $(EXTRA_CFLAGS)
$(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
$(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 29/30] selftests/nolibc: Append extra cflags
2026-03-11 8:29 ` [PATCH v4 29/30] selftests/nolibc: " Leo Yan
@ 2026-03-16 22:27 ` Thomas Weißschuh
2026-03-17 11:00 ` Leo Yan
0 siblings, 1 reply; 57+ messages in thread
From: Thomas Weißschuh @ 2026-03-16 22:27 UTC (permalink / raw)
To: Leo Yan
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Josh Poimboeuf, Robert Moore,
Len Brown, Srinivas Pandruvada, Tejun Heo, David Vernet,
Andrea Righi, Changwoo Min, Mark Brown, Steven Rostedt,
Gabriele Monaco, Shuah Khan, Jiri Kosina, Benjamin Tissoires,
linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On 2026-03-11 08:29:54+0000, Leo Yan wrote:
> Include tools/scripts/Makefile.include, which may provide additional
> flags in EXTRA_CFLAGS, and append to CFLAGS.
>
> Since Makefile.include already defines cc-option, remove the redundant
> definition and include.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/testing/selftests/nolibc/Makefile | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index 0370489d938b540721a4fb814ebb68c463760e73..d1a9c1d5988bdc6a8778ef418aaa4c5ac1d26a10 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -3,15 +3,13 @@
> TEST_GEN_PROGS := nolibc-test libc-test
>
> include ../lib.mk
> -include $(top_srcdir)/scripts/Makefile.compiler
> -
> -cc-option = $(call __cc-option, $(CC),,$(1),$(2))
> +include $(top_srcdir)/tools/scripts/Makefile.include
>
> include Makefile.include
>
> $(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
> -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
> - $(CFLAGS_NOLIBC_TEST)
> + $(CFLAGS_NOLIBC_TEST) $(EXTRA_CFLAGS)
> $(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
> $(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
The rule for "libc-test", which uses the standard $(LINK.c) to invoke
the compiler, does not respect $(EXTRA_CFLAGS) automatically.
Is this intentional? It also affects all other users of lib.mk which
don't have any custom cflags handling.
If so, there should be an override for the "libc-test" target, too.
But if I am supposed to pick up this patch, I can fix it up when applying.
Thomas
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 29/30] selftests/nolibc: Append extra cflags
2026-03-16 22:27 ` Thomas Weißschuh
@ 2026-03-17 11:00 ` Leo Yan
0 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-17 11:00 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Josh Poimboeuf, Robert Moore,
Len Brown, Srinivas Pandruvada, Tejun Heo, David Vernet,
Andrea Righi, Changwoo Min, Mark Brown, Steven Rostedt,
Gabriele Monaco, Shuah Khan, Jiri Kosina, Benjamin Tissoires,
linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users
On Mon, Mar 16, 2026 at 11:27:41PM +0100, Thomas Weißschuh wrote:
> On 2026-03-11 08:29:54+0000, Leo Yan wrote:
> > Include tools/scripts/Makefile.include, which may provide additional
> > flags in EXTRA_CFLAGS, and append to CFLAGS.
> >
> > Since Makefile.include already defines cc-option, remove the redundant
> > definition and include.
> >
> > Signed-off-by: Leo Yan <leo.yan@arm.com>
> > ---
> > tools/testing/selftests/nolibc/Makefile | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > index 0370489d938b540721a4fb814ebb68c463760e73..d1a9c1d5988bdc6a8778ef418aaa4c5ac1d26a10 100644
> > --- a/tools/testing/selftests/nolibc/Makefile
> > +++ b/tools/testing/selftests/nolibc/Makefile
> > @@ -3,15 +3,13 @@
> > TEST_GEN_PROGS := nolibc-test libc-test
> >
> > include ../lib.mk
> > -include $(top_srcdir)/scripts/Makefile.compiler
> > -
> > -cc-option = $(call __cc-option, $(CC),,$(1),$(2))
> > +include $(top_srcdir)/tools/scripts/Makefile.include
> >
> > include Makefile.include
> >
> > $(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
> > -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
> > - $(CFLAGS_NOLIBC_TEST)
> > + $(CFLAGS_NOLIBC_TEST) $(EXTRA_CFLAGS)
> > $(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
> > $(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
>
> The rule for "libc-test", which uses the standard $(LINK.c) to invoke
> the compiler, does not respect $(EXTRA_CFLAGS) automatically.
> Is this intentional?
Thanks for the review. Is the change below OK with you? I can update it
before sending a new series.
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 0370489d938b..7b65e6f9840b 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -3,18 +3,17 @@
TEST_GEN_PROGS := nolibc-test libc-test
include ../lib.mk
-include $(top_srcdir)/scripts/Makefile.compiler
-
-cc-option = $(call __cc-option, $(CC),,$(1),$(2))
+include $(top_srcdir)/tools/scripts/Makefile.include
include Makefile.include
$(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
-isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
- $(CFLAGS_NOLIBC_TEST)
+ $(CFLAGS_NOLIBC_TEST) $(EXTRA_CFLAGS)
$(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
$(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
+$(OUTPUT)/libc-test: CFLAGS += $(EXTRA_CFLAGS)
$(OUTPUT)/libc-test: nolibc-test.c nolibc-test-linkage.c
$(call msg,CC,,$@)
$(Q)$(LINK.c) $^ -o $@
> It also affects all other users of lib.mk which
> don't have any custom cflags handling.
Many projects include lib.mk, but most do not include
tools/scripts/Makefile.include. Without it, the appended EXTRA_CFLAGS
cannot be inherited. This is why I did not touch those projects.
Appending EXTRA_CFLAGS in lib.mk may not be a good idea ? as such a
global change could break some builds.
Thanks,
Leo
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH v4 30/30] selftests/sched_ext: Append extra cflags
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (28 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 29/30] selftests/nolibc: " Leo Yan
@ 2026-03-11 8:29 ` Leo Yan
2026-03-11 8:44 ` [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Daniel Lezcano
30 siblings, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 8:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users, Leo Yan
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/testing/selftests/sched_ext/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/sched_ext/Makefile b/tools/testing/selftests/sched_ext/Makefile
index 006300ac6dff88a48104977398d8517753e7e385..2c8fbc9f8666ec4d6f75dbdd7602bd4f2b502aed 100644
--- a/tools/testing/selftests/sched_ext/Makefile
+++ b/tools/testing/selftests/sched_ext/Makefile
@@ -56,6 +56,7 @@ endif
CFLAGS += -g -O2 -rdynamic -pthread -Wall -Werror $(GENFLAGS) \
-I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \
-I$(TOOLSINCDIR) -I$(APIDIR) -I$(CURDIR)/include -I$(SCXTOOLSINCDIR)
+CFLAGS += $(EXTRA_CFLAGS)
# Silence some warnings when compiled with clang
ifneq ($(LLVM),)
--
2.34.1
^ permalink raw reply related [flat|nested] 57+ messages in thread* Re: [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option
2026-03-11 8:29 [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Leo Yan
` (29 preceding siblings ...)
2026-03-11 8:29 ` [PATCH v4 30/30] selftests/sched_ext: " Leo Yan
@ 2026-03-11 8:44 ` Daniel Lezcano
2026-03-11 8:52 ` Jonathan Cameron
2026-03-11 9:15 ` Leo Yan
30 siblings, 2 replies; 57+ messages in thread
From: Daniel Lezcano @ 2026-03-11 8:44 UTC (permalink / raw)
To: Leo Yan, Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim,
James Clark, Kees Cook, Quentin Monnet, Nathan Chancellor,
Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires
Cc: linux-kbuild, linux-kernel, llvm, bpf, linux-perf-users,
Bartosz Golaszewski
Hi Leo,
On 3/11/26 09:29, Leo Yan wrote:
> Thank you for reviewing v3 and I appreciate much Ian's suggestions, most
> of which have been adopted into this series.
>
> For anyone new to the series, the reason for appending this compiler
> option is described in v3 (see "Link to v3" below).
>
> In this version, the changes are organized into three parts:
>
> Patches 01 – 07: Preparation before adding the new compiler option.
> Fix typos, adjust Makefiles to ensure the newly
> introduced option does not cause regressions.
> Patch 08: Propagate -fzero-init-padding-bits=all to
> EXTRA_CFLAGS and HOST_EXTRACFLAGS for the
> CC and HOSTCC compilers, respectively.
> Patches 09 – 30: Apply EXTRA_CFLAGS and HOST_EXTRACFLAGS in
> project Makefiles.
>
Through which tree do you expect these patch to be picked up ? Each
maintainer picks the patches related to their subsystem ?
^ permalink raw reply [flat|nested] 57+ messages in thread* Re: [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option
2026-03-11 8:44 ` [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Daniel Lezcano
@ 2026-03-11 8:52 ` Jonathan Cameron
2026-03-11 9:23 ` Leo Yan
2026-03-11 9:15 ` Leo Yan
1 sibling, 1 reply; 57+ messages in thread
From: Jonathan Cameron @ 2026-03-11 8:52 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Leo Yan, Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim,
James Clark, Kees Cook, Quentin Monnet, Nathan Chancellor,
Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
David Lechner, Nuno Sá, Andy Shevchenko, Andrew Morton,
Willy Tarreau, Thomas Weißschuh, Josh Poimboeuf,
Robert Moore, Len Brown, Srinivas Pandruvada, Tejun Heo,
David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users, Bartosz Golaszewski
On Wed, 11 Mar 2026 09:44:16 +0100
Daniel Lezcano <daniel.lezcano@oss.qualcomm.com> wrote:
> Hi Leo,
>
> On 3/11/26 09:29, Leo Yan wrote:
> > Thank you for reviewing v3 and I appreciate much Ian's suggestions, most
> > of which have been adopted into this series.
> >
> > For anyone new to the series, the reason for appending this compiler
> > option is described in v3 (see "Link to v3" below).
> >
> > In this version, the changes are organized into three parts:
> >
> > Patches 01 – 07: Preparation before adding the new compiler option.
> > Fix typos, adjust Makefiles to ensure the newly
> > introduced option does not cause regressions.
> > Patch 08: Propagate -fzero-init-padding-bits=all to
> > EXTRA_CFLAGS and HOST_EXTRACFLAGS for the
> > CC and HOSTCC compilers, respectively.
> > Patches 09 – 30: Apply EXTRA_CFLAGS and HOST_EXTRACFLAGS in
> > project Makefiles.
> >
> Through which tree do you expect these patch to be picked up ? Each
> maintainer picks the patches related to their subsystem ?
If that's the case it would be helpful to +CC the relevant
subsystem lists on the patches that you expect to go that path.
Jonathan
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option
2026-03-11 8:52 ` Jonathan Cameron
@ 2026-03-11 9:23 ` Leo Yan
2026-03-11 18:35 ` Andrew Morton
0 siblings, 1 reply; 57+ messages in thread
From: Leo Yan @ 2026-03-11 9:23 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Daniel Lezcano, Arnaldo Carvalho de Melo, Ian Rogers,
Namhyung Kim, James Clark, Kees Cook, Quentin Monnet,
Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
Bill Wendling, Justin Stitt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Adrian Hunter, Masami Hiramatsu,
William Breathitt Gray, Barry Song, Qinxin Xia,
Bartosz Golaszewski, Kent Gibson, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Long Li, David Lechner, Nuno Sá,
Andy Shevchenko, Andrew Morton, Willy Tarreau,
Thomas Weißschuh, Josh Poimboeuf, Robert Moore, Len Brown,
Srinivas Pandruvada, Tejun Heo, David Vernet, Andrea Righi,
Changwoo Min, Mark Brown, Steven Rostedt, Gabriele Monaco,
Shuah Khan, Jiri Kosina, Benjamin Tissoires, linux-kbuild,
linux-kernel, llvm, bpf, linux-perf-users, Bartosz Golaszewski
On Wed, Mar 11, 2026 at 08:52:52AM +0000, Jonathan Cameron wrote:
> On Wed, 11 Mar 2026 09:44:16 +0100
> Daniel Lezcano <daniel.lezcano@oss.qualcomm.com> wrote:
>
> > Hi Leo,
> >
> > On 3/11/26 09:29, Leo Yan wrote:
> > > Thank you for reviewing v3 and I appreciate much Ian's suggestions, most
> > > of which have been adopted into this series.
> > >
> > > For anyone new to the series, the reason for appending this compiler
> > > option is described in v3 (see "Link to v3" below).
> > >
> > > In this version, the changes are organized into three parts:
> > >
> > > Patches 01 – 07: Preparation before adding the new compiler option.
> > > Fix typos, adjust Makefiles to ensure the newly
> > > introduced option does not cause regressions.
> > > Patch 08: Propagate -fzero-init-padding-bits=all to
> > > EXTRA_CFLAGS and HOST_EXTRACFLAGS for the
> > > CC and HOSTCC compilers, respectively.
> > > Patches 09 – 30: Apply EXTRA_CFLAGS and HOST_EXTRACFLAGS in
> > > project Makefiles.
> > >
> > Through which tree do you expect these patch to be picked up ? Each
> > maintainer picks the patches related to their subsystem ?
>
> If that's the case it would be helpful to +CC the relevant
> subsystem lists on the patches that you expect to go that path.
I deliberately looped mainatiners but not CC'ed each subsystem lists,
as it is a long list so I don't want to spam them.
If we conclude to go via subsystem trees, I will CC subsystem lists.
Thanks for reminding.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option
2026-03-11 9:23 ` Leo Yan
@ 2026-03-11 18:35 ` Andrew Morton
0 siblings, 0 replies; 57+ messages in thread
From: Andrew Morton @ 2026-03-11 18:35 UTC (permalink / raw)
To: Leo Yan
Cc: Jonathan Cameron, Daniel Lezcano, Arnaldo Carvalho de Melo,
Ian Rogers, Namhyung Kim, James Clark, Kees Cook, Quentin Monnet,
Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
Bill Wendling, Justin Stitt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Adrian Hunter, Masami Hiramatsu,
William Breathitt Gray, Barry Song, Qinxin Xia,
Bartosz Golaszewski, Kent Gibson, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Long Li, David Lechner, Nuno Sá,
Andy Shevchenko, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users, Bartosz Golaszewski
On Wed, 11 Mar 2026 09:23:31 +0000 Leo Yan <leo.yan@arm.com> wrote:
> On Wed, Mar 11, 2026 at 08:52:52AM +0000, Jonathan Cameron wrote:
> > On Wed, 11 Mar 2026 09:44:16 +0100
> > Daniel Lezcano <daniel.lezcano@oss.qualcomm.com> wrote:
> >
> > > Hi Leo,
> > >
> > > On 3/11/26 09:29, Leo Yan wrote:
> > > > Thank you for reviewing v3 and I appreciate much Ian's suggestions, most
> > > > of which have been adopted into this series.
> > > >
> > > > For anyone new to the series, the reason for appending this compiler
> > > > option is described in v3 (see "Link to v3" below).
> > > >
> > > > In this version, the changes are organized into three parts:
> > > >
> > > > Patches 01 – 07: Preparation before adding the new compiler option.
> > > > Fix typos, adjust Makefiles to ensure the newly
> > > > introduced option does not cause regressions.
> > > > Patch 08: Propagate -fzero-init-padding-bits=all to
> > > > EXTRA_CFLAGS and HOST_EXTRACFLAGS for the
> > > > CC and HOSTCC compilers, respectively.
> > > > Patches 09 – 30: Apply EXTRA_CFLAGS and HOST_EXTRACFLAGS in
> > > > project Makefiles.
> > > >
> > > Through which tree do you expect these patch to be picked up ? Each
> > > maintainer picks the patches related to their subsystem ?
My common approach to this sort of thing (which works) is to put
everything into mm.git, try to cc the whole world.
If Mark alerts us to the appearance of particular patches in linux-next
via another tree, I drop the mm.git copy, so maintainers can simply
cherrypick things and it's all automatic.
If maintainers send an ack (easiest!) then great.
Whatever is left over I upstream in the next merge window.
> > If that's the case it would be helpful to +CC the relevant
> > subsystem lists on the patches that you expect to go that path.
>
> I deliberately looped mainatiners but not CC'ed each subsystem lists,
> as it is a long list so I don't want to spam them.
>
> If we conclude to go via subsystem trees, I will CC subsystem lists.
> Thanks for reminding.
Sure.
I can ensure that the appropriate maintainers are cc'ed on the relevant
mm.git commits. I generally don't auto-cc mailing lists - I already spray
out too many emails!
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option
2026-03-11 8:44 ` [PATCH v4 00/30] tools build: Append -fzero-init-padding-bits=all option Daniel Lezcano
2026-03-11 8:52 ` Jonathan Cameron
@ 2026-03-11 9:15 ` Leo Yan
1 sibling, 0 replies; 57+ messages in thread
From: Leo Yan @ 2026-03-11 9:15 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Arnaldo Carvalho de Melo, Ian Rogers, Namhyung Kim, James Clark,
Kees Cook, Quentin Monnet, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Adrian Hunter, Masami Hiramatsu, William Breathitt Gray,
Barry Song, Qinxin Xia, Bartosz Golaszewski, Kent Gibson,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Morton, Willy Tarreau, Thomas Weißschuh,
Josh Poimboeuf, Robert Moore, Len Brown, Srinivas Pandruvada,
Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Mark Brown,
Steven Rostedt, Gabriele Monaco, Shuah Khan, Jiri Kosina,
Benjamin Tissoires, linux-kbuild, linux-kernel, llvm, bpf,
linux-perf-users, Bartosz Golaszewski
Hi Daniel,
On Wed, Mar 11, 2026 at 09:44:16AM +0100, Daniel Lezcano wrote:
[...]
> > In this version, the changes are organized into three parts:
> >
> > Patches 01 – 07: Preparation before adding the new compiler option.
> > Fix typos, adjust Makefiles to ensure the newly
> > introduced option does not cause regressions.
> > Patch 08: Propagate -fzero-init-padding-bits=all to
> > EXTRA_CFLAGS and HOST_EXTRACFLAGS for the
> > CC and HOSTCC compilers, respectively.
> > Patches 09 – 30: Apply EXTRA_CFLAGS and HOST_EXTRACFLAGS in
> > project Makefiles.
> >
> Through which tree do you expect these patch to be picked up ? Each
> maintainer picks the patches related to their subsystem ?
I can propose a pickup sequence, but this may need confirmation from the
tools maintainers (especially perf, bpftool, BPF).
I expect patches 01-08 can be merged in one go, as this would be safe
not break anything. Afterwards, patches 09–30 can be picked up
separately by subsystem maintainers, or merged together.
So far, IIUC, there are no maintainers for the tools build. If no
objection from maintainers to merge in one go, I think we have chance
via perf-tools-next tree. Arnaldo, Namhyung, how about you think ?
(sorry this might introduce extra efforts for you).
Thanks,
Leo
^ permalink raw reply [flat|nested] 57+ messages in thread