2020-11-07 18:34:01 +00:00
|
|
|
# Note to people running shellcheck: this file should only be sourced, not executed directly.
|
|
|
|
|
2018-12-03 17:50:00 +00:00
|
|
|
set -e
|
|
|
|
|
2021-03-06 13:46:38 +00:00
|
|
|
dylib=$(echo "" | rustc --print file-names --crate-type dylib --crate-name rustc_codegen_cranelift -)
|
2018-12-03 17:50:00 +00:00
|
|
|
|
2020-09-30 07:15:02 +00:00
|
|
|
if echo "$RUSTC_WRAPPER" | grep sccache; then
|
|
|
|
echo
|
|
|
|
echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
|
|
|
|
echo
|
|
|
|
export RUSTC_WRAPPER=
|
|
|
|
fi
|
|
|
|
|
2020-11-04 14:59:20 +00:00
|
|
|
dir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)
|
2020-11-02 17:16:57 +00:00
|
|
|
|
2020-11-08 16:35:59 +00:00
|
|
|
export RUSTC=$dir"/bin/cg_clif"
|
2021-01-30 15:25:48 +00:00
|
|
|
|
2020-11-03 18:17:44 +00:00
|
|
|
export RUSTDOCFLAGS=$linker' -Cpanic=abort -Zpanic-abort-tests '\
|
2021-03-06 13:46:38 +00:00
|
|
|
'-Zcodegen-backend='$dir'/lib/'$dylib' --sysroot '$dir
|
2020-01-18 11:43:31 +00:00
|
|
|
|
2021-02-09 13:36:25 +00:00
|
|
|
# FIXME fix `#[linkage = "extern_weak"]` without this
|
2021-03-06 13:46:38 +00:00
|
|
|
if [[ "$(uname)" == 'Darwin' ]]; then
|
2020-01-18 11:43:31 +00:00
|
|
|
export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
|
|
|
|
fi
|
|
|
|
|
2021-01-21 14:20:48 +00:00
|
|
|
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib:"$dir"/lib"
|
2019-08-11 15:33:52 +00:00
|
|
|
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
|