tools/x86_64: Add LLVM target definitions

Summary:
- Added LLVM target definitions (`LLVM_ARCH`, `LLVM_CPU`, `LLVM_ABI`) to `arch/x86_64/src/cmake/Toolchain.cmake` and `arch/x86_64/src/common/Toolchain.defs`
- These definitions are necessary for compatibility with LLVM-based toolchains and ensure proper target architecture, CPU, and ABI settings

Impact:
- Enables support for LLVM-based toolchains when building for x86_64 architecture
- No functional changes for existing GNU-based toolchains
- Improves maintainability by centralizing LLVM-specific configurations in the toolchain files

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2025-01-26 21:08:16 +08:00 committed by Xiang Xiao
parent 7ffea386e6
commit fe0949ad38
2 changed files with 10 additions and 0 deletions

View file

@ -122,6 +122,11 @@ add_compile_options(
-Wno-unknown-pragmas
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>)
# LLVM target definitions
set(LLVM_ARCH "x86_64")
set(LLVM_CPU "x86-64")
set(LLVM_ABI "sysv")
if(CONFIG_CXX_STANDARD)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=${CONFIG_CXX_STANDARD}>)
endif()

View file

@ -70,6 +70,11 @@ ARCHCPUFLAGS = -fno-pic -mcmodel=large -mno-red-zone -mrdrnd
ARCHPICFLAGS = -fPIC
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
# LLVM target definitions
LLVM_ARCHTYPE := x86_64
LLVM_CPUTYPE := x86-64
LLVM_ABITYPE := sysv
# We have to use a cross-development toolchain under Cygwin because the native
# Cygwin toolchains don't generate ELF binaries.