linux/scripts
Linus Torvalds a79be02bba Fix mis-uses of 'cc-option' for warning disablement
This was triggered by one of my mis-uses causing odd build warnings on
sparc in linux-next, but while figuring out why the "obviously correct"
use of cc-option caused such odd breakage, I found eight other cases of
the same thing in the tree.

The root cause is that 'cc-option' doesn't work for checking negative
warning options (ie things like '-Wno-stringop-overflow') because gcc
will silently accept options it doesn't recognize, and so 'cc-option'
ends up thinking they are perfectly fine.

And it all works, until you have a situation where _another_ warning is
emitted.  At that point the compiler will go "Hmm, maybe the user
intended to disable this warning but used that wrong option that I
didn't recognize", and generate a warning for the unrecognized negative
option.

Which explains why we have several cases of this in the tree: the
'cc-option' test really doesn't work for this situation, but most of the
time it simply doesn't matter that ity doesn't work.

The reason my recently added case caused problems on sparc was pointed
out by Thomas Weißschuh: the sparc build had a previous explicit warning
that then triggered the new one.

I think the best fix for this would be to make 'cc-option' a bit smarter
about this sitation, possibly by adding an intentional warning to the
test case that then triggers the unrecognized option warning reliably.

But the short-term fix is to replace 'cc-option' with an existing helper
designed for this exact case: 'cc-disable-warning', which picks the
negative warning but uses the positive form for testing the compiler
support.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/all/20250422204718.0b4e3f81@canb.auug.org.au/
Explained-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-04-23 10:08:29 -07:00
..
atomic
bash-completion kbuild: add Kbuild bash completion 2025-03-15 21:22:52 +09:00
basic
clang-tools gen_compile_commands.py: remove code for '\#' replacement 2025-03-15 21:16:21 +09:00
coccinelle - The 7 patch series "powerpc/crash: use generic crashkernel 2025-04-01 10:06:52 -07:00
dtc
dummy-tools
gcc-plugins
gdb - The 7 patch series "powerpc/crash: use generic crashkernel 2025-04-01 10:06:52 -07:00
gendwarfksyms gendwarfksyms: Add a separate pass to resolve FQNs 2025-03-15 21:16:11 +09:00
genksyms genksyms: Handle typeof_unqual keyword and __seg_{fs,gs} qualifiers 2025-04-14 09:19:04 +02:00
include
ipe
kconfig kconfig: merge_config: use an empty file as initfile 2025-04-06 06:22:01 +09:00
ksymoops
lib/abi docs: ABI: move README contents to the top 2025-02-13 09:47:44 -07:00
mod Disable SLUB_TINY for build testing 2025-04-06 10:00:04 -07:00
package kbuild: rpm-pkg: build a debuginfo RPM 2025-04-06 06:22:01 +09:00
selinux selinux: Chain up tool resolving errors in install_policy.sh 2025-03-07 14:38:34 -05:00
tracing scripts/tracing: Remove scripts/tracing/draw_functrace.py 2025-03-20 07:02:21 -04:00
.gitignore lib: packing: add pack_fields() and unpack_fields() 2024-12-11 20:13:00 -08:00
Kbuild.include
Kconfig.include
Lindent
Makefile Kbuild updates for v6.14 2025-01-31 12:07:07 -08:00
Makefile.asm-headers
Makefile.autofdo
Makefile.btf kbuild, bpf: Correct pahole version that supports distilled base btf feature 2025-02-24 14:14:52 -08:00
Makefile.build Kbuild updates for v6.15 2025-04-05 15:46:50 -07:00
Makefile.clang kbuild: clang: Support building UM with SUBARCH=i386 2025-03-04 09:40:13 -08:00
Makefile.clean
Makefile.compiler rust: kbuild: use `pound` to support GNU Make < 4.3 2025-04-15 20:45:46 +02:00
Makefile.debug
Makefile.defconf kbuild: suppress stdout from merge_config for silent builds 2025-01-10 23:01:21 +09:00
Makefile.dtbinst
Makefile.dtbs
Makefile.extrawarn Fix mis-uses of 'cc-option' for warning disablement 2025-04-23 10:08:29 -07:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.kmsan
Makefile.lib Kbuild updates for v6.15 2025-04-05 15:46:50 -07:00
Makefile.modfinal
Makefile.modinst kbuild: Fix signing issue for external modules 2025-01-18 08:52:09 +09:00
Makefile.modpost modpost: Allow extended modversions without basic MODVERSIONS 2025-01-11 02:36:32 +09:00
Makefile.package
Makefile.propeller
Makefile.randstruct
Makefile.ubsan ubsan/overflow: Enable ignorelist parsing and add type filter 2025-03-07 19:58:05 -08:00
Makefile.userprogs
Makefile.vdsoinst
Makefile.vmlinux kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00
Makefile.vmlinux_o objtool: Remove --no-unreachable for noinstr-only vmlinux.o runs 2025-03-25 09:20:27 +01:00
as-version.sh
asn1_compiler.c
bloat-o-meter
bootgraph.pl
bpf_doc.py
build-version
cc-can-link.sh
cc-version.sh
check-git
check-sysctl-docs
check-uapi.sh
check-variable-fonts.sh
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl Kbuild updates for v6.15 2025-04-05 15:46:50 -07:00
checkstack.pl
checksyscalls.sh
checktransupdate.py
checkversion.pl
cleanfile
cleanpatch
coccicheck
config kbuild: fix argument parsing in scripts/config 2025-03-15 21:22:42 +09:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: fix decoding of lines with an additional info 2025-01-12 19:03:34 -08:00
decodecode
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check scripts/documentation-file-ref-check: don't check perl/python scripts 2025-02-10 11:19:56 -07:00
extract-fwblobs scripts: add script to extract built-in firmware blobs 2025-03-16 22:30:46 -07:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gen-crc-consts.py riscv/crc: add "template" for Zbc optimized CRC functions 2025-03-10 09:29:08 -07:00
gen-randstruct-seed.sh
gen_packed_field_checks.c lib: packing: add pack_fields() and unpack_fields() 2024-12-11 20:13:00 -08:00
generate_builtin_ranges.awk kbuild: exclude .rodata.(cst|str)* when building ranges 2025-03-15 21:22:52 +09:00
generate_initcall_order.pl
generate_rust_analyzer.py scripts: generate_rust_analyzer: Add ffi crate 2025-04-08 19:47:06 +02:00
generate_rust_target.rs ARM and clkdev updates for 6.15-rc1 2025-04-03 12:21:44 -07:00
get_abi.py scripts/get_abi.py: add support for undefined ABIs 2025-02-10 11:19:57 -07:00
get_dvb_firmware
get_feat.pl scripts: get_feat.pl: substitute s390x with s390 2025-03-12 16:25:50 -06:00
get_maintainer.pl get_maintainer: stop reporting subsystem status as maintainer role 2025-03-16 22:30:49 -07:00
gfp-translate
git.orderFile
head-object-list.txt openrisc: place exception table at the head of vmlinux 2024-12-10 12:04:19 +00:00
headerdep.pl
headers_install.sh
insert-sys-cert.c
install.sh
integer-wrap-ignore.scl ubsan/overflow: Enable ignorelist parsing and add type filter 2025-03-07 19:58:05 -08:00
jobserver-exec
kallsyms.c kallsyms: Remove KALLSYMS_ABSOLUTE_PERCPU 2025-02-18 10:16:04 +01:00
kernel-doc scripts/kernel-doc: drop dead code for Wcontents_before_sections 2025-03-04 09:47:42 -07:00
ld-version.sh
leaking_addresses.pl
link-vmlinux.sh Kbuild updates for v6.15 2025-04-05 15:46:50 -07:00
macro_checker.py
make_fit.py scripts/make_fit: Print DT name before libfdt errors 2025-03-27 14:03:32 -05:00
makelst
markup_oops.pl
min-tool-version.sh x86/build: Raise the minimum LLVM version to 15.0.0 2025-02-21 14:08:16 +01:00
misc-check
mkcompile_h
mksysmap scripts/mksysmap: Fix escape chars '$' 2024-12-28 23:23:52 +09:00
mkuboot.sh
module-common.c
module.lds.S kbuild: keep symbols for symbol_get() even with CONFIG_TRIM_UNUSED_KSYMS 2025-02-06 01:08:58 +09:00
modules-check.sh
nsdeps
objdiff
objdump-func
orc_hash.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
relocs_check.sh
remove-stale-files
rust_is_available.sh rust: document `bindgen` 0.71.0 regression 2025-01-10 00:17:00 +01:00
rust_is_available_bindgen_0_66.h
rust_is_available_bindgen_libclang.h
rust_is_available_bindgen_libclang_concat.h
rust_is_available_test.py
rustc-llvm-version.sh
rustc-version.sh
rustdoc_test_builder.rs
rustdoc_test_gen.rs Rust changes for v6.15 2025-03-30 17:03:26 -07:00
setlocalversion
show_delta scripts: make python shebangs specific about desired version 2025-03-15 21:19:44 +09:00
sign-file.c
sorttable.c scripts/sorttable: Fix endianness handling in build-time mcount sort 2025-04-02 09:51:26 -04:00
spdxcheck-test.sh
spdxcheck.py scripts/spdxcheck: Handle license identifiers in Jinja comments 2025-01-08 15:38:33 +01:00
spdxexclude
spelling.txt kernel-wide: add explicity||explicitly to spelling.txt 2025-01-12 20:21:06 -08:00
sphinx-pre-install
split-man.pl
ssl-common.h
stackdelta
stackusage
subarch.include
syscall.tbl fs: add open_tree_attr() 2025-02-12 12:12:28 +01:00
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh scripts/tags.sh: tag SYM_*START*() assembler symbols 2025-02-20 15:24:09 +01:00
tools-support-relr.sh
unifdef.c
ver_linux
verify_builtin_ranges.awk
xen-hypercalls.sh
xz_wrap.sh