linux-stable/arch/x86/um
Kees Cook c7500c1b53 um: Allow builds with Clang
Add SUBARCH target for Clang+um (which must go last, not alphabetically,
so the other SUBARCHes are assigned). Remove open-coded "DEFINE"
macro, instead using linux/kbuild.h's version which was updated to use
Clang-friendly assembly in commit cf0c3e68aa ("kbuild: fix asm-offset
generation to work with clang"). Redefine "DEFINE_LONGS" in terms of
"COMMENT" and "DEFINE" so that the intended coment actually has useful
content. Add a missed "break" to avoid implicit fall-through warnings.

This lets me run KUnit tests with Clang:

$ ./tools/testing/kunit/kunit.py run --make_options LLVM=1
...

Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: David Gow <davidgow@google.com>
Cc: linux-um@lists.infradead.org
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Cc: llvm@lists.linux.dev
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/lkml/Yg2YubZxvYvx7%2Fnm@dev-arch.archlinux-ax161/
Tested-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/lkml/CABVgOSk=oFxsbSbQE-v65VwR2+mXeGXDDjzq8t7FShwjJ3+kUg@mail.gmail.com/
Signed-off-by: Kees Cook <keescook@chromium.org>
---
v1: https://lore.kernel.org/lkml/20220217002843.2312603-1-keescook@chromium.org
v2: https://lore.kernel.org/lkml/20220224055831.1854786-1-keescook@chromium.org
v3:
 - use kbuild.h to avoid duplication (Masahiro)
 - fix intended comments (Masahiro)
 - use SUBARCH (Nathan)
2022-03-21 08:13:03 -07:00
..
asm um: remove set_fs 2021-12-22 17:56:56 +01:00
os-Linux um: stop polluting the namespace with registers.h contents 2021-12-21 21:31:35 +01:00
shared/sysdep um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c 2021-12-21 21:30:44 +01:00
vdso kbuild: remove cc-option test of -fno-stack-protector 2020-07-07 11:13:10 +09:00
bugs_32.c
bugs_64.c
checksum_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
delay.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
elfcore.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fault.c
Kconfig arch: remove GENERIC_FIND_FIRST_BIT entirely 2022-01-15 08:47:31 -08:00
ldt.c x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt() 2017-10-20 10:37:33 +02:00
Makefile uml: x86: add FORCE to user_constants.h 2021-12-21 21:13:44 +01:00
mem_32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mem_64.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptrace_32.c um: stop polluting the namespace with registers.h contents 2021-12-21 21:31:35 +01:00
ptrace_64.c um: stop polluting the namespace with registers.h contents 2021-12-21 21:31:35 +01:00
ptrace_user.c
setjmp_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
setjmp_64.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
signal.c um: stop polluting the namespace with registers.h contents 2021-12-21 21:31:35 +01:00
stub_32.S um: rework userspace stubs to not hard-code stub location 2021-02-12 21:35:02 +01:00
stub_64.S um: rework userspace stubs to not hard-code stub location 2021-02-12 21:35:02 +01:00
stub_segv.c um: fix stub location calculation 2021-08-26 22:28:03 +02:00
sys_call_table_32.c uml: trim unused junk from arch/x86/um/sys_call_table_*.c 2021-12-21 21:30:44 +01:00
sys_call_table_64.c um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c 2021-12-21 21:30:44 +01:00
syscalls_32.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
syscalls_64.c um: stop polluting the namespace with registers.h contents 2021-12-21 21:31:35 +01:00
sysrq_32.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
sysrq_64.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
tls_32.c um: Implement copy_thread_tls 2020-01-07 13:31:29 +01:00
tls_64.c um: Implement copy_thread_tls 2020-01-07 13:31:29 +01:00
user-offsets.c um: Allow builds with Clang 2022-03-21 08:13:03 -07:00