diff options
Diffstat (limited to 'meta/recipes-devtools/rust/rust.inc')
| -rw-r--r-- | meta/recipes-devtools/rust/rust.inc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 30f2b71fe8..47b76e725d 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc | |||
| @@ -18,7 +18,8 @@ export RUST_TARGET_PATH="${WORKDIR}/targets/" | |||
| 18 | export FORCE_CRATE_HASH="${BB_TASKHASH}" | 18 | export FORCE_CRATE_HASH="${BB_TASKHASH}" |
| 19 | 19 | ||
| 20 | RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" | 20 | RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" |
| 21 | export YOCTO_ALTERNATE_EXE_PATH = "${RUST_ALTERNATE_EXE_PATH}" | 21 | RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" |
| 22 | |||
| 22 | export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}" | 23 | export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}" |
| 23 | 24 | ||
| 24 | # We don't want to use bitbakes vendoring because the rust sources do their | 25 | # We don't want to use bitbakes vendoring because the rust sources do their |
| @@ -82,8 +83,9 @@ python do_configure() { | |||
| 82 | host_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) | 83 | host_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) |
| 83 | config.add_section(host_section) | 84 | config.add_section(host_section) |
| 84 | 85 | ||
| 85 | llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") | 86 | llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") |
| 86 | config.set(host_section, "llvm-config", e(llvm_config)) | 87 | llvm_config_build = d.expand("${RUST_ALTERNATE_EXE_PATH_NATIVE}") |
| 88 | config.set(host_section, "llvm-config", e(llvm_config_target)) | ||
| 87 | 89 | ||
| 88 | config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) | 90 | config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) |
| 89 | config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) | 91 | config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) |
| @@ -93,7 +95,7 @@ python do_configure() { | |||
| 93 | build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) | 95 | build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) |
| 94 | config.add_section(build_section) | 96 | config.add_section(build_section) |
| 95 | 97 | ||
| 96 | config.set(build_section, "llvm-config", e(llvm_config)) | 98 | config.set(build_section, "llvm-config", e(llvm_config_build)) |
| 97 | 99 | ||
| 98 | config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) | 100 | config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) |
| 99 | config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) | 101 | config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) |
| @@ -169,6 +171,14 @@ rust_runx () { | |||
| 169 | unset CXXFLAGS | 171 | unset CXXFLAGS |
| 170 | unset CPPFLAGS | 172 | unset CPPFLAGS |
| 171 | 173 | ||
| 174 | # Copy the natively built llvm-config into the target so we can run it. Horrible, | ||
| 175 | # but works! | ||
| 176 | if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; then | ||
| 177 | mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` | ||
| 178 | cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} | ||
| 179 | chrpath -d ${RUST_ALTERNATE_EXE_PATH} | ||
| 180 | fi | ||
| 181 | |||
| 172 | oe_cargo_fix_env | 182 | oe_cargo_fix_env |
| 173 | 183 | ||
| 174 | python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose | 184 | python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose |
