diff options
| author | Haseeb Ashraf <haseeb.ashraf@siemens.com> | 2025-01-25 10:41:18 +0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-27 15:47:09 +0000 |
| commit | 6573c70f8bce32dde514df657f93d40b5d49c166 (patch) | |
| tree | 53bc3b46900ed1602c4d143b580cff26ca2216bd | |
| parent | e72d641a9988976ca9144ca3fd8f9a9988d3bdc5 (diff) | |
| download | poky-6573c70f8bce32dde514df657f93d40b5d49c166.tar.gz | |
llvm: set LLVM_HOST_TRIPLE for cross-compilation
The correct way to configure cmake for cross-compilation includes
setting the LLVM_HOST_TRIPLE as well.
Documentation Ref:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.6/llvm/docs/HowToCrossCompileLLVM.rst#configuring-cmake
This fixes bug when LLVM is cross-compiled for AAarch64 but it
was getting built with the triple of native build system instead of
the TARGET_SYS (aarch64-oe-linux) in my case.
`No available targets are compatible with triple "x86_64-unknown-linux-gnu"`
(From OE-Core rev: 19f649f47352f7e12508abd88a862e95979d152d)
Signed-off-by: Haseeb Ashraf <haseeb.ashraf@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/llvm/llvm_19.1.6.bb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm_19.1.6.bb b/meta/recipes-devtools/llvm/llvm_19.1.6.bb index 003676a652..3efd6c40c3 100644 --- a/meta/recipes-devtools/llvm/llvm_19.1.6.bb +++ b/meta/recipes-devtools/llvm/llvm_19.1.6.bb | |||
| @@ -82,12 +82,14 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ | |||
| 82 | 82 | ||
| 83 | EXTRA_OECMAKE:append:class-target = "\ | 83 | EXTRA_OECMAKE:append:class-target = "\ |
| 84 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ | 84 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ |
| 85 | -DLLVM_HOST_TRIPLE=${TARGET_SYS} \ | ||
| 85 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ | 86 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ |
| 86 | -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ | 87 | -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ |
| 87 | " | 88 | " |
| 88 | 89 | ||
| 89 | EXTRA_OECMAKE:append:class-nativesdk = "\ | 90 | EXTRA_OECMAKE:append:class-nativesdk = "\ |
| 90 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ | 91 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ |
| 92 | -DLLVM_HOST_TRIPLE=${SDK_SYS} \ | ||
| 91 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ | 93 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \ |
| 92 | -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ | 94 | -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \ |
| 93 | " | 95 | " |
