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-26 08:19:30 -0700 |
commit | 71321ddf78ea522b87a6b4bffefb14c988a6d921 (patch) | |
tree | 8a74ee019297449fb2031a81b9fc140d87cfeddc /classes | |
parent | b9df71259272cc4e3078e92614720756ccb05845 (diff) | |
download | meta-clang-71321ddf78ea522b87a6b4bffefb14c988a6d921.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 8433edc..88afc14 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -137,6 +137,16 @@ set( CMAKE_CLANG_TIDY ${HOST_PREFIX}clang-tidy ) | |||
137 | EOF | 137 | EOF |
138 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake | 138 | sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake |
139 | } | 139 | } |
140 | |||
141 | RECIPESYSROOTFUNCS = "" | ||
142 | RECIPESYSROOTFUNCS:toolchain-clang = "recipe_sysroot_check_ld_is_lld" | ||
143 | |||
144 | recipe_sysroot_check_ld_is_lld () { | ||
145 | if "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'true', 'false', d)}"; then | ||
146 | ln -srf ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld.lld ${RECIPE_SYSROOT_NATIVE}${bindir}/${TARGET_SYS}/${TARGET_PREFIX}ld | ||
147 | fi | ||
148 | } | ||
149 | do_prepare_recipe_sysroot[postfuncs] += "${RECIPESYSROOTFUNCS}" | ||
140 | # | 150 | # |
141 | # dump recipes which still use gcc | 151 | # dump recipes which still use gcc |
142 | #python __anonymous() { | 152 | #python __anonymous() { |