linux/scripts
Nathan Chancellor 41dd963641 kbuild: Fix '-S -c' in x86 stack protector scripts
commit 3415b10a03 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:40:59 +02:00
..
atomic Merge branch 'kcsan' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/core 2020-10-09 08:56:02 +02:00
basic kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
clang-tools gen_compile_commands: fix invalid escape sequence warning 2024-03-26 18:21:46 -04:00
coccinelle Merge branch 'for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux 2020-10-18 14:20:35 -07:00
dtc scripts/dtc: Call pkg-config POSIXly correct 2022-04-08 14:40:15 +02:00
dummy-tools kbuild: dummy-tools: adjust to stricter stackprotector check 2024-04-13 12:59:57 +02:00
gcc-plugins gcc-plugins: Rename last_stmt() for GCC 14+ 2024-07-27 10:40:16 +02:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-05-17 11:48:06 +02:00
genksyms genksyms: keywords: Use __restrict not _restrict 2020-08-18 20:16:46 +09:00
kconfig kconfig: remove wrong expr_trans_bool() 2024-07-27 10:40:18 +02:00
ksymoops
mod modpost: trim leading spaces when processing source files list 2024-02-23 08:42:25 +01:00
package builddeb: clean generated package content 2023-03-11 16:39:46 +01:00
selinux selinux: use "grep -E" instead of "egrep" 2022-10-26 13:25:17 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-01 08:23:22 +01:00
.gitignore kbuild: preprocess module linker script 2020-09-25 00:36:41 +09:00
adjust_autoksyms.sh kbuild: split adjust_autoksyms.sh in two parts 2020-03-03 20:49:21 +09:00
as-version.sh kbuild: Switch to 'f' variants of integrated assembler flag 2023-04-20 12:10:28 +02:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:27:42 +02:00
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-05-22 11:40:55 +02:00
bootgraph.pl
bpf_helpers_doc.py bpf, scripts: Correct GPL license name 2024-03-01 13:16:50 +01:00
cc-can-link.sh
check_extable.sh
check-sysctl-docs docs: add a script to check sysctl docs 2020-02-25 03:35:16 -07:00
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
checkpatch.pl checkpatch: fix unescaped left brace 2020-12-30 11:53:56 +01:00
checkstack.pl checkstack: fix printed address 2023-12-13 18:27:02 +01:00
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck scripts: coccicheck: Change default condition for parallelism 2020-10-12 10:37:56 +02:00
config tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
const_structs.checkpatch const_structs.checkpatch: add pinctrl_ops and pinmux_ops 2020-10-16 11:11:21 -07:00
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-02-23 08:42:31 +01:00
decodecode scripts/decodecode: add the capability to supply the program counter 2020-10-13 18:38:26 -07:00
depmod.sh depmod: handle the case of /sbin/depmod without /sbin in PATH 2021-01-12 20:18:16 +01:00
dev-needs.sh scripts/dev-needs: Add script to list device dependencies 2020-09-04 18:19:37 +02:00
diffconfig scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
documentation-file-ref-check scripts: documentation-file-ref-check: Add line break before exit 2020-04-15 15:13:13 -06:00
export_report.pl modpost: move the namespace field in Module.symvers last 2020-03-17 08:59:03 +09:00
extract_xc3028.pl
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-16 09:57:17 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:54 +01:00
file-size.sh
find-unused-docs.sh scripts/find-unused-docs: Fix massive false positives 2020-01-27 14:25:06 -07:00
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:40:59 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:40:59 +02:00
gen_autoksyms.sh kbuild: fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64 2021-02-26 10:13:01 +01:00
gen_ksymdeps.sh kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y 2021-09-18 13:40:16 +02:00
get_abi.pl scripts/get_abi: fix source path leak 2024-02-23 08:41:54 +01:00
get_dvb_firmware
get_maintainer.pl get_maintainer: exclude MAINTAINERS file(s) from --git-fallback 2020-10-16 11:11:19 -07:00
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
insert-sys-cert.c
jobserver-exec
kallsyms.c kallsyms: fix nonconverging kallsyms table with lld 2021-02-17 11:02:24 +01:00
Kbuild.include kbuild: remove the target in signal traps when interrupted 2022-10-26 13:25:43 +02:00
Kconfig.include kbuild: check the minimum assembler version in Kconfig 2023-04-20 12:10:28 +02:00
kernel-doc scripts: kernel-doc: Fix syntax error due to undeclared args variable 2024-04-13 12:58:46 +02:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-18 14:03:57 +01:00
Lindent
link-vmlinux.sh kbuild: fix short log for AS in link-vmlinux.sh 2024-07-18 13:05:45 +02:00
lld-version.sh scripts/lld-version.sh: Rewrite based on upstream ld-version.sh 2021-11-21 13:46:37 +01:00
Makefile certs: Add ability to preload revocation certs 2021-06-30 08:47:30 -04:00
Makefile.asm-generic
Makefile.build x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
Makefile.clean kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
Makefile.dtbinst kbuild: Install dtb files as 0644 in Makefile.dtbinst 2024-07-05 09:12:54 +02:00
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-13 12:58:32 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:38:10 +02:00
Makefile.headersinst
Makefile.host kbuild: sort hostprogs before passing it to ifneq 2020-08-10 01:32:59 +09:00
Makefile.kasan kasan: fix hwasan build for gcc 2021-04-28 13:40:02 +02:00
Makefile.kcov kbuild: include scripts/Makefile.* only when relevant CONFIG is enabled 2020-08-10 01:32:59 +09:00
Makefile.kcsan Kbuild updates for v5.10 2020-10-22 13:13:57 -07:00
Makefile.lib dt-bindings: Use json for processed-schema* 2020-08-19 14:31:57 -06:00
Makefile.modfinal kbuild: preprocess module linker script 2020-09-25 00:36:41 +09:00
Makefile.modinst
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:28:55 +02:00
Makefile.modsign
Makefile.package kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-06-11 20:14:41 +09:00
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-04-13 21:01:10 +02:00
Makefile.userprogs kbuild: add infrastructure to build userspace programs 2020-05-17 18:52:01 +09:00
makelst
markup_oops.pl
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-07-25 14:36:16 +02:00
mkmakefile
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-23 14:17:00 +02:00
mkuboot.sh
module.lds.S modules: Ensure natural alignment for .altinstructions and __bug_table sections 2022-08-25 11:38:19 +02:00
modules-check.sh kbuild: make module name conflict fatal error 2020-05-26 00:03:16 +09:00
nsdeps scripts: add dummy report mode to add_namespace.cocci 2020-07-10 14:19:58 +02:00
objdiff
pahole-flags.sh kbuild: Add skip_encoding_btf_enum64 option to pahole 2022-10-28 12:57:12 +02:00
parse-maintainers.pl parse-maintainers: Do not sort section content by default 2020-03-26 15:08:27 -07:00
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-30 12:57:50 +01:00
recordmcount.h recordmcount: Correct st_shndx handling 2021-06-30 08:47:23 -04:00
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:40:29 +01:00
setlocalversion scripts/setlocalversion: make git describe output more reliable 2020-09-25 02:28:12 +09:00
show_delta tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:44:29 +01:00
sorttable.c s390/kernel: expand exception table logic to allow new handling options 2020-07-20 10:55:50 +02:00
sorttable.h
spdxcheck-test.sh
spdxcheck.py scripts/spdxcheck.py: handle license identifiers in XML comments 2020-10-02 11:31:26 +02:00
spelling.txt Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2020-10-15 15:11:56 -07:00
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-27 10:54:36 +01:00
split-man.pl tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-27 08:43:31 +02:00
tools-support-relr.sh Makefile: fix GDB warning with CONFIG_RELR 2021-07-14 16:55:53 +02:00
unifdef.c
ver_linux ver_linux: Query ld cache for versions of libc/libcpp run-time 2020-02-10 13:35:15 -08:00
xen-hypercalls.sh
xz_wrap.sh kbuild: add variables for compression tools 2020-06-06 23:42:01 +09:00