From: sashiko-bot@kernel.org
To: "Trevor Allison" <tallison@redhat.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/3] perf build: Apply EXTRA_CXXFLAGS to C++ builds
Date: Wed, 08 Jul 2026 05:03:12 +0000 [thread overview]
Message-ID: <20260708050313.4005F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708045606.43649-3-tallison@redhat.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] C++ feature detection tests do not receive `EXTRA_CFLAGS`, causing a structural mismatch between feature detection and actual build compilation flags.
- [Low] Injecting `EXTRA_CFLAGS` into `CXXFLAGS` breaks C++ builds when C-specific flags are present.
--
--- Patch [2]: [PATCH 2/3] perf build: Apply EXTRA_CXXFLAGS to C++ builds ---
commit 4b2b9e4dd8644e0e1fa95ec876a875596e1e9178
Author: Trevor Allison <tallison@redhat.com>
perf build: Apply EXTRA_CXXFLAGS to C++ builds
The commit initializes CXXFLAGS in tools/perf/Makefile.config with both
EXTRA_CXXFLAGS and EXTRA_CFLAGS so that C++ objects receive the same builder
flags as the rest of perf.
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 0ba307e78fe1f..052a6cc7942f9 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -17,6 +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))
> +CXXFLAGS := $(EXTRA_CXXFLAGS) $(EXTRA_CFLAGS)
[Severity: Low]
Could this cause a build regression if EXTRA_CFLAGS contains C-only flags?
If EXTRA_CFLAGS contains flags that are only valid for C/ObjC (such as
-Wstrict-prototypes), applying them to C++ files causes compiler warnings.
With -Werror enabled, this results in a build failure.
[Severity: Medium]
Does this create a mismatch between feature detection and the main build?
While CXXFLAGS here receives EXTRA_CFLAGS, the C++ feature detection tests in
tools/build/Makefile.feature still only use:
CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))"
If EXTRA_CFLAGS contains mandatory compiler flags like --sysroot or -m32,
the C++ feature detection tests will fail without EXTRA_CFLAGS. This causes
false negatives where the perf binary silently lacks supported features,
despite the main build succeeding.
> HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708045606.43649-1-tallison@redhat.com?part=2
next prev parent reply other threads:[~2026-07-08 5:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 4:56 [PATCH 0/3] perf: Fix missing CET property notes on x86 with -fcf-protection Trevor Allison
2026-07-08 4:56 ` [PATCH 1/3] perf build: Preserve EXTRA_CFLAGS when building in-tree libbpf Trevor Allison
2026-07-08 4:56 ` [PATCH 2/3] perf build: Apply EXTRA_CXXFLAGS to C++ builds Trevor Allison
2026-07-08 5:03 ` sashiko-bot [this message]
2026-07-08 4:56 ` [PATCH 3/3] perf x86: Add .note.gnu.property to assembly linked into perf Trevor Allison
2026-07-08 5:08 ` sashiko-bot
2026-07-13 20:33 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260708050313.4005F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tallison@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.