Go to file
Nathan Chancellor 79a4fba715 kbuild: Add KBUILD_CPPFLAGS to as-option invocation
commit 43fc0a9990 upstream.

After commit feb843a469 ("kbuild: add $(CLANG_FLAGS) to
KBUILD_CPPFLAGS"), there is an error while building certain PowerPC
assembly files with clang:

  arch/powerpc/lib/copypage_power7.S: Assembler messages:
  arch/powerpc/lib/copypage_power7.S:34: Error: junk at end of line: `0b01000'
  arch/powerpc/lib/copypage_power7.S:35: Error: junk at end of line: `0b01010'
  arch/powerpc/lib/copypage_power7.S:37: Error: junk at end of line: `0b01000'
  arch/powerpc/lib/copypage_power7.S:38: Error: junk at end of line: `0b01010'
  arch/powerpc/lib/copypage_power7.S:40: Error: junk at end of line: `0b01010'
  clang: error: assembler command failed with exit code 1 (use -v to see invocation)

as-option only uses KBUILD_AFLAGS, so after removing CLANG_FLAGS from
KBUILD_AFLAGS, there is no more '--target=' or '--prefix=' flags. As a
result of those missing flags, the host target
will be tested during as-option calls and likely fail, meaning necessary
flags may not get added when building assembly files, resulting in
errors like seen above.

Add KBUILD_CPPFLAGS to as-option invocations to clear up the errors.
This should have been done in commit d5c8d6e0fa ("kbuild: Update
assembler calls to use proper flags and language target"), which
switched from using the assembler target to the assembler-with-cpp
target, so flags that affect preprocessing are passed along in all
relevant tests. as-option now mirrors cc-option.

Fixes: feb843a469 ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/CA+G9fYs=koW9WardsTtora+nMgLR3raHz-LSLr58tgX4T5Mxag@mail.gmail.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:04:10 +01:00
arch mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation 2025-06-27 11:04:10 +01:00
block blk-iocost: do not WARN if iocg was already offlined 2025-05-02 07:41:07 +02:00
certs
crypto crypto: xts - Only add ecb if it is not already there 2025-06-27 11:04:01 +01:00
Documentation x86/bugs: Make spectre user default depend on MITIGATION_SPECTRE_V2 2025-06-04 14:37:02 +02:00
drivers drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang 2025-06-27 11:04:10 +01:00
fs fs/filesystems: Fix potential unsigned integer underflow in fs_name() 2025-06-27 11:04:10 +01:00
include net: Fix TOCTOU issue in sk_is_readable() 2025-06-27 11:04:09 +01:00
init bpf: Clean up sockmap related Kconfigs 2025-06-27 11:04:09 +01:00
io_uring
ipc
kernel posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() 2025-06-27 11:04:10 +01:00
lib dql: Fix dql->limit value when reset. 2025-06-04 14:36:59 +02:00
LICENSES
mm mm/page_alloc.c: avoid infinite retries caused by cpuset race 2025-06-04 14:37:08 +02:00
net net_sched: ets: fix a race in ets_qdisc_change() 2025-06-27 11:04:10 +01:00
samples tracing: samples: Initialize trace_array_printk() with the correct function 2025-06-04 14:36:57 +02:00
scripts kbuild: Add KBUILD_CPPFLAGS to as-option invocation 2025-06-27 11:04:10 +01:00
security smack: recognize ipv4 CIPSO w/o categories 2025-06-04 14:37:04 +02:00
sound ALSA: pcm: Fix race of buffer access at PCM OSS layer 2025-06-04 14:37:07 +02:00
tools perf record: Fix incorrect --user-regs comments 2025-06-27 11:04:06 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS 2025-06-27 11:04:10 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.