Skip to content

Commit

Permalink
chore(ci): use rustflags instead of rustc wrappers (#5559)
Browse files Browse the repository at this point in the history
* ci: use rustflags instead of rustc wrappers

Signed-off-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>

* remove the wrapper scripts

Signed-off-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
  • Loading branch information
japaric authored Dec 16, 2020
1 parent 82fc762 commit c7da80a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 154 deletions.
20 changes: 10 additions & 10 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ rustflags = ["-C", "link-args=-rdynamic"]
[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-rdynamic"]


[target.'cfg(target_env = "musl")']
# Because the `cross` Docker container sets `CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER`, the
# `linker` key does not work in this file, so we use `rustflags` instead.
# NOTE: This means that any custom `RUSTFLAGS` variable must include this value!
rustflags = "-Clinker=scripts/cross/wrappers/linker.sh"
# Turn off self-contained linking mode. This makes rustc rely on the installed musl toolchain to
# find and link against C and C++ runtime objects, instead of linking against the bundled C ones.
rustflags = "-Clink-self-contained=no"

# x86_64-specific libstdc++ search path. When building for musl, Cargo will merge this with the
# `rustflags` key above.
# for these musl targets libstdc++ will be linked statically (that's configured in e.g. leveldb-sys)
# we provide the location of that library here
[target.x86_64-unknown-linux-musl]
rustflags = "-Lnative=/usr/local/x86_64-linux-musl/lib"

[target.i686-unknown-linux-musl]
rustflags = "-Lnative=/usr/local/i686-linux-musl/lib"

[target.aarch64-unknown-linux-musl]
# Deliberately empty.
# See `scripts/cross/wrappers/{linker,rustc}.sh`.
# Basically, we need to carefully edit the ordering of links.
# Rust doesn't let us have great control of that here, so for now we use those wrappers.
rustflags = "-Lnative=/usr/local/aarch64-linux-musl/lib"
2 changes: 0 additions & 2 deletions scripts/cross/aarch64-unknown-linux-musl.dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
FROM rustembedded/cross:aarch64-unknown-linux-musl

ENV RUSTC="scripts/cross/wrappers/musl_rustc.sh"
2 changes: 0 additions & 2 deletions scripts/cross/armv7-unknown-linux-musleabihf.dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
FROM rustembedded/cross:armv7-unknown-linux-musleabihf

ENV RUSTC="scripts/cross/wrappers/armv7_rustc.sh"
45 changes: 0 additions & 45 deletions scripts/cross/wrappers/armv7_rustc.sh

This file was deleted.

48 changes: 0 additions & 48 deletions scripts/cross/wrappers/linker.sh

This file was deleted.

45 changes: 0 additions & 45 deletions scripts/cross/wrappers/musl_rustc.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/cross/x86_64-unknown-linux-musl.dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
FROM rustembedded/cross:x86_64-unknown-linux-musl

ENV RUSTC="scripts/cross/wrappers/musl_rustc.sh"

0 comments on commit c7da80a

Please sign in to comment.