Skip to content

Commit aca43ad

Browse files
brooniectmarinas
authored andcommitted
selftests/arm64: Fix O= builds for the floating point tests
Currently the arm64 floating point tests don't support out of tree builds due to two quirks of the kselftest build system. One is that when building a program from multiple files we shouldn't separately compile the main program to an object file as that will result in the pattern rule not matching when adjusted for the output directory. The other is that we also need to include $(OUTPUT) in the names of the binaries when specifying the dependencies in order to ensure that they get picked up with O=. Rewrite the dependencies for the executables to fix these issues. The kselftest build system will ensure OUTPUT is always defined. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 399cf0a commit aca43ad

File tree

1 file changed

+15
-17
lines changed
  • tools/testing/selftests/arm64/fp

1 file changed

+15
-17
lines changed

tools/testing/selftests/arm64/fp/Makefile

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,26 @@ TEST_PROGS_EXTENDED := fpsimd-stress sve-stress ssve-stress za-stress
1717
EXTRA_CLEAN += $(OUTPUT)/asm-utils.o $(OUTPUT)/rdvl.o $(OUTPUT)/za-fork-asm.o
1818

1919
# Build with nolibc to avoid effects due to libc's clone() support
20-
fp-pidbench: fp-pidbench.S asm-utils.o
20+
$(OUTPUT)/fp-pidbench: fp-pidbench.S $(OUTPUT)/asm-utils.o
2121
$(CC) -nostdlib $^ -o $@
22-
fpsimd-test: fpsimd-test.o asm-utils.o
22+
$(OUTPUT)/fpsimd-test: fpsimd-test.S $(OUTPUT)/asm-utils.o
2323
$(CC) -nostdlib $^ -o $@
24-
rdvl-sme: rdvl-sme.o rdvl.o
25-
rdvl-sve: rdvl-sve.o rdvl.o
26-
sve-ptrace: sve-ptrace.o
27-
sve-probe-vls: sve-probe-vls.o rdvl.o
28-
sve-test: sve-test.o asm-utils.o
24+
$(OUTPUT)/rdvl-sve: rdvl-sve.c $(OUTPUT)/rdvl.o
25+
$(OUTPUT)/rdvl-sme: rdvl-sme.c $(OUTPUT)/rdvl.o
26+
$(OUTPUT)/sve-ptrace: sve-ptrace.c
27+
$(OUTPUT)/sve-probe-vls: sve-probe-vls.c $(OUTPUT)/rdvl.o
28+
$(OUTPUT)/sve-test: sve-test.S $(OUTPUT)/asm-utils.o
2929
$(CC) -nostdlib $^ -o $@
30-
ssve-test: sve-test.S asm-utils.o
30+
$(OUTPUT)/ssve-test: sve-test.S $(OUTPUT)/asm-utils.o
3131
$(CC) -DSSVE -nostdlib $^ -o $@
32-
vec-syscfg: vec-syscfg.o rdvl.o
33-
vlset: vlset.o
34-
za-fork: za-fork.o za-fork-asm.o
35-
$(CC) -nostdlib -static $^ -o $@ -lgcc
36-
za-fork.o: za-fork.c
37-
$(CC) -c -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
32+
$(OUTPUT)/vec-syscfg: vec-syscfg.c $(OUTPUT)/rdvl.o
33+
$(OUTPUT)/vlset: vlset.c
34+
$(OUTPUT)/za-fork: za-fork.c $(OUTPUT)/za-fork-asm.o
35+
$(CC) -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
3836
-include ../../../../include/nolibc/nolibc.h \
39-
-ffreestanding -Wall $^ -o $@
40-
za-test: za-test.o asm-utils.o
37+
-static -ffreestanding -Wall $^ -o $@
38+
$(OUTPUT)/za-ptrace: za-ptrace.c
39+
$(OUTPUT)/za-test: za-test.S $(OUTPUT)/asm-utils.o
4140
$(CC) -nostdlib $^ -o $@
42-
za-ptrace: za-ptrace.o
4341

4442
include ../../lib.mk

0 commit comments

Comments
 (0)