Ubuntu-focal-kernel/scripts
Nathan Chancellor 61849b2ff5 kbuild: Fix '-S -c' in x86 stack protector scripts
BugLink: https://bugs.launchpad.net/bugs/2078388

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>
[nathan: Fixed conflict in 32-bit version due to lack of 3fb0fdb3bb]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:21 +02:00
..
atomic
basic kbuild: remove unneeded comments and code from scripts/basic/Makefile 2019-08-29 23:54:29 +09:00
coccinelle scripts: add dummy report mode to add_namespace.cocci 2020-09-04 16:28:43 -03:00
dtc scripts/dtc: dtx_diff: remove broken example from help text 2022-03-07 16:37:02 +01:00
gcc-plugins gcc-plugins: Rename last_stmt() for GCC 14+ 2024-09-27 10:50:08 +02:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-08-09 12:25:23 +02:00
genksyms genksyms: convert to SPDX License Identifier for lex.l and parse.y 2019-09-14 11:40:13 +09:00
kconfig kconfig: remove wrong expr_trans_bool() 2024-09-27 10:50:08 +02:00
ksymoops
mod modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host 2024-02-02 14:13:05 +01:00
package kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-16 05:15:01 -04:00
selinux selinux: use "grep -E" instead of "egrep" 2023-01-06 08:43:54 -08:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-03-21 10:08:59 +01:00
.gitignore
Kbuild.include kbuild: remove the target in signal traps when interrupted 2023-01-06 08:44:02 -08:00
Kconfig.include kconfig: introduce m32-flag and m64-flag 2020-04-29 16:25:31 +02:00
Lindent
Makefile certs: Add ability to preload revocation certs 2021-11-24 15:28:34 +01:00
Makefile.asm-generic
Makefile.build kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n' 2021-08-13 09:45:24 +02:00
Makefile.clean kbuild: clean up subdir-ymn calculation in Makefile.clean 2019-08-29 23:54:29 +09:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-06-07 15:01:35 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-10-17 15:01:52 +02:00
Makefile.headersinst kbuild: move headers_check rule to usr/include/Makefile 2020-03-06 14:05:54 +01:00
Makefile.host kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
Makefile.kasan kasan/arm64: fix CONFIG_KASAN_SW_TAGS && KASAN_INLINE 2019-08-15 13:24:04 +01:00
Makefile.kcov
Makefile.lib kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-16 05:15:01 -04:00
Makefile.modbuiltin kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
Makefile.modfinal kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build 2019-08-22 01:14:11 +09:00
Makefile.modinst UBUNTU: SAUCE: Fix module signing exclusion in package builds 2019-11-25 14:56:30 +01:00
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-10-17 15:02:22 +02:00
Makefile.modsign kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod 2019-07-17 22:39:27 +09:00
Makefile.package kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-16 05:15:01 -04:00
Makefile.ubsan
adjust_autoksyms.sh kbuild: remove the first line of *.mod files 2019-07-18 02:19:31 +09:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-08-09 12:25:13 +02:00
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-06-18 15:02:28 +02:00
bootgraph.pl
bpf_helpers_doc.py scripts/bpf: Fix xdp_md forward declaration typo 2024-04-26 10:54:09 +02:00
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: fix unescaped left brace 2021-01-20 14:26:09 +01:00
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace: strip basepath from all paths 2020-08-08 01:53:12 -04:00
decodecode scripts/decodecode: fix trapping instruction formatting 2020-05-25 10:42:53 +02:00
depmod.sh depmod: handle the case of /sbin/depmod without /sbin in PATH 2021-02-19 16:43:37 +01:00
diffconfig scripts: switch explicitly to Python 3 2021-06-18 15:02:28 +02:00
documentation-file-ref-check
export_report.pl modpost: move the namespace field in Module.symvers last 2020-04-03 15:17:23 +02:00
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2023-02-01 15:21:02 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2023-02-01 15:21:36 +01:00
file-size.sh
find-unused-docs.sh scripts/find-unused-docs: Fix massive false positives 2020-02-17 10:57:48 +01:00
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-09-27 10:50:21 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-09-27 10:50:21 +02:00
gen_compile_commands.py gen_compile_commands: lower the entry count threshold 2019-07-27 12:18:19 +09:00
gen_ksymdeps.sh kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y 2021-10-12 16:31:27 -06:00
get_abi.pl tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
get_dvb_firmware
get_maintainer.pl get_maintainer: add ability to skip moderated mailing lists 2019-07-16 19:23:22 -07:00
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh scripts: headers_install: Exit with error on config leak 2020-08-08 01:53:12 -04:00
insert-sys-cert.c UBUNTU: SAUCE: (noup) KEYS: Support for inserting a certificate into x86 bzImage 2019-11-25 14:56:24 +01:00
kallsyms.c scripts/kallsyms: fix definitely-lost memory leak 2020-01-06 10:10:09 -06:00
kernel-doc stddef: Introduce DECLARE_FLEX_ARRAY() helper 2024-04-26 10:54:12 +02:00
kmsg-doc UBUNTU: SAUCE: s390: kernel message catalog 2019-11-25 14:56:29 +01:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2022-01-13 18:42:10 +01:00
link-vmlinux.sh kbuild: Fix changing ELF file type for output of gen_btf for big endian 2024-03-28 15:18:42 +01:00
makelst
markup_oops.pl
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-09-20 18:49:15 +02:00
mkmakefile kbuild: get rid of $(realpath ...) from scripts/mkmakefile 2019-08-29 23:54:29 +09:00
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-11-24 10:28:30 +01:00
mkuboot.sh
module-common.lds
modules-check.sh kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-05 15:29:49 +09:00
nsdeps scripts: add dummy report mode to add_namespace.cocci 2020-09-04 16:28:43 -03:00
objdiff
parse-maintainers.pl parse-maintainers: Mark as executable 2020-04-03 15:17:23 +02:00
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-08-09 12:25:29 +02:00
recordmcount.h recordmcount: Correct st_shndx handling 2021-08-13 09:44:22 +02:00
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-03-07 16:34:40 +01:00
setlocalversion scripts/setlocalversion: make git describe output more reliable 2020-12-10 12:02:25 +01:00
show_delta tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
sign-file.c sign-file: Fix incorrect return values check 2024-02-02 14:13:21 +01:00
sortextable.c
sortextable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
split-man.pl tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-10-02 12:12:00 +02:00
tools-support-relr.sh Makefile: fix GDB warning with CONFIG_RELR 2021-08-13 09:45:07 +02:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh kbuild: add variables for compression tools 2020-09-16 05:15:01 -04:00