All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Askar Safin <safinaskar@gmail.com>
Cc: linux-kbuild@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	regressions@lists.linux.dev, nathan@kernel.org,
	linux-kernel@vger.kernel.org, miguel.ojeda.sandonis@gmail.com,
	ojeda@kernel.org, sam@gentoo.org,
	thomas.weissschuh@linutronix.de, Daniel Xu <dxu@dxuuu.xyz>
Subject: Re: [REGRESSION][BISECTED] kbuild: CFLAGS=-w no longer works
Date: Thu, 9 Oct 2025 10:48:45 +0200	[thread overview]
Message-ID: <aOd27ViaWbsdwNDR@levanger> (raw)
In-Reply-To: <20251009075149.1083040-1-safinaskar@gmail.com>

On Thu, Oct 09, 2025 at 10:51:49AM +0300, Askar Safin wrote:
> #regzbot introduced: d1d0963121769d8d16150b913fe886e48efefa51
> 
> As well as I understand, if you want to disable warnings, you
> should pass "CFLAGS=-w" to "make". Starting with d1d096312176,
> this no longer works.
> 
> Steps to reproduce:
> 
> $ cd linux
> $ git clean -f -q -d -x  # To clean everything not controlled by git
> $ echo 'CONFIG_64BIT=y' > /tmp/minimini
> $ make allnoconfig KCONFIG_ALLCONFIG=/tmp/minimini
> $ make -j32 CFLAGS=-w

If you want to hand-over additional CFLAGS to kbuild you need to use
KCFLAGS or other variations, see Documentation/kbuild/kbuild.rst.
When I intentionally introduce a warning in e.g. init/main.c, I can
suppress the compiler warning by calling

    make KCFLAGS=-w

Your log output below does not contain any warning, so I assume that you
actually want to point to something different.


[...]
>   CC      /rbt/linux/tools/objtool/libsubcmd/exec-cmd.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/help.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/pager.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/parse-options.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/run-command.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/sigchain.o
>   CC      /rbt/linux/tools/objtool/libsubcmd/subcmd-config.o
> exec-cmd.c:2:10: fatal error: linux/compiler.h: No such file or directory
>     2 | #include <linux/compiler.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[5]: *** [/rbt/linux/tools/build/Makefile.build:86: /rbt/linux/tools/objtool/libsubcmd/exec-cmd.o] Error 1
> make[5]: *** Waiting for unfinished jobs....
> parse-options.c:2:10: fatal error: linux/compiler.h: No such file or directory
>     2 | #include <linux/compiler.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[5]: *** [/rbt/linux/tools/build/Makefile.build:86: /rbt/linux/tools/objtool/libsubcmd/parse-options.o] Error 1
> In file included from sigchain.c:3:
> subcmd-util.h:8:10: fatal error: linux/compiler.h: No such file or directory
>     8 | #include <linux/compiler.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[5]: *** [/rbt/linux/tools/build/Makefile.build:86: /rbt/linux/tools/objtool/libsubcmd/sigchain.o] Error 1
>   MKELF   scripts/mod/elfconfig.h
> In file included from help.c:12:
> subcmd-util.h:8:10: fatal error: linux/compiler.h: No such file or directory
>     8 | #include <linux/compiler.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
>   HOSTCC  scripts/mod/modpost.o
> make[5]: *** [/rbt/linux/tools/build/Makefile.build:85: /rbt/linux/tools/objtool/libsubcmd/help.o] Error 1
>   HOSTCC  scripts/mod/sumversion.o
> In file included from run-command.c:11:
> subcmd-util.h:8:10: fatal error: linux/compiler.h: No such file or directory
>     8 | #include <linux/compiler.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
>   HOSTCC  scripts/mod/symsearch.o
> make[5]: *** [/rbt/linux/tools/build/Makefile.build:85: /rbt/linux/tools/objtool/libsubcmd/run-command.o] Error 1
>   UPD     scripts/mod/devicetable-offsets.h
>   HOSTCC  scripts/mod/file2alias.o
> make[4]: *** [Makefile:78: /rbt/linux/tools/objtool/libsubcmd/libsubcmd-in.o] Error 2
> make[3]: *** [Makefile:83: /rbt/linux/tools/objtool/libsubcmd/libsubcmd.a] Error 2
> make[2]: *** [Makefile:73: objtool] Error 2
> make[1]: *** [/rbt/linux/Makefile:1430: tools/objtool] Error 2
> make[1]: *** Waiting for unfinished jobs....

This is reproducible on my machine:

    make -C tools objtool CFLAGS=-w

But is doesn't matter which CFLAGS you add here, as they overwrite
objtool's include paths.

According to tools/build/Documentation/Build.txt you should use
different variables for everything below tools/, e.g.:

    make -C tools objtool CFLAGS_objtool=-w

Does this help for your specific issue?

Kind regards,
Nicolas

  parent reply	other threads:[~2025-10-09  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-09  7:51 [REGRESSION][BISECTED] kbuild: CFLAGS=-w no longer works Askar Safin
2025-10-09  8:02 ` Askar Safin
2025-10-09  8:48 ` Nicolas Schier [this message]
2025-10-15  2:55   ` Askar Safin
2025-10-09 17:41 ` Nathan Chancellor
2025-12-03 20:05 ` Askar Safin

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=aOd27ViaWbsdwNDR@levanger \
    --to=nsc@kernel.org \
    --cc=dxu@dxuuu.xyz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nathan@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=safinaskar@gmail.com \
    --cc=sam@gentoo.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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.