diff options
Diffstat (limited to 'meta/classes/rust-common.bbclass')
| -rw-r--r-- | meta/classes/rust-common.bbclass | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index f7f9cbbb2e..98d65970e8 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | inherit python3native | ||
| 2 | |||
| 1 | # Common variables used by all Rust builds | 3 | # Common variables used by all Rust builds |
| 2 | export rustlibdir = "${libdir}/rust" | 4 | export rustlibdir = "${libdir}/rust" |
| 3 | FILES:${PN} += "${rustlibdir}/*.so" | 5 | FILES:${PN} += "${rustlibdir}/*.so" |
| @@ -133,8 +135,12 @@ create_wrapper () { | |||
| 133 | shift | 135 | shift |
| 134 | 136 | ||
| 135 | cat <<- EOF > "${file}" | 137 | cat <<- EOF > "${file}" |
| 136 | #!/bin/sh | 138 | #!/usr/bin/env python3 |
| 137 | exec $@ "\$@" | 139 | import os, sys |
| 140 | orig_binary = "$@" | ||
| 141 | binary = orig_binary.split()[0] | ||
| 142 | args = orig_binary.split() + sys.argv[1:] | ||
| 143 | os.execvp(binary, args) | ||
| 138 | EOF | 144 | EOF |
| 139 | chmod +x "${file}" | 145 | chmod +x "${file}" |
| 140 | } | 146 | } |
| @@ -169,11 +175,6 @@ do_rust_create_wrappers () { | |||
| 169 | # Yocto Target / Rust Target archiver | 175 | # Yocto Target / Rust Target archiver |
| 170 | create_wrapper "${RUST_TARGET_AR}" "${WRAPPER_TARGET_AR}" | 176 | create_wrapper "${RUST_TARGET_AR}" "${WRAPPER_TARGET_AR}" |
| 171 | 177 | ||
| 172 | # Need to filter out LD_LIBRARY_PATH from the linker without using shell | ||
| 173 | mv ${RUST_BUILD_CCLD} ${RUST_BUILD_CCLD}.real | ||
| 174 | ${BUILD_CC} ${COREBASE}/meta/files/rust-ccld-wrapper.c -o ${RUST_BUILD_CCLD} | ||
| 175 | mv ${RUST_TARGET_CCLD} ${RUST_TARGET_CCLD}.real | ||
| 176 | ${BUILD_CC} ${COREBASE}/meta/files/rust-ccld-wrapper.c -o ${RUST_TARGET_CCLD} | ||
| 177 | } | 178 | } |
| 178 | 179 | ||
| 179 | addtask rust_create_wrappers before do_configure after do_patch do_prepare_recipe_sysroot | 180 | addtask rust_create_wrappers before do_configure after do_patch do_prepare_recipe_sysroot |
