mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
rust: Switch to use RUST_XXX_SYS consistently
The code was using a mixture of XXX_SYS and RUST_XXX_SYS. Use RUST_XXX_SYS consistently and add the variables to the global exclsion on signatures as they're reflected in the directory triplets and trying to filter them out the hashes separately is too painful. (From OE-Core rev: ee0c0fdf9c1eba9eece6ed1293fda25bf18964b3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -32,12 +32,12 @@ MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
|
||||
|
||||
RUSTFLAGS ??= ""
|
||||
BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
|
||||
CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}"
|
||||
CARGO_BUILD_FLAGS = "-v --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}"
|
||||
|
||||
# This is based on the content of CARGO_BUILD_FLAGS and generally will need to
|
||||
# change if CARGO_BUILD_FLAGS changes.
|
||||
BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}"
|
||||
CARGO_TARGET_SUBDIR="${HOST_SYS}/${BUILD_DIR}"
|
||||
CARGO_TARGET_SUBDIR="${RUST_HOST_SYS}/${BUILD_DIR}"
|
||||
oe_cargo_build () {
|
||||
export RUSTFLAGS="${RUSTFLAGS}"
|
||||
export RUST_TARGET_PATH="${RUST_TARGET_PATH}"
|
||||
|
||||
@@ -69,15 +69,15 @@ cargo_common_do_configure () {
|
||||
cat <<- EOF >> ${CARGO_HOME}/config
|
||||
|
||||
# HOST_SYS
|
||||
[target.${HOST_SYS}]
|
||||
[target.${RUST_HOST_SYS}]
|
||||
linker = "${CARGO_RUST_TARGET_CCLD}"
|
||||
EOF
|
||||
|
||||
if [ "${HOST_SYS}" != "${BUILD_SYS}" ]; then
|
||||
if [ "${RUST_HOST_SYS}" != "${RUST_BUILD_SYS}" ]; then
|
||||
cat <<- EOF >> ${CARGO_HOME}/config
|
||||
|
||||
# BUILD_SYS
|
||||
[target.${BUILD_SYS}]
|
||||
[target.${RUST_BUILD_SYS}]
|
||||
linker = "${RUST_BUILD_CCLD}"
|
||||
EOF
|
||||
fi
|
||||
|
||||
@@ -8,7 +8,7 @@ inherit cargo python3-dir siteinfo
|
||||
export PYO3_CROSS="1"
|
||||
export PYO3_CROSS_PYTHON_VERSION="${PYTHON_BASEVERSION}"
|
||||
export PYO3_CROSS_LIB_DIR="${STAGING_LIBDIR}"
|
||||
export CARGO_BUILD_TARGET="${HOST_SYS}"
|
||||
export CARGO_BUILD_TARGET="${RUST_HOST_SYS}"
|
||||
export RUSTFLAGS
|
||||
export PYO3_PYTHON="${PYTHON}"
|
||||
export PYO3_CONFIG_FILE="${WORKDIR}/pyo3.config"
|
||||
|
||||
@@ -360,7 +360,7 @@ def rust_gen_target(d, thing, wd, arch):
|
||||
json.dump(tspec, f, indent=4)
|
||||
|
||||
# These are accounted for in tmpdir path names so don't need to be in the task sig
|
||||
rust_gen_target[vardepsexclude] += "RUST_HOST_SYS RUST_TARGET_SYS ABIEXTENSION llvm_cpu"
|
||||
rust_gen_target[vardepsexclude] += "ABIEXTENSION llvm_cpu"
|
||||
|
||||
do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ inherit rust-common
|
||||
|
||||
RUSTC = "rustc"
|
||||
|
||||
RUSTC_ARCHFLAGS += "--target=${HOST_SYS} ${RUSTFLAGS}"
|
||||
RUSTC_ARCHFLAGS += "--target=${RUST_HOST_SYS} ${RUSTFLAGS}"
|
||||
|
||||
def rust_base_dep(d):
|
||||
# Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to
|
||||
@@ -37,7 +37,7 @@ HOST_CFLAGS ?= "${CFLAGS}"
|
||||
HOST_CXXFLAGS ?= "${CXXFLAGS}"
|
||||
HOST_CPPFLAGS ?= "${CPPFLAGS}"
|
||||
|
||||
rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib"
|
||||
rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${RUST_HOST_SYS}/lib"
|
||||
# Native sysroot standard library path
|
||||
rustlib_src="${prefix}/lib/${rustlib_suffix}"
|
||||
# Host sysroot standard library path
|
||||
|
||||
Reference in New Issue
Block a user