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