]>
git.proxmox.com Git - rustc.git/blob - compiler/rustc_codegen_gcc/config.sh
3 export CARGO_INCREMENTAL
=0
5 if [ -f .
/gcc_path
]; then
6 export GCC_PATH
=$
(cat gcc_path
)
8 echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
13 if [[ "$unamestr" == 'Linux' ]]; then
15 elif [[ "$unamestr" == 'Darwin' ]]; then
22 HOST_TRIPLE
=$
(rustc
-vV |
grep host | cut
-d: -f2 |
tr -d " ")
23 TARGET_TRIPLE
=$HOST_TRIPLE
24 #TARGET_TRIPLE="m68k-unknown-linux-gnu"
28 if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
29 if [[ "$TARGET_TRIPLE" == "m68k-unknown-linux-gnu" ]]; then
30 TARGET_TRIPLE
="mips-unknown-linux-gnu"
31 linker
='-Clinker=m68k-linux-gcc'
32 elif [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
33 # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
34 linker
='-Clinker=aarch64-linux-gnu-gcc'
35 RUN_WRAPPER
='qemu-aarch64 -L /usr/aarch64-linux-gnu'
37 echo "Unknown non-native platform"
41 export RUSTFLAGS
="$CG_RUSTFLAGS $linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
43 # FIXME(antoyo): remove once the atomic shim is gone
44 if [[ `uname` == 'Darwin' ]]; then
45 export RUSTFLAGS
="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
48 RUSTC
="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
49 export RUSTC_LOG
=warn
# display metadata load errors
51 export LD_LIBRARY_PATH
="$(pwd)/target/out:$(pwd)/build_sysroot/sysroot/lib/rustlib/$TARGET_TRIPLE/lib:$GCC_PATH"
52 export DYLD_LIBRARY_PATH
=$LD_LIBRARY_PATH