@@ -68,16 +68,19 @@ rm genbindings_path_map_test_file.c
68
68
case " $ENV_TARGET " in
69
69
" x86_64" * )
70
70
export RUSTFLAGS=" $BASE_RUSTFLAGS -C target-cpu=sandybridge"
71
- export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
71
+ export BASE_HOST_CFLAGS=" $BASE_HOST_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
72
+ export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS "
72
73
;;
73
74
" aarch64_apple_darwin" )
74
75
export RUSTFLAGS=" $BASE_RUSTFLAGS -C target-cpu=apple-a14"
75
- export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -mcpu=apple-a14"
76
+ export BASE_HOST_CFLAGS=" $BASE_HOST_CFLAGS -mcpu=apple-a14"
77
+ export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS "
76
78
;;
77
79
* )
78
80
# Assume this isn't targeted at another host and build for the host's CPU.
79
81
export RUSTFLAGS=" $BASE_RUSTFLAGS -C target-cpu=native"
80
- export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -mcpu=native"
82
+ export BASE_HOST_CFLAGS=" $BASE_HOST_CFLAGS -mcpu=native"
83
+ export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS "
81
84
;;
82
85
esac
83
86
@@ -497,7 +500,7 @@ if [ "$CLANGPP" != "" ]; then
497
500
# The cc-rs crate tries to force -fdata-sections and -ffunction-sections on, which
498
501
# breaks -fembed-bitcode, so we turn off cc-rs' default flags and specify exactly
499
502
# what we want here.
500
- export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -fPIC -fembed-bitcode -march=sandybridge -mcpu=sandybridge -mtune=sandybridge "
503
+ export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -fPIC -fembed-bitcode"
501
504
export CRATE_CC_NO_DEFAULTS=true
502
505
fi
503
506
@@ -550,7 +553,7 @@ if [ "$CLANGPP" != "" -a "$LLD" != "" ]; then
550
553
fi
551
554
# If we're on an M1 don't bother building X86 binaries
552
555
if [ " $HOST_PLATFORM " != " aarch64-apple-darwin" ]; then
553
- export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -O3 -fPIC -fembed-bitcode -march=sandybridge -mcpu=sandybridge -mtune=sandybridge "
556
+ export CFLAGS_$ENV_TARGET =" $BASE_HOST_CFLAGS -O3 -fPIC -fembed-bitcode"
554
557
# Rust doesn't recognize CFLAGS changes, so we need to clean build artifacts
555
558
cargo clean --release
556
559
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS=" $RUSTFLAGS -C embed-bitcode=yes -C linker-plugin-lto -C lto -C linker=$CLANG $LINK_ARG_FLAGS -C link-arg=-march=sandybridge -C link-arg=-mcpu=sandybridge -C link-arg=-mtune=sandybridge" cargo build $CARGO_BUILD_ARGS -v --release
0 commit comments