summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/clang/llvm_git.bb2
-rw-r--r--meta/recipes-devtools/rust/rust_1.90.0.bb39
2 files changed, 36 insertions, 5 deletions
diff --git a/meta/recipes-devtools/clang/llvm_git.bb b/meta/recipes-devtools/clang/llvm_git.bb
index d2b060ff88..2f47af8d7a 100644
--- a/meta/recipes-devtools/clang/llvm_git.bb
+++ b/meta/recipes-devtools/clang/llvm_git.bb
@@ -27,7 +27,6 @@ OECMAKE_SOURCEPATH = "${S}/llvm"
27# https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt 27# https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt
28LLVM_TARGETS_GPU ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'opencl opengl vulkan', 'AMDGPU;NVPTX;SPIRV', '', d)}" 28LLVM_TARGETS_GPU ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'opencl opengl vulkan', 'AMDGPU;NVPTX;SPIRV', '', d)}"
29LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;${LLVM_TARGETS_GPU}" 29LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;${LLVM_TARGETS_GPU}"
30LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};BPF;${LLVM_TARGETS_GPU}"
31 30
32LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" 31LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= ""
33 32
@@ -37,6 +36,7 @@ HF[vardepvalue] = "${HF}"
37 36
38EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=MinSizeRel \ 37EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=MinSizeRel \
39 -DLLVM_ENABLE_BINDINGS=OFF \ 38 -DLLVM_ENABLE_BINDINGS=OFF \
39 -DLLVM_INSTALL_UTILS=ON \
40 -DLLVM_ENABLE_FFI=ON \ 40 -DLLVM_ENABLE_FFI=ON \
41 -DLLVM_ENABLE_RTTI=ON \ 41 -DLLVM_ENABLE_RTTI=ON \
42 -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ 42 -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb
index 5d804c7398..0319d73b93 100644
--- a/meta/recipes-devtools/rust/rust_1.90.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.90.0.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc"
7inherit rust 7inherit rust
8inherit cargo_common 8inherit cargo_common
9 9
10DEPENDS += "rust-llvm" 10DEPENDS += "llvm"
11# native rust uses cargo/rustc from binary snapshots to bootstrap 11# native rust uses cargo/rustc from binary snapshots to bootstrap
12# but everything else should use our native builds 12# but everything else should use our native builds
13DEPENDS:append:class-target = " cargo-native rust-native" 13DEPENDS:append:class-target = " cargo-native rust-native"
@@ -28,8 +28,8 @@ PV .= "${@bb.utils.contains('RUST_CHANNEL', 'stable', '', '-${RUST_CHANNEL}', d)
28 28
29export FORCE_CRATE_HASH = "${BB_TASKHASH}" 29export FORCE_CRATE_HASH = "${BB_TASKHASH}"
30 30
31RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" 31RUST_ALTERNATE_EXE_PATH ?= "${STAGING_BINDIR}/llvm-config"
32RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" 32RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_BINDIR_NATIVE}/llvm-config"
33 33
34# We don't want to use bitbakes vendoring because the rust sources do their 34# We don't want to use bitbakes vendoring because the rust sources do their
35# own vendoring. 35# own vendoring.
@@ -188,6 +188,37 @@ python do_configure() {
188 bb.build.exec_func("setup_cargo_environment", d) 188 bb.build.exec_func("setup_cargo_environment", d)
189} 189}
190 190
191# llvm-config expects static libraries to be in the 'lib' directory rather than 'lib64' when
192# multilibs enabled. Since we are copying the natively built llvm-config into the target sysroot
193# and executing it there, it will default to searching in 'lib', as it is unaware of the 'lib64'
194# directory. To ensure llvm-config can locate the necessary libraries, create a symlink from 'lib'
195do_compile:append:class-target() {
196 # Ensure llvm-config can find static libraries in multilib setup
197 lib64_dir="${STAGING_DIR_TARGET}/usr/lib64"
198 lib_dir="${STAGING_DIR_TARGET}/usr/lib"
199
200 if [ -d "$lib64_dir" ]; then
201 # If lib does not exist, symlink it to lib64
202 if [ ! -e "$lib_dir" ]; then
203 ln -s lib64 "$lib_dir"
204 fi
205
206 # Only do per-file symlinking if lib is a real directory (not symlink)
207 if [ -d "$lib_dir" ] && [ ! -L "$lib_dir" ]; then
208 for lib64_file in "${lib64_dir}"/libLLVM*.a; do
209 if [ -e "$lib64_file" ]; then
210 lib_name=$(basename "${lib64_file}")
211 target_link="${lib_dir}/${lib_name}"
212
213 if [ ! -e "${target_link}" ]; then
214 ln -s "../lib64/${lib_name}" "${target_link}"
215 fi
216 fi
217 done
218 fi
219 fi
220}
221
191rust_runx () { 222rust_runx () {
192 echo "COMPILE ${PN}" "$@" 223 echo "COMPILE ${PN}" "$@"
193 224
@@ -199,7 +230,7 @@ rust_runx () {
199 unset CXXFLAGS 230 unset CXXFLAGS
200 unset CPPFLAGS 231 unset CPPFLAGS
201 232
202 export RUSTFLAGS="${RUST_DEBUG_REMAP}" 233 export RUSTFLAGS="${RUST_DEBUG_REMAP} -Clink-arg=-lz -Clink-arg=-lzstd"
203 234
204 # Copy the natively built llvm-config into the target so we can run it. Horrible, 235 # Copy the natively built llvm-config into the target so we can run it. Horrible,
205 # but works! 236 # but works!