diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-08-06 17:44:25 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-11 18:04:25 +0100 |
| commit | 57a4230055ae9cb86036159d0c51ae38717e40e4 (patch) | |
| tree | a14756e7f6a4479a8a848db8daf1b5d3065a0e46 | |
| parent | 5b8fc98b5762261c8d0056bdd2ae2465f1f4ce1b (diff) | |
| download | poky-57a4230055ae9cb86036159d0c51ae38717e40e4.tar.gz | |
clang-cross: Create <cross>-clang binary copy instead of symlink
With clang cleanup in [1] we ended up removing this logic, which
is still required.
This ensures that search path for subsequent tools e.g. linker
assembler are searched in the same dir where <cross>-clang is
installed. If its a symlink to ../clang then the reference
installation dir is ../ and all cross-tools are not there
so clang will fail to find assembler/linker from cross staging
area and use /usr/bin/ld or /usr/bin/as which we do not want
[1] https://git.openembedded.org/openembedded-core/commit/meta/recipes-devtools/clang/clang-cross_git.bb?id=5d96ed55acf7b9a908241222097ad809355de7cf
(From OE-Core rev: 3b0128fe6421e64674fd250e0b4e6afb1c8ce436)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/clang/clang-cross_git.bb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-devtools/clang/clang-cross_git.bb b/meta/recipes-devtools/clang/clang-cross_git.bb index 33b01e4234..2ec15dd1df 100644 --- a/meta/recipes-devtools/clang/clang-cross_git.bb +++ b/meta/recipes-devtools/clang/clang-cross_git.bb | |||
| @@ -15,7 +15,7 @@ DEPENDS = "clang-native virtual/cross-binutils ${@bb.utils.contains('DISTRO_FEAT | |||
| 15 | 15 | ||
| 16 | do_install() { | 16 | do_install() { |
| 17 | install -d ${D}${bindir} | 17 | install -d ${D}${bindir} |
| 18 | for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ | 18 | for tool in clang-tidy lld ld.lld llvm-profdata \ |
| 19 | llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ | 19 | llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ |
| 20 | llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov | 20 | llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov |
| 21 | do | 21 | do |
| @@ -23,4 +23,10 @@ do_install() { | |||
| 23 | ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool | 23 | ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool |
| 24 | fi | 24 | fi |
| 25 | done | 25 | done |
| 26 | # GNU Linker and assembler is needed in same directory as clang binaries else | ||
| 27 | # it will fallback to host linker which is not desired | ||
| 28 | install -m 0755 ${STAGING_BINDIR_NATIVE}/clang ${D}${bindir}/${TARGET_PREFIX}clang | ||
| 29 | ln -sf ${TARGET_PREFIX}clang ${D}${bindir}/${TARGET_PREFIX}clang++ | ||
| 26 | } | 30 | } |
| 31 | # clang driver being copied above is already stripped | ||
| 32 | INHIBIT_SYSROOT_STRIP = "1" | ||
