linux/tools
John Hubbard 569f8b501b selftests/arm64: fix build failure during the "emit_tests" step
The build failure reported in [1] occurred because commit <9fc96c7c19df>
("selftests: error out if kernel header files are not yet built") added
a new "kernel_header_files" dependency to "all", and that triggered
another, pre-existing problem. Specifically, the arm64 selftests
override the emit_tests target, and that override improperly declares
itself to depend upon the "all" target.

This is a problem because the "emit_tests" target in lib.mk was not
intended to be overridden. emit_tests is a very simple, sequential build
target that was originally invoked from the "install" target, which in
turn, depends upon "all".

That approach worked for years. But with 9fc96c7c19 in place,
emit_tests failed, because it does not set up all of the elaborate
things that "install" does. And that caused the new
"kernel_header_files" target (which depends upon $(KBUILD_OUTPUT) being
correct) to fail.

Some detail: The "all" target is .PHONY. Therefore, each target that
depends on "all" will cause it to be invoked again, and because
dependencies are managed quite loosely in the selftests Makefiles, many
things will run, even "all" is invoked several times in immediate
succession. So this is not a "real" failure, as far as build steps go:
everything gets built, but "all" reports a problem when invoked a second
time from a bad environment.

To fix this, simply remove the unnecessary "all" dependency from the
overridden emit_tests target. The dependency is still effectively
honored, because again, invocation is via "install", which also depends
upon "all".

An alternative approach would be to harden the emit_tests target so that
it can depend upon "all", but that's a lot more complicated and hard to
get right, and doesn't seem worth it, especially given that emit_tests
should probably not be overridden at all.

[1] https://lore.kernel.org/20230710-kselftest-fix-arm64-v1-1-48e872844f25@kernel.org

Fixes: 9fc96c7c19 ("selftests: error out if kernel header files are not yet built")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Tested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-07-14 12:33:35 -06:00
..
accounting delayacct: track delays from IRQ/SOFTIRQ 2023-04-18 16:39:34 -07:00
arch asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
bootconfig
bpf tools/resolve_btfids: Fix setting HOSTCFLAGS 2023-06-05 15:44:47 -07:00
build
certs
cgroup
counter tools/counter: Makefile: Remove lingering 'include' directories on make clean 2023-05-09 19:17:17 -04:00
debugging
edid
firewire
firmware
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-05-11 10:56:24 +02:00
hv
iio
include asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib perf tools changes and fixes for v6.5: 1st batch 2023-06-30 11:35:41 -07:00
memory-model LKMM scripting updates for v6.4 2023-04-24 12:02:25 -07:00
mm slab changes for 6.4 2023-04-25 13:00:41 -07:00
net/ynl tools: ynl: add display-hint support to ynl 2023-06-24 15:45:49 -07:00
objtool objtool: Remove btrfs_assertfail() from the noreturn exceptions list 2023-06-29 17:27:47 -07:00
pci
pcmcia
perf perf tools changes and fixes for v6.5: 2nd batch 2023-07-08 10:21:51 -07:00
power platform-drivers-x86 for v6.5-1 2023-06-30 14:50:00 -07:00
rcu
scripts sh updates for v6.4 2023-04-27 17:41:23 -07:00
spi spi: spidev_test Add three missing spi mode bits 2023-05-30 15:20:12 +01:00
testing selftests/arm64: fix build failure during the "emit_tests" step 2023-07-14 12:33:35 -06:00
thermal
time
tracing rtla/timerlat_hist: Add timerlat user-space support 2023-06-13 16:41:14 -04:00
usb usbip: Use _FORTIFY_SOURCE=2 instead of (implicitly) =1 2023-05-29 15:11:30 +01:00
verification rv: Fix addition on an uninitialized variable 'run' 2023-04-25 17:02:13 -04:00
virtio tools/virtio: fix build break for aarch64 2023-06-27 10:47:08 -04:00
wmi
workqueue workqueue: Track and monitor per-workqueue CPU time usage 2023-05-17 17:02:09 -10:00
Makefile tools/Makefile: do missed s/vm/mm/ 2023-04-18 14:22:12 -07:00