Skip to content

Commit 69f057c

Browse files
authored
[AArch64] Skip test aarch64-init-cpu-features if FMV runtime unavailable. (#269)
The test aarch64-init-cpu-features is conditionally built depending on whether the FMV runtime is available. When the test-suite is built using CMake it is handled here: #172 This patch fixes build errors when running LNT tests on AArch64 using Make rather than CMake: * It selects between __init_cpu_features_resolver and __init_cpu_features. * Attempts to compile a dummy program using TARGET_LLVMGCC to detect availability of the selected symbol. * Adds corresponding macro (HAS_DARWIN_FMV or HAS_LINUX_FMV) if detection succeeds. * Skips test if the symbol is undefined. Co-authored-by: Alexandros Lamprineas alexandros.lamprineas@arm.com Co-authored-by: Momchil Velikov momchil.velikov@arm.com
1 parent eed578a commit 69f057c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

SingleSource/Benchmarks/Misc/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ PROGRAMS_TO_SKIP := dt
1212
endif
1313
endif
1414

15+
ifeq ($(ARCH),AArch64)
16+
ifeq ($(TARGET_OS),Darwin)
17+
SYMBOL = __init_cpu_features_resolver
18+
endif
19+
ifeq ($(TARGET_OS),Linux)
20+
SYMBOL = __init_cpu_features
21+
endif
22+
# TARGET_LLVMGCC refers to the compiler specified with the --cc option,
23+
# and can be checked in the build-tools.log file in the test results directory.
24+
SYMBOL := $(shell echo "extern void $(SYMBOL)(void); void (*p)() = $(SYMBOL); int main() {}" | \
25+
$(TARGET_LLVMGCC) --rtlib=compiler-rt -x c - -o /dev/null 2>/dev/null && \
26+
echo $(SYMBOL) || echo undefined)
27+
ifeq ($(SYMBOL),__init_cpu_features_resolver)
28+
CFLAGS += --rtlib=compiler-rt -DHAS_DARWIN_FMV
29+
endif
30+
ifeq ($(SYMBOL),__init_cpu_features)
31+
CFLAGS += --rtlib=compiler-rt -DHAS_LINUX_FMV
32+
endif
33+
ifeq ($(SYMBOL),undefined)
34+
PROGRAMS_TO_SKIP := aarch64-init-cpu-features
35+
endif
36+
endif
37+
1538
ifeq ($(ARCH),Mips)
1639
RUNTIMELIMIT := 2000
1740
endif

0 commit comments

Comments
 (0)