diff --git a/SingleSource/Benchmarks/Misc/Makefile b/SingleSource/Benchmarks/Misc/Makefile index 5256ac43bf..7dd9198770 100644 --- a/SingleSource/Benchmarks/Misc/Makefile +++ b/SingleSource/Benchmarks/Misc/Makefile @@ -12,6 +12,29 @@ PROGRAMS_TO_SKIP := dt endif endif +ifeq ($(ARCH),AArch64) +ifeq ($(TARGET_OS),Darwin) +SYMBOL = __init_cpu_features_resolver +endif +ifeq ($(TARGET_OS),Linux) +SYMBOL = __init_cpu_features +endif +# TARGET_LLVMGCC refers to the compiler specified with the --cc option, +# and can be checked in the build-tools.log file in the test results directory. +SYMBOL := $(shell echo "extern void $(SYMBOL)(void); void (*p)() = $(SYMBOL); int main() {}" | \ + $(TARGET_LLVMGCC) --rtlib=compiler-rt -x c - -o /dev/null 2>/dev/null && \ + echo $(SYMBOL) || echo undefined) +ifeq ($(SYMBOL),__init_cpu_features_resolver) +CFLAGS += --rtlib=compiler-rt -DHAS_DARWIN_FMV +endif +ifeq ($(SYMBOL),__init_cpu_features) +CFLAGS += --rtlib=compiler-rt -DHAS_LINUX_FMV +endif +ifeq ($(SYMBOL),undefined) +PROGRAMS_TO_SKIP := aarch64-init-cpu-features +endif +endif + ifeq ($(ARCH),Mips) RUNTIMELIMIT := 2000 endif