Skip to contentSkip to conversation

clang: Fix nativesdk build after recipe splits

PATCH In review Khem Raj 2 participants 4 messages Sep 18, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 clang: Fix nativesdk build after recipe splits

Splitting llvm, tblgen into their own recipes means we have to ensure nativesdk clang build can find these tools in native sysroot, which is would previously build and use on its own.

---
 meta/recipes-devtools/clang/clang_git.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/clang/clang_git.bb +2 -0
index 9e977379325..bcc799f286b 100644
@@ -78,6 +78,8 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
 
 EXTRA_OECMAKE:append:class-nativesdk = "\
                   -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \
+                  -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
+                  -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \
                   -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
                   -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \
                   -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \
#1 lore raw

Hello, Khem

Quoted 28 lines · Khem Raj via lists.openembedded.org

Splitting llvm, tblgen into their own recipes means we have to ensure nativesdk clang build can find these tools in native sysroot, which is would previously build and use on its own.

---
  meta/recipes-devtools/clang/clang_git.bb | 2 ++
  1 file changed, 2 insertions(+)
meta/recipes-devtools/clang/clang_git.bb +2 -1
index 9e977379325..bcc799f286b 100644
@@ -78,6 +78,8 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
 
  EXTRA_OECMAKE:append:class-nativesdk = "\
                    -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \
+                  -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
+                  -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \
                    -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
                    -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \
                    -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 7 lines

Links: You receive all messages sent to this group.
View/Reply Online (#223625): https://lists.openembedded.org/g/openembedded-core/message/223625
Mute This Topic: https://lists.openembedded.org/mt/115304299/8026893
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

I spotted this error in the autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/2266/steps/12/logs/stdio

Could you please take a look?
Thanks!

Signature · 2 lines
Best regards,
João Marcos Costa
author
#2 lore raw
Quoted 51 lines · Joao Marcos Costa

Hello, Khem

Quoted 5 lines · Khem Raj via lists.openembedded.org

Splitting llvm, tblgen into their own recipes means we have to ensure nativesdk clang build can find these tools in native sysroot, which is would previously build and use on its own.

Review

Quoted 7 lines
---
  meta/recipes-devtools/clang/clang_git.bb | 2 ++
  1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta/recipes-devtools/clang/clang_git.bb

meta/recipes-devtools/clang/clang_git.bb EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ · line 80

Quoted 7 lines

index 9e977379325..bcc799f286b 100644

meta/recipes-devtools/clang/clang_git.bb +0 -0
@@ -78,6 +78,8 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
 
  EXTRA_OECMAKE:append:class-nativesdk = "\
 

-DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake'
\

meta/recipes-devtools/clang/clang_git.bb EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ · line 81

Quoted 1 line
meta/recipes-devtools/clang/clang_git.bb +1 -0
+

-DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \

meta/recipes-devtools/clang/clang_git.bb EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ · line 82

Quoted 1 line
meta/recipes-devtools/clang/clang_git.bb +1 -0
+

-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \

Quoted 1 line

-DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \

Quoted 1 line

-DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \

Quoted 1 line

-DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \

Quoted 6 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#223625):

https://lists.openembedded.org/g/openembedded-core/message/223625

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/115304299/8026893
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

Quoted 7 lines

I spotted this error in the autobuilder:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/2266/steps/12/logs/stdio

Could you please take a look?
Thanks!

Logs are showing clang-native failure while the change in this patch is limited to nativesdk clang. So it is unrelated to this patch

However change seems to be related to llvm recipe separation series since clang is building this tool during its build and trying to use it from its build area but it’s perhaps not finding libllvm from native sysroot

Quoted 5 lines

--
Best regards,
João Marcos Costa

author
#3 lore raw
Quoted 48 lines · Khem Raj
Quoted 44 lines · Joao Marcos Costa

Hello, Khem

Quoted 28 lines · Khem Raj via lists.openembedded.org

Splitting llvm, tblgen into their own recipes means we have to ensure nativesdk clang build can find these tools in native sysroot, which is would previously build and use on its own.

---
  meta/recipes-devtools/clang/clang_git.bb | 2 ++
  1 file changed, 2 insertions(+)
meta/recipes-devtools/clang/clang_git.bb +2 -1
index 9e977379325..bcc799f286b 100644
@@ -78,6 +78,8 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
 
  EXTRA_OECMAKE:append:class-nativesdk = "\
                    -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \
+                  -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
+                  -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \
                    -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
                    -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \
                    -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 7 lines

Links: You receive all messages sent to this group.
View/Reply Online (#223625): https://lists.openembedded.org/g/openembedded-core/message/223625
Mute This Topic: https://lists.openembedded.org/mt/115304299/8026893
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

I spotted this error in the autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/2266/steps/12/logs/stdio

Quoted 7 lines
Quoted 2 lines

Could you please take a look?
Thanks!

Logs are showing clang-native failure while the change in this patch is limited to nativesdk clang. So it is unrelated to this patch

However change seems to be related to llvm recipe separation series since clang is building this tool during its build and trying to use it from its build area but it’s perhaps not finding libllvm from native sysroot

I poked at the worker on AB where it is failing, I think there is a cmake patch which is problematic.

https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/

clang builds some tools during build and links them to in-tree libLLVM if it is built in monolithic builds ( which we do ) and this option omits build time rpaths which causes this problem.

Quoted 8 lines
Quoted 8 lines

--
Best regards,
João Marcos Costa