summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2025-11-12 11:12:50 +0100
committerKhem Raj <raj.khem@gmail.com>2026-01-12 10:20:41 -0800
commit93331b475e1f4e473688479739714ba99d4e701c (patch)
tree8e3293134e2d9aa01db7414ffe2341a8decf01f5
parent542db81d5d3cbddf84a150b088b946734460fee6 (diff)
downloadmeta-clang-93331b475e1f4e473688479739714ba99d4e701c.tar.gz
clang.bbclass: add clang-native to BASE_DEFAULT_DEPS
Add it for target builds in: BASE_DEFAULT_DEPS:append:class-target:toolchain-clang:class-target because ${MLPREFIX}clang-cross-${TARGET_ARCH} contains a broken symlink to clang binary provided by clang-native and then in case someone changes e.g. TC_CXX_RUNTIME = "llvm" to TC_CXX_RUNTIME:class-target = "llvm" then both clang-native and clang-cross-${TARGET_ARCH} are correctly rebuilt, but unfortunately the hashequiv output hash of clang-cross-${TARGET_ARCH} doesn't change (because the broken symlink is still the same), so e.g. gptfdisk which depends on "equivalent" clang-cross from BASE_DEFAULT_DEPS doesn't get rebuilt, but then it still links with libc++.so.1 while in clean build without sstate and hashequiv it will link with libstdc++.so.6 (because TC_CXX_RUNTIME affects only clang-native and the override for class-target doesn't work as one might expect). This might need some bigger changes in hashequiv to have special handlink of broken symlinks in the output, if the symlink target is provided by some dependency, we should include the hash of the symlink target to make sure the outhash changes even when something deeper in dependency tree changed the target binary (or error out when there is no direct dependency of the provider). clang-cross from oe-core master doesn't have this issue, because it contains the actual binary from clang-native after: https://github.com/openembedded/openembedded-core/commit/3b0128fe6421e64674fd250e0b4e6afb1c8ce436 so the outhash is changed when this binary is changed. Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
-rw-r--r--classes/clang.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass
index f9057eb..d1fe69a 100644
--- a/classes/clang.bbclass
+++ b/classes/clang.bbclass
@@ -116,7 +116,7 @@ YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}"
116def clang_base_deps(d): 116def clang_base_deps(d):
117 if not d.getVar('INHIBIT_DEFAULT_DEPS', False): 117 if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
118 if not oe.utils.inherits(d, 'allarch') : 118 if not oe.utils.inherits(d, 'allarch') :
119 ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " 119 ret = " clang-native ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc "
120 if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): 120 if (d.getVar('TC_CXX_RUNTIME').find('android') != -1):
121 ret += " libcxx" 121 ret += " libcxx"
122 return ret 122 return ret