diff options
author | Ming Liu <liu.ming50@gmail.com> | 2023-05-13 18:16:53 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-09-08 09:08:54 -0700 |
commit | 42546945254f68749afa5555d3ba484681aa6499 (patch) | |
tree | 6a3666938f14cbda820d43446cea0fbe8138168d | |
parent | 0f4c4c56149f2db375a1ebbbba7451fd80a6fde3 (diff) | |
download | meta-clang-42546945254f68749afa5555d3ba484681aa6499.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>
(cherry picked from commit 71321ddf78ea522b87a6b4bffefb14c988a6d921)
-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 af17925..7422608 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -140,6 +140,16 @@ set( CMAKE_CLANG_TIDY ${HOST_PREFIX}clang-tidy ) | |||
140 | EOF | 140 | EOF |
141 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake | 141 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake |
142 | } | 142 | } |
143 | |||
144 | RECIPESYSROOTFUNCS = "" | ||
145 | RECIPESYSROOTFUNCS:toolchain-clang = "recipe_sysroot_check_ld_is_lld" | ||
146 | |||
147 | recipe_sysroot_check_ld_is_lld () { | ||
148 | if "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'true', 'false', d)}"; then | ||
149 | ln -srf ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld.lld ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld | ||
150 | fi | ||
151 | } | ||
152 | do_prepare_recipe_sysroot[postfuncs] += "${RECIPESYSROOTFUNCS}" | ||
143 | # | 153 | # |
144 | # dump recipes which still use gcc | 154 | # dump recipes which still use gcc |
145 | #python __anonymous() { | 155 | #python __anonymous() { |