diff options
| author | Ming Liu <liu.ming50@gmail.com> | 2023-05-13 18:16:53 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-05-16 08:03:18 -0700 |
| commit | 869df95b61ba44a7ad6bc57da8a31e459eec5059 (patch) | |
| tree | 2cb02aaec45f64bd7055d8894303038e3f26c121 /classes | |
| parent | 8035778aed0dc9ddee3fdcaf880c520245d26eae (diff) | |
| download | meta-clang-869df95b61ba44a7ad6bc57da8a31e459eec5059.tar.gz | |
clang.bbclass: create lld symbolic link in sysroot when ld-is-lld is set
Create a symbolic link lld -> ld in recipe sysroot to choose the
default linker lld when ld-is-lld is set in DISTRO_FEATURES. othereise,
we can get linking issues when '-fuse-ld=lld' is in LDFLAGS but the
actual ld is not lld.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/clang.bbclass | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 817face..23f67ce 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
| @@ -136,6 +136,16 @@ set( CMAKE_CLANG_TIDY ${HOST_PREFIX}clang-tidy ) | |||
| 136 | EOF | 136 | EOF |
| 137 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake | 137 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake |
| 138 | } | 138 | } |
| 139 | |||
| 140 | RECIPESYSROOTFUNCS = "" | ||
| 141 | RECIPESYSROOTFUNCS:toolchain-clang = "recipe_sysroot_check_ld_is_lld" | ||
| 142 | |||
| 143 | recipe_sysroot_check_ld_is_lld () { | ||
| 144 | if "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'true', 'false', d)}"; then | ||
| 145 | ln -srf ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld.lld ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld | ||
| 146 | fi | ||
| 147 | } | ||
| 148 | do_prepare_recipe_sysroot[postfuncs] += "${RECIPESYSROOTFUNCS}" | ||
| 139 | # | 149 | # |
| 140 | # dump recipes which still use gcc | 150 | # dump recipes which still use gcc |
| 141 | #python __anonymous() { | 151 | #python __anonymous() { |
