linux-stable/scripts
Nathan Chancellor 16ecad3f8b 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-08-28 16:21:33 +02:00
..
atomic
basic
coccinelle
dtc
gcc-plugins gcc-plugins: Rename last_stmt() for GCC 14+ 2024-07-27 10:38:28 +02:00
gdb
genksyms genksyms: fix memory leak when the same symbol is read from *.symref file 2025-03-13 12:43:00 +01:00
kconfig kconfig: lxdialog: fix 'space' to (de)select options 2025-08-28 16:21:29 +02:00
ksymoops
mod modpost: fix the missed iteration for the max bit in do_input() 2025-01-09 13:23:36 +01:00
package
selinux selinux: Chain up tool resolving errors in install_policy.sh 2025-04-10 14:29:39 +02:00
tracing
.gitignore
adjust_autoksyms.sh
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_helpers_doc.py scripts/bpf: Fix xdp_md forward declaration typo 2024-03-01 13:13:38 +01:00
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config kbuild: fix argument parsing in scripts/config 2025-06-04 14:32:31 +02:00
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract_xc3028.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:33:53 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:33:53 +02:00
gen_compile_commands.py
gen_ksymdeps.sh
get_abi.pl
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
kallsyms.c
Kbuild.include kbuild: Add KBUILD_CPPFLAGS to as-option invocation 2025-08-28 16:21:33 +02:00
Kconfig.include
kernel-doc
ld-version.sh
leaking_addresses.pl
Lindent
link-vmlinux.sh
Makefile
Makefile.asm-generic
Makefile.build
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-enum-conversion to W=2 2025-03-13 12:43:09 +01:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host kbuild: use -MMD instead of -MD to exclude system headers from dependency 2025-07-17 18:24:51 +02:00
Makefile.kasan
Makefile.kcov
Makefile.lib kbuild: use -MMD instead of -MD to exclude system headers from dependency 2025-07-17 18:24:51 +02:00
Makefile.modbuiltin
Makefile.modfinal
Makefile.modinst
Makefile.modpost
Makefile.modsign
Makefile.package
Makefile.ubsan
makelst
markup_oops.pl
mkcompile_h kbuild: Use uname for LINUX_COMPILE_HOST detection 2024-12-14 19:44:19 +01:00
mkmakefile
mksysmap
mkuboot.sh
module-common.lds
modules-check.sh
namespace.pl
nsdeps
objdiff
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
setlocalversion
show_delta
sign-file.c
sortextable.c
sortextable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh