1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/rustc/parse-config
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 export CARGO_HOME="$base/build/$SDECFG_ID/TOOLCHAIN/.cargo" # $toolsdir/" # "$builddir/.cargo"
15 if [ $stagelevel -gt 1 -a $pkg != rustc ]; then
17 # TODO: maybe use a rustc wrapper in the future, too
19 cflags="-mcpu= $GCC_WRAPPER_INSERT $GCC_WRAPPER_APPEND"
20 mcpu="${cflags##*-mcpu=}" ; mcpu="${mcpu%% *}"
21 if [ ! "$mcpu" ]; then
22 cflags="-march= $GCC_WRAPPER_INSERT $GCC_WRAPPER_APPEND"
23 mcpu="${cflags##*-march=}" ; mcpu="${mcpu%% *}"
26 [ "$mcpu" ] && var_append RUSTFLAGS " " "-C target-cpu=$mcpu"
32 var_append RUSTFLAGS " " "-C opt-level=0" ;;
34 var_append RUSTFLAGS " " "-C opt-level=1" ;;
36 var_append RUSTFLAGS " " "-C opt-level=z" ;;
38 var_append RUSTFLAGS " " "-C opt-level=s" ;;
40 var_append RUSTFLAGS " " "-C opt-level=3" ;;
41 *) # TODO: incl smart*
42 var_append RUSTFLAGS " " "-C opt-level=2" ;;