Make it possible to build with TCLIBC="musl" (musl as libc)

This commit is contained in:
Johan Anderholm
2018-07-04 19:27:10 +02:00
parent e1fa6d39ce
commit 6a0d148968
3 changed files with 22 additions and 18 deletions

View File

@@ -1,10 +1,11 @@
CARGO_SNAPSHOT = "cargo-0.26.0-${RUST_BUILD_SYS}"
SRC_URI[cargo-snapshot.md5sum] = "b0de62d86f0ba71078471d09916873c6"
SRC_URI[cargo-snapshot.sha256sum] = "9ba227f2364f618dc9415dacf3a5dce17458e1cb9f6d4fe860416cb68db894e4"
# TODO: Add hashes for other architecture toolchains as well. Make a script?
SRC_URI[cargo-snapshot-x86_64.md5sum] = "b0de62d86f0ba71078471d09916873c6"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "9ba227f2364f618dc9415dacf3a5dce17458e1cb9f6d4fe860416cb68db894e4"
SRC_URI += "\
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH} \
"
# When building cargo-native we don't have a built cargo to use so we must use

View File

@@ -6,21 +6,21 @@
## earlier SRC_URI.
RS_VERSION = "1.25.0"
RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${RUST_BUILD_SYS}"
RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_SYS}"
RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
CARGO_VERSION = "0.26.0"
CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${RUST_BUILD_SYS}"
CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
SRC_URI += " \
https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot;subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot;subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot;subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
"
# These are x86_64-unknown-linux-gnu hashes, how can we add more?
SRC_URI[rustc-snapshot.md5sum] = "6e9c8ae2946cf6626ad6511c7a1d6c2a"
SRC_URI[rustc-snapshot.sha256sum] = "f8f4ae2f4b76416bfa90758267df4280dd078235dfba92dac0431595493443be"
SRC_URI[rust-std-snapshot.md5sum] = "37e9f9193413caba47134af3306328c5"
SRC_URI[rust-std-snapshot.sha256sum] = "a3258308e3a9fe364d63b5d782efb285ab410bdfc01d168c119122ddbc9a02e2"
SRC_URI[cargo-snapshot.md5sum] = "b0de62d86f0ba71078471d09916873c6"
SRC_URI[cargo-snapshot.sha256sum] = "9ba227f2364f618dc9415dacf3a5dce17458e1cb9f6d4fe860416cb68db894e4"
# TODO: Add hashes for other architecture toolchains as well. Make a script?
SRC_URI[rustc-snapshot-x86_64.md5sum] = "6e9c8ae2946cf6626ad6511c7a1d6c2a"
SRC_URI[rustc-snapshot-x86_64.sha256sum] = "f8f4ae2f4b76416bfa90758267df4280dd078235dfba92dac0431595493443be"
SRC_URI[rust-std-snapshot-x86_64.md5sum] = "37e9f9193413caba47134af3306328c5"
SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "a3258308e3a9fe364d63b5d782efb285ab410bdfc01d168c119122ddbc9a02e2"
SRC_URI[cargo-snapshot-x86_64.md5sum] = "b0de62d86f0ba71078471d09916873c6"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "9ba227f2364f618dc9415dacf3a5dce17458e1cb9f6d4fe860416cb68db894e4"

View File

@@ -13,6 +13,9 @@ export RUST_TARGET_PATH="${WORKDIR}/targets/"
export FORCE_CRATE_HASH="${BB_TASKHASH}"
# We can't use RUST_BUILD_SYS here because that may be "musl" if
# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu"
setup_cargo_environment () {
# The first step is to build bootstrap and some early stage tools,
# these are build for the same target as the snapshot, e.g.
@@ -20,8 +23,8 @@ setup_cargo_environment () {
# Later stages are build for the native target (i.e. target.x86_64-linux)
cargo_common_do_configure
echo "[target.${RUST_BUILD_SYS}]" >> ${CARGO_HOME}/config
echo "linker = '${RUST_TARGET_CCLD}'" >> ${CARGO_HOME}/config
printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config
printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config
}
# Right now this is focused on arm-specific tune features.