Skip to content

Commit 1d97b74

Browse files
fix: opt out of lld linker to avoid segfault in openblas
1 parent c33d29d commit 1d97b74

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dev/dev

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function main() {
4848
fi
4949

5050
local test_rustflags="${HOSTCC:+-C linker=${HOSTCC}} -C link-arg=-pthread -C link-arg=-lopenblas -C link-arg=-lgfortran -C link-arg=-static-libgfortran -C link-arg=-static-libgcc -C link-arg=-static-libstdc++ ${RUSTFLAGS:-}"
51+
local build_rustflags="-C linker-features=-lld ${RUSTFLAGS:-}"
5152

5253
case "${cmd}" in
5354
"")
@@ -57,9 +58,11 @@ function main() {
5758
exit 1
5859
;;
5960
"build")
61+
declare -x RUSTFLAGS="${build_rustflags}"
6062
nicely cargo -q build ${ci_flag} --target-dir="${target_dir}" "$@"
6163
;;
6264
"build-release")
65+
declare -x RUSTFLAGS="${build_rustflags}"
6366
nicely cargo -q build --release ${ci_flag} --target-dir="${target_dir}" "$@"
6467
;;
6568
"run")
@@ -69,6 +72,7 @@ function main() {
6972
exit 1
7073
fi
7174
shift
75+
declare -x RUSTFLAGS="${build_rustflags}"
7276
nicely cargo -q run ${ci_flag} --target-dir="${target_dir}" --bin "${bin}" "$@"
7377
;;
7478
"run-release")
@@ -78,6 +82,7 @@ function main() {
7882
exit 1
7983
fi
8084
shift
85+
declare -x RUSTFLAGS="${build_rustflags}"
8186
nicely cargo -q run --release ${ci_flag} --target-dir="${target_dir}" --bin "${bin}" "$@"
8287
;;
8388
"example")
@@ -87,6 +92,7 @@ function main() {
8792
exit 1
8893
fi
8994
shift
95+
declare -x RUSTFLAGS="${build_rustflags}"
9096
nicely cargo -q run ${ci_flag} --target-dir="${target_dir}" --example "${example}" "$@"
9197
;;
9298
"example-release")
@@ -96,6 +102,7 @@ function main() {
96102
exit 1
97103
fi
98104
shift
105+
declare -x RUSTFLAGS="${build_rustflags}"
99106
nicely cargo -q run --release ${ci_flag} --target-dir="${target_dir}" --example "${example}" "$@"
100107
;;
101108
"test-all")

0 commit comments

Comments
 (0)