about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-09-29 23:52:59 +0200
committerGitHub <noreply@github.com>2020-09-29 23:52:59 +0200
commit0c065f95609e28cd3f2ddddccb06bf01705699cb (patch)
treeb1c384ce7005780ef57917d5251d886046c2e876 /scripts
parentc046ad017f022b7e0308ab3665044860cb6412d5 (diff)
parent9a513be11a2a828cffeb6f5a76f6ad528e2d3626 (diff)
downloadrust-0c065f95609e28cd3f2ddddccb06bf01705699cb.tar.gz
rust-0c065f95609e28cd3f2ddddccb06bf01705699cb.zip
Merge pull request #1089 from bjorn3/custom_driver
Add custom rustc driver that uses cg_clif
Diffstat (limited to 'scripts')
-rw-r--r--scripts/config.sh9
-rwxr-xr-xscripts/filter_profile.rs2
2 files changed, 7 insertions, 4 deletions
diff --git a/scripts/config.sh b/scripts/config.sh
index 728667ec367..acd048893e9 100644
--- a/scripts/config.sh
+++ b/scripts/config.sh
@@ -32,15 +32,18 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
    fi
 fi
 
-export RUSTFLAGS=$linker' -Ztrim-diagnostic-paths=no -Cpanic=abort -Cdebuginfo=2 -Zpanic-abort-tests -Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
-export RUSTDOCFLAGS=$RUSTFLAGS
+export RUSTC=$(pwd)/"target/"$CHANNEL"/cg_clif"
+export RUSTFLAGS=$linker
+export RUSTDOCFLAGS=$linker' -Ztrim-diagnostic-paths=no -Cpanic=abort -Zpanic-abort-tests '\
+'-Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
 
 # FIXME remove once the atomic shim is gone
 if [[ `uname` == 'Darwin' ]]; then
    export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
 fi
 
-export LD_LIBRARY_PATH="$(pwd)/target/out:$(pwd)/build_sysroot/sysroot/lib/rustlib/$TARGET_TRIPLE/lib"
+export LD_LIBRARY_PATH="$(pwd)/target/out:$(pwd)/build_sysroot/sysroot/lib/rustlib/"$TARGET_TRIPLE"/lib:\
+$(pwd)/target/"$CHANNEL":$(rustc --print sysroot)/lib"
 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
 
 export CG_CLIF_DISPLAY_CG_TIME=1
diff --git a/scripts/filter_profile.rs b/scripts/filter_profile.rs
index 75f2f61b21a..c70c3ec47f3 100755
--- a/scripts/filter_profile.rs
+++ b/scripts/filter_profile.rs
@@ -5,7 +5,7 @@ CHANNEL="release"
 pushd $(dirname "$0")/../
 source scripts/config.sh
 popd
-CG_CLIF_JIT=1 PROFILE=$1 OUTPUT=$2 exec rustc $RUSTFLAGS $0 --crate-type bin -Cprefer-dynamic
+PROFILE=$1 OUTPUT=$2 exec $RUSTC $RUSTFLAGS --jit $0
 #*/
 
 //! This program filters away uninteresting samples and trims uninteresting frames for stackcollapse