Skip to content

[FMV][AArch64] Fix missing FMV defines for AArch64 in LNT Makefile #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IamYJLee
Copy link
Contributor

@IamYJLee IamYJLee commented Jul 21, 2025

Add conditional CFLAGS definitions for AArch64 targets to support FMV-related behavior on Darwin and Linux platforms.

  • Adds -DHAS_DARWIN_FMV when ARCH=AArch64 and TARGET_OS=Darwin
  • Adds -DHAS_LINUX_FMV when ARCH=AArch64 and TARGET_OS=Linux

This change fixes build errors when running LNT tests on AArch64 systems with platform-specific FMV handling.

This patch reflects the changes from llvm/llvm-test-suite@d24d5dcd.

ERROR CONTEXT

Before this patch, LNT test runs on AArch64 platforms (e.g., macOS arm64) could fail with missing symbol errors:

--- Tested: 140 tests --
FAIL: SingleSource/Benchmarks/Misc/aarch64-init-cpu-features.compile_time (1 of 140)
FAIL: SingleSource/Benchmarks/Misc/aarch64-init-cpu-features.execution_time (29 of 140)
Processing Times
Undefined symbols for architecture arm64:
  "_RUNTIME_INIT", referenced from:
      _main in aarch64-init-cpu-features.llvm.o
      _main in aarch64-init-cpu-features.llvm.o
      _main in aarch64-init-cpu-features.llvm.o
ld: symbol(s) not found for architecture arm64

Add conditional CFLAGS definitions for AArch64 targets to support
FMV-related behavior on Darwin and Linux platforms.

- Adds -DHAS_DARWIN_FMV when ARCH=AArch64 and TARGET_OS=Darwin
- Adds -DHAS_LINUX_FMV when ARCH=AArch64 and TARGET_OS=Linux

This change fixes build errors when running LNT tests on
AArch64 systems with platform-specific FMV handling.
@davemgreen davemgreen requested a review from labrinea July 21, 2025 07:42
@labrinea
Copy link
Contributor

I am a bit puzzled with the equivalent cmake code

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckHasAArch64FMV.h "void __init_cpu_features_resolver(void);")
check_symbol_exists(__init_cpu_features_resolver ${CMAKE_CURRENT_BINARY_DIR}/CheckHasAArch64FMV.h HAS_AARCH64_FMV)

The way I read it HAS_AARCH64_FMV is always true? Am I mistaken, do we need it here too perhaps? cc @jroelofs

@IamYJLee
Copy link
Contributor Author

@labrinea Thank you for your comment.

I've confirmed how check_symbol_exists functions and understand that HAS_AARCH64_FMV is not always true. In my environment, when I configure the project using CMakeLists.txt, HAS_AARCH64_FMV is set to False.

However, when I run LNT with a Makefile that includes my modifications, the build and execution complete without any issues.

In other words, even though check_symbol_exists confirms that the __init_cpu_features_resolver symbol is missing, there are no problems compiling and running aarch64-init-cpu-features.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants