diff options
| author | Haixiao Yan <haixiao.yan.cn@windriver.com> | 2025-07-05 08:52:25 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-07-06 22:06:15 -0700 |
| commit | ac0ac304e34449360fb35c26684dea0e747e23f7 (patch) | |
| tree | 347377718262ea25085562d87d679e74767ce72d | |
| parent | 0a9c47ba49db81bb68ca4d0b60249694a4c63914 (diff) | |
| download | meta-clang-ac0ac304e34449360fb35c26684dea0e747e23f7.tar.gz | |
Revert "clang: Do not provide llvm-native implicitly"
This reverts commit 384e8d169a2c408e2cef03ea2deb88fb82058011.
The original commit removed the implicit PROVIDES declarations for llvm,
llvm-native, and nativesdk-llvm from the clang recipe.
However, this change breaks builds in kirkstone-clang18 environments, where
mesa and lib32-llvm expect these to be provided by clang:
- Mesa fails due to missing providers for llvm18.1.6 and nativesdk-llvm18.1.6.
- lib32-llvm 13.0.1 fails on ARM BSPs with the following error, falling back to
the core layer's outdated LLVM:
error: 'RegVT' was not declared in this scope
This commit was backported from scarthgap, but it is incompatible with oe-core
expectations in the kirkstone branch. Reverting it restores compatibility.
Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
| -rw-r--r-- | README.md | 14 | ||||
| -rw-r--r-- | conf/layer.conf | 3 | ||||
| -rw-r--r-- | recipes-devtools/clang/clang_git.bb | 3 |
3 files changed, 6 insertions, 14 deletions
| @@ -57,20 +57,6 @@ TOOLCHAIN = "clang" | |||
| 57 | also look at `conf/nonclangable.conf` for list of recipes which do not yet fully | 57 | also look at `conf/nonclangable.conf` for list of recipes which do not yet fully |
| 58 | build with clang. | 58 | build with clang. |
| 59 | 59 | ||
| 60 | # Providing LLVM | ||
| 61 | |||
| 62 | clang recipes can provide llvm and related packages too, it might be worth using single | ||
| 63 | provider for llvm and clang to save some compile time and space, select the knobs | ||
| 64 | to point to clang, default is to use the version provided by core layer. | ||
| 65 | |||
| 66 | ```shell | ||
| 67 | PREFERRED_PROVIDER_llvm = "clang" | ||
| 68 | PREFERRED_PROVIDER_llvm-native = "clang-native" | ||
| 69 | PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" | ||
| 70 | PROVIDES:pn-clang = "llvm" | ||
| 71 | PROVIDES:pn-clang-native = "llvm-native" | ||
| 72 | PROVIDES:pn-nativesdk-clang = "nativesdk-llvm" | ||
| 73 | ``` | ||
| 74 | # Default Compiler Runtime | 60 | # Default Compiler Runtime |
| 75 | 61 | ||
| 76 | Default is to use GNU runtime `TC_CXX_RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ | 62 | Default is to use GNU runtime `TC_CXX_RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ |
diff --git a/conf/layer.conf b/conf/layer.conf index 3cf7fc3..0e2caec 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
| @@ -27,6 +27,9 @@ BBFILES_DYNAMIC += " \ | |||
| 27 | 27 | ||
| 28 | PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" | 28 | PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" |
| 29 | #PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs_forcevariable = "libcxx" | 29 | #PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs_forcevariable = "libcxx" |
| 30 | PREFERRED_PROVIDER_llvm = "clang" | ||
| 31 | PREFERRED_PROVIDER_llvm-native = "clang-native" | ||
| 32 | PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" | ||
| 30 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("TC_CXX_RUNTIME", "llvm android", "libcxx", "libunwind", d)}" | 33 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("TC_CXX_RUNTIME", "llvm android", "libcxx", "libunwind", d)}" |
| 31 | INHERIT += "clang" | 34 | INHERIT += "clang" |
| 32 | 35 | ||
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index cf4456c..096b11a 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
| @@ -287,6 +287,9 @@ do_install:append:class-nativesdk () { | |||
| 287 | PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ | 287 | PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ |
| 288 | libclang lldb lldb-server liblldb llvm-linker-tools" | 288 | libclang lldb lldb-server liblldb llvm-linker-tools" |
| 289 | 289 | ||
| 290 | PROVIDES += "llvm llvm${PV}" | ||
| 291 | PROVIDES:append:class-native = " llvm-native" | ||
| 292 | |||
| 290 | BBCLASSEXTEND = "native nativesdk" | 293 | BBCLASSEXTEND = "native nativesdk" |
| 291 | 294 | ||
| 292 | RDEPENDS:lldb += "${PN}-lldb-python lldb-server" | 295 | RDEPENDS:lldb += "${PN}-lldb-python lldb-server" |
