diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2025-11-12 11:12:50 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-12-11 20:21:48 -0800 |
| commit | 5c602337ea1a80fb7217eeda04e396cf90587dca (patch) | |
| tree | 0356309dff4c5c2dd2bfe99148140dea342c94a4 /classes/clang.bbclass | |
| parent | 8cbb4ae395d31c7ad178302126a497f7a1477b5b (diff) | |
| download | meta-clang-5c602337ea1a80fb7217eeda04e396cf90587dca.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>
Diffstat (limited to 'classes/clang.bbclass')
| -rw-r--r-- | classes/clang.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 304a78d..5a4db09 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
| @@ -114,7 +114,7 @@ YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" | |||
| 114 | def clang_base_deps(d): | 114 | def clang_base_deps(d): |
| 115 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): | 115 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): |
| 116 | if not oe.utils.inherits(d, 'allarch') : | 116 | if not oe.utils.inherits(d, 'allarch') : |
| 117 | ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " | 117 | ret = " clang-native ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " |
| 118 | if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): | 118 | if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): |
| 119 | ret += " libcxx" | 119 | ret += " libcxx" |
| 120 | return ret | 120 | return ret |
