wai-quantum-cli release: link the Linux binaries static, not static-pie #375
1 changed files with 6 additions and 1 deletions
|
|
@ -121,7 +121,12 @@ jobs:
|
|||
t="${{ matrix.triple }}"
|
||||
T="$(echo "$t" | tr 'a-z-' 'A-Z_')"
|
||||
export "CC_${t//-/_}=musl-gcc" "CARGO_TARGET_${T}_LINKER=musl-gcc"
|
||||
cargo build --locked --release --target "$t"
|
||||
# Static, not static-pie: rustc asks the linker for -static-pie on musl,
|
||||
# which this musl-gcc's specs do not take (it links a dynamic PIE against
|
||||
# ld-musl instead); without position-independent code it asks for
|
||||
# -static, which they do. RUSTFLAGS reach the target only, since
|
||||
# --target is given, so build scripts build for the host as before.
|
||||
RUSTFLAGS="-C target-feature=+crt-static -C relocation-model=static" cargo build --locked --release --target "$t"
|
||||
bin="target/$t/release/wai-quantum"
|
||||
if command -v file >/dev/null 2>&1; then
|
||||
file "$bin" | grep -q -E 'statically linked|static-pie linked' || { echo "::error::$bin is not static"; file "$bin"; exit 1; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue