From: Sedat Dilek <sedat.dilek@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
Andi Kleen <andi@firstfloor.org>, Ian Rogers <irogers@google.com>,
Mark Wielaard <mark@klomp.org>,
Michal Marek <michal.lkml@markovi.net>,
Nathan Chancellor <natechancellor@gmail.com>,
Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kbuild: fix duplicated flags in DEBUG_CFLAGS
Date: Wed, 3 Feb 2021 09:19:19 +0100 [thread overview]
Message-ID: <CA+icZUWpXQZqF+sz9bTv8ZUw2xYKUiCChyu92Zma1y-EtruRLA@mail.gmail.com> (raw)
In-Reply-To: <20210203075239.5505-1-masahiroy@kernel.org>
On Wed, Feb 3, 2021 at 8:53 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Sedat Dilek noticed duplicated debug flags passed when building C
> files with CONFIG_DEBUG_INFO.
>
> I do not know much about his build environment, but yes, Kbuild
> recurses to the top Makefile with some build targets. For example,
> 'make CC=clang bindeb-pkg' reproduces the issue.
>
> With commit 121c5d08d53c ("kbuild: Only add -fno-var-tracking-assignments
> for old GCC versions") applied, DEBUG_CFLAGS is now reset only when
> CONFIG_CC_IS_GCC=y.
>
> Fix it to reset DEBUG_CFLAGS also when using Clang.
>
Great, Masahiro!
I wanted to request an "undrunken" switch for GNU/make :-).
- Sedat -
> Fixes: 121c5d08d53c ("kbuild: Only add -fno-var-tracking-assignments for old GCC versions")
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 3d3f67b98ca2..769a38ee81b9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -811,10 +811,12 @@ KBUILD_CFLAGS += -ftrivial-auto-var-init=zero
> KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
> endif
>
> +DEBUG_CFLAGS :=
> +
> # Workaround for GCC versions < 5.0
> # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801
> ifdef CONFIG_CC_IS_GCC
> -DEBUG_CFLAGS := $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
> +DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
> endif
>
> ifdef CONFIG_DEBUG_INFO
> --
> 2.27.0
>
next prev parent reply other threads:[~2021-02-03 8:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 7:52 [PATCH] kbuild: fix duplicated flags in DEBUG_CFLAGS Masahiro Yamada
2021-02-03 8:19 ` Sedat Dilek [this message]
2021-02-03 8:31 ` Sedat Dilek
2021-02-03 8:38 ` Masahiro Yamada
2021-02-03 8:55 ` Sedat Dilek
2021-02-03 10:31 ` Mark Wielaard
2021-02-03 17:38 ` Nathan Chancellor
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=CA+icZUWpXQZqF+sz9bTv8ZUw2xYKUiCChyu92Zma1y-EtruRLA@mail.gmail.com \
--to=sedat.dilek@gmail.com \
--cc=andi@firstfloor.org \
--cc=clang-built-linux@googlegroups.com \
--cc=irogers@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@klomp.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).