This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 33
44# Settings
55export CHANNEL=" release"
6- build_sysroot=1
6+ build_sysroot=" clif "
77target_dir=' build'
88oldbe=' '
99while [[ $# != 0 ]]; do
1010 case $1 in
1111 " --debug" )
1212 export CHANNEL=" debug"
1313 ;;
14- " --without-sysroot" )
15- build_sysroot=0
14+ " --sysroot" )
15+ build_sysroot=$2
16+ shift
1617 ;;
1718 " --target-dir" )
1819 target_dir=$2
@@ -23,7 +24,7 @@ while [[ $# != 0 ]]; do
2324 ;;
2425 * )
2526 echo " Unknown flag '$1 '"
26- echo " Usage: ./build.sh [--debug] [--without- sysroot] [--target-dir DIR] [--oldbe]"
27+ echo " Usage: ./build.sh [--debug] [--sysroot none|clif|llvm ] [--target-dir DIR] [--oldbe]"
2728 exit 1
2829 ;;
2930 esac
@@ -62,10 +63,24 @@ if [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then
6263 cp $( rustc --print sysroot) /lib/rustlib/$TARGET_TRIPLE /lib/* .o " $target_dir /lib/rustlib/$TARGET_TRIPLE /lib/"
6364fi
6465
65- if [[ " $build_sysroot " == " 1" ]]; then
66- echo " [BUILD] sysroot"
67- dir=$( pwd)
68- cd " $target_dir "
69- time " $dir /build_sysroot/build_sysroot.sh"
70- cp lib/rustlib/* /lib/libstd-* lib/
71- fi
66+ case " $build_sysroot " in
67+ " none" )
68+ ;;
69+ " llvm" )
70+ cp -r $( rustc --print sysroot) /lib/rustlib/$TARGET_TRIPLE /lib " $target_dir /lib/rustlib/$TARGET_TRIPLE /"
71+ ;;
72+ " clif" )
73+ echo " [BUILD] sysroot"
74+ dir=$( pwd)
75+ cd " $target_dir "
76+ time " $dir /build_sysroot/build_sysroot.sh"
77+ cp lib/rustlib/* /lib/libstd-* lib/
78+ ;;
79+ * )
80+ echo " Unknown sysroot kind \` $build_sysroot \` ."
81+ echo " The allowed values are:"
82+ echo " none A sysroot that doesn't contain the standard library"
83+ echo " llvm Copy the sysroot from rustc compiled by cg_llvm"
84+ echo " clif Build a new sysroot using cg_clif"
85+ exit 1
86+ esac
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- ./build.sh --without- sysroot " $@ "
4+ ./build.sh --sysroot none " $@ "
55
66rm -r target/out || true
77
You can’t perform that action at this time.
0 commit comments