linux/tools/testing/selftests
Nathan Chancellor e9c281928c kbuild: Make $(LLVM) more flexible
The LLVM make variable allows a developer to quickly switch between the
GNU and LLVM tools. However, it does not handle versioned binaries, such
as the ones shipped by Debian, as LLVM=1 just defines the tool variables
with the unversioned binaries.

There was some discussion during the review of the patch that introduces
LLVM=1 around versioned binaries, ultimately coming to the conclusion
that developers can just add the folder that contains the unversioned
binaries to their PATH, as Debian's versioned suffixed binaries are
really just symlinks to the unversioned binaries in /usr/lib/llvm-#/bin:

$ realpath /usr/bin/clang-14
/usr/lib/llvm-14/bin/clang

$ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1

However, that can be cumbersome to developers who are constantly testing
series with different toolchains and versions. It is simple enough to
support these versioned binaries directly in the Kbuild system by
allowing the developer to specify the version suffix with LLVM=, which
is shorter than the above suggestion:

$ make ... LLVM=-14

It does not change the meaning of LLVM=1 (which will continue to use
unversioned binaries) and it does not add too much additional complexity
to the existing $(LLVM) code, while allowing developers to quickly test
their series with different versions of the whole LLVM suite of tools.

Some developers may build LLVM from source but not add the binaries to
their PATH, as they may not want to use that toolchain systemwide.
Support those developers by allowing them to supply the directory that
the LLVM tools are available in, as it is no more complex to support
than the version suffix change above.

$ make ... LLVM=/path/to/llvm/

Update and reorder the documentation to reflect these new additions.
At the same time, notate that LLVM=0 is not the same as just omitting it
altogether, which has confused people in the past.

Link: https://lore.kernel.org/r/20200317215515.226917-1-ndesaulniers@google.com/
Link: https://lore.kernel.org/r/20220224151322.072632223@infradead.org/
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2022-03-31 12:03:46 +09:00
..
alsa kselftest: alsa: Validate values read from enumerations 2021-12-25 09:13:28 +01:00
arm64 kselftest/arm64: Correct logging of FPSIMD register read via ptrace 2022-01-28 11:30:51 +00:00
bpf tools headers UAPI: remove stale lirc.h 2022-01-25 17:56:24 -08:00
breakpoints
capabilities
cgroup linux-kselftest-next-5.17-rc1 2022-01-10 12:08:12 -08:00
clone3 selftests: fixup build warnings in pidfd / clone3 tests 2022-02-04 13:07:07 -07:00
core selftests/core: remove ARRAY_SIZE define from close_range_test.c 2021-12-10 17:50:38 -07:00
cpu-hotplug
cpufreq selftests: cpufreq: Write test output to stdout as well 2022-01-25 13:20:03 -07:00
damon selftests/damon: split test cases 2021-12-10 17:10:56 -08:00
dma
dmabuf-heaps
drivers selftests: mlxsw: devlink_trap_tunnel_vxlan: Fix 'decap_error' case 2021-12-23 11:24:01 +00:00
efivarfs
exec selftests/exec: Remove pipe from TEST_GEN_FILES 2022-01-27 11:01:20 -07:00
filesystems
firmware
fpu
ftrace selftests/ftrace: make kprobe profile testcase description unique 2021-12-10 16:46:01 -07:00
futex selftests: futex: Use variable MAKE instead of make 2022-01-27 16:29:23 -07:00
gpio gpio updates for v5.17 2022-01-11 12:31:35 -08:00
ia64
intel_pstate
ipc
ir selftests/ir: fix build with ancient kernel headers 2022-02-04 13:14:41 -07:00
kcmp
kexec selftests/kexec: Enable secureboot tests for PowerPC 2022-01-05 11:44:57 -05:00
kmod
kselftest selftests/kselftest/runner/run_one(): allow running non-executable files 2021-11-09 10:02:53 -08:00
kvm selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP 2022-01-28 07:38:25 -05:00
landlock selftests/landlock: remove ARRAY_SIZE define from common.h 2021-12-10 17:50:51 -07:00
lib
livepatch
lkdtm selftest/lkdtm: Skip stack-entropy test if lkdtm is not available 2021-12-16 15:54:38 -08:00
locking
media_tests
membarrier
memfd
memory-hotplug mm/memory_hotplug: remove CONFIG_MEMORY_HOTPLUG_SPARSE 2021-11-06 13:30:42 -07:00
mincore selftests: skip mincore.check_file_mmap when fs lacks needed support 2022-01-27 16:40:45 -07:00
mount selftests/mount: remove unneeded conversion to bool 2021-12-10 16:46:01 -07:00
mount_setattr
move_mount_set_group selftests/move_mount_set_group remove unneeded conversion to bool 2021-12-10 16:46:01 -07:00
mqueue
nci
net selftests: mptcp: add missing join check 2022-02-09 21:44:35 -08:00
netfilter selftests: nft_concat_range: add test for reload with no element add/del 2022-01-27 00:07:46 +01:00
nsfs
ntb
openat2 selftests: openat2: Skip testcases that fail with EOPNOTSUPP 2022-01-27 16:31:07 -07:00
perf_events selftests/perf_events: Test modification of perf_event_attr::sig_data 2022-02-02 13:11:40 +01:00
pid_namespace
pidfd selftests: fixup build warnings in pidfd / clone3 tests 2022-02-04 13:07:07 -07:00
powerpc selftests/powerpc: Add a test of sigreturning to an unaligned address 2021-12-25 10:56:05 +11:00
prctl
proc procfs: do not list TID 0 in /proc/<pid>/task 2021-11-09 10:02:48 -08:00
pstore
ptp testptp: set pin function before other requests 2022-01-05 17:08:58 -08:00
ptrace
rcutorture Merge branches 'doc.2021.11.30c', 'exp.2021.12.07a', 'fastnohz.2021.11.30c', 'fixes.2021.11.30c', 'nocb.2021.12.09a', 'nolibc.2021.11.30c', 'tasks.2021.12.09a', 'torture.2021.12.07a' and 'torturescript.2021.11.30c' into HEAD 2021-12-09 11:38:09 -08:00
resctrl
rlimits
rseq selftests/rseq: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:03 -07:00
rtc selftests: rtc: Increase test timeout so that all tests run 2022-01-25 13:16:01 -07:00
safesetid
sched kselftests/sched: cleanup the child processes 2021-10-05 15:51:43 +02:00
seccomp linux-kselftest-next-5.17-rc1 2022-01-10 12:08:12 -08:00
sgx selftests/sgx: Fix corrupted cpuid macro invocation 2021-12-17 08:52:33 -08:00
sigaltstack
size
sparc64 selftests/sparc64: remove ARRAY_SIZE define from adi-test 2021-12-10 17:51:15 -07:00
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing selftests: tc-testing: add action offload selftest for action and filter 2021-12-19 14:08:48 +00:00
timens selftests/timens: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:20 -07:00
timers selftests: timers: Remove unneeded semicolon 2021-12-10 16:46:00 -07:00
tmpfs
tpm2
uevent
user
vDSO kselftest: Fix vdso_test_abi return status 2022-01-31 10:35:14 -07:00
vm kselftest/vm: revert "tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner" 2022-02-04 09:25:05 -08:00
watchdog
wireguard wireguard: device: reset peer src endpoint when netns exits 2021-11-29 19:50:45 -08:00
x86 linux-kselftest-next-5.16-rc1 2021-11-02 22:00:17 -07:00
zram selftests/zram: Adapt the situation that /dev/zram0 is being used 2022-01-27 10:59:02 -07:00
.gitignore
gen_kselftest_tar.sh
kselftest_deps.sh
kselftest_harness.h kselftest: signal all child processes 2022-01-25 13:48:21 -07:00
kselftest_install.sh
kselftest_module.h
kselftest.h tools: fix ARRAY_SIZE defines in tools and selftests hdrs 2021-12-10 17:50:17 -07:00
lib.mk kbuild: Make $(LLVM) more flexible 2022-03-31 12:03:46 +09:00
Makefile kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest 2021-12-12 10:04:27 +01:00
run_kselftest.sh