WSL2-Linux-Kernel/scripts
Nathan Chancellor 84bb2f0c98 kbuild: Fix '-S -c' in x86 stack protector scripts
commit 3415b10a03945b0da4a635e146750dfe5ce0f448 upstream.

After a recent change in clang to stop consuming all instances of '-S'
and '-c' [1], the stack protector scripts break due to the kernel's use
of -Werror=unused-command-line-argument to catch cases where flags are
not being properly consumed by the compiler driver:

  $ echo | clang -o - -x c - -S -c -Werror=unused-command-line-argument
  clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]

This results in CONFIG_STACKPROTECTOR getting disabled because
CONFIG_CC_HAS_SANE_STACKPROTECTOR is no longer set.

'-c' and '-S' both instruct the compiler to stop at different stages of
the pipeline ('-S' after compiling, '-c' after assembling), so having
them present together in the same command makes little sense. In this
case, the test wants to stop before assembling because it is looking at
the textual assembly output of the compiler for either '%fs' or '%gs',
so remove '-c' from the list of arguments to resolve the error.

All versions of GCC continue to work after this change, along with
versions of clang that do or do not contain the change mentioned above.

Cc: stable@vger.kernel.org
Fixes: 4f7fd4d7a7 ("[PATCH] Add the -fstack-protector option to the CFLAGS")
Fixes: 60a5317ff0 ("x86: implement x86_32 stack protector")
Link: 6461e53781 [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:16 +02:00
..
atomic atomics: Fix atomic64_{read_acquire,set_release} fallbacks 2022-04-08 14:23:57 +02:00
basic .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
clang-tools gen_compile_commands: fix invalid escape sequence warning 2024-03-26 18:21:12 -04:00
coccinelle
dtc kbuild: Allow kernel installation packaging to override pkg-config 2023-02-01 08:27:30 +01:00
dummy-tools kbuild: dummy-tools: avoid tmpdir leak in dummy gcc 2022-08-25 11:40:14 +02:00
gcc-plugins gcc-plugins: Rename last_stmt() for GCC 14+ 2024-07-27 10:46:06 +02:00
gdb scripts/gdb: fix SB_* constants parsing 2024-06-16 13:39:54 +02:00
genksyms .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
kconfig kconfig: remove wrong expr_trans_bool() 2024-07-27 10:46:09 +02:00
ksymoops
mod modpost: trim leading spaces when processing source files list 2024-02-23 08:55:04 +01:00
package builddeb: clean generated package content 2023-03-10 09:39:44 +01:00
selinux selinux: use "grep -E" instead of "egrep" 2022-10-26 12:34:35 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-01 08:27:23 +01:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kbuild.include
Kconfig.include
Lindent License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile kbuild: Allow kernel installation packaging to override pkg-config 2023-02-01 08:27:30 +01:00
Makefile.asm-generic kbuild: prefix $(srctree)/ to some included Makefiles 2021-03-15 19:20:48 +09:00
Makefile.build
Makefile.clang
Makefile.clean
Makefile.compiler powerpc: remove checks for binutils older than 2.25 2024-01-25 14:52:32 -08:00
Makefile.dtbinst kbuild: Install dtb files as 0644 in Makefile.dtbinst 2024-07-05 09:14:48 +02:00
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-10 16:18:41 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:40:27 +02:00
Makefile.headersinst kbuild: prefix $(srctree)/ to some included Makefiles 2021-03-15 19:20:48 +09:00
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.lib
Makefile.modfinal kbuild: Disable KCSAN for autogenerated *.mod.c intermediaries 2024-05-17 11:50:53 +02:00
Makefile.modinst
Makefile.modpost
Makefile.package
Makefile.ubsan
Makefile.userprogs
adjust_autoksyms.sh
as-version.sh
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 13:51:56 +02:00
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-01-22 06:34:44 +09:00
bootgraph.pl
bpf_doc.py bpf, scripts: Correct GPL license name 2024-03-01 13:21:58 +01:00
cc-can-link.sh
cc-version.sh
check-sysctl-docs
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:49:02 +01:00
checkpatch.pl
checkstack.pl checkstack: fix printed address 2023-12-13 18:36:43 +01:00
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
coccicheck
config kconfig: config script: add a little user help 2021-01-04 10:38:11 +09:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-02-23 08:55:13 +01:00
decodecode
depmod.sh
dev-needs.sh
diffconfig scripts: handle BrokenPipeError for python scripts 2023-03-17 08:49:02 +01:00
documentation-file-ref-check documentation-file-ref-check: Make git check work for multiple working directories 2021-06-04 11:20:52 -06:00
export_report.pl
extract-cert.c
extract-ikconfig scripts/extract-ikconfig: Support LZ4-compressed images. 2015-04-15 14:01:12 +02:00
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:45:16 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:45:16 +02:00
gen_autoksyms.sh
gen_ksymdeps.sh
generate_initcall_order.pl
get_abi.pl scripts/get_abi: fix source path leak 2024-02-23 08:54:25 +01:00
get_dvb_firmware treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
get_feat.pl
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec scripts/jobserver-exec: Fix a typo ("envirnoment") 2021-05-17 12:10:03 +09:00
kallsyms.c
kernel-doc
ld-version.sh kbuild: Make ld-version.sh more robust against version string changes 2024-07-18 13:07:45 +02:00
leaking_addresses.pl
link-vmlinux.sh kbuild: fix short log for AS in link-vmlinux.sh 2024-07-18 13:07:36 +02:00
makelst
markup_oops.pl
min-tool-version.sh
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-06-17 10:01:12 +09:00
mksysmap
mkuboot.sh
module.lds.S
modules-check.sh
nsdeps kbuild: replace LANG=C with LC_ALL=C 2021-05-02 00:43:35 +09:00
objdiff
pahole-flags.sh bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25 2024-01-25 14:52:31 -08:00
pahole-version.sh kbuild: Add CONFIG_PAHOLE_VERSION 2023-02-25 12:06:45 +01:00
parse-maintainers.pl
patch-kernel License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-24 17:36:47 +01:00
recordmcount.h
recordmcount.pl
remove-stale-files
setlocalversion scripts/setlocalversion: fix a bug when LOCALVERSION is empty 2021-07-18 23:48:14 +09:00
show_delta tweewide: Fix most Shebang lines 2020-12-08 23:30:04 +09:00
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:17:37 +01:00
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-27 11:05:44 +01:00
split-man.pl
stackdelta License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-05 18:25:05 +01:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh