projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
db00d15
)
Only set -mcpu=sandybridge on x86_64
author
Matt Corallo
<git@bluematt.me>
Fri, 11 Jun 2021 17:41:49 +0000
(17:41 +0000)
committer
Matt Corallo
<git@bluematt.me>
Fri, 11 Jun 2021 17:47:28 +0000
(17:47 +0000)
genbindings.sh
patch
|
blob
|
history
diff --git
a/genbindings.sh
b/genbindings.sh
index b5cbca366dace820b8dffcdfcdf8fcd748938d42..0e426022ca334c03420239475f31fbb6bb07193f 100755
(executable)
--- a/
genbindings.sh
+++ b/
genbindings.sh
@@
-147,7
+147,17
@@
clang -o /dev/null -ffile-prefix-map=$HOME/.cargo= genbindings_path_map_test_fil
# Now that we've done our last non-LTO build, turn on LTO in CFLAGS as well
export BASE_CFLAGS="-ffile-prefix-map=$HOME/.cargo= -frandom-seed=42"
ENV_TARGET=$(rustc --version --verbose | grep host | awk '{ print $2 }' | sed 's/-/_/g')
# Now that we've done our last non-LTO build, turn on LTO in CFLAGS as well
export BASE_CFLAGS="-ffile-prefix-map=$HOME/.cargo= -frandom-seed=42"
ENV_TARGET=$(rustc --version --verbose | grep host | awk '{ print $2 }' | sed 's/-/_/g')
-export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
+case "$ENV_TARGET" in
+ "x86_64"*)
+ export RUSTFLAGS="$RUSTFLAGS -C target-cpu=sandybridge"
+ export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
+ ;;
+ *)
+ # Assume this isn't targeted at another host and build for the host's CPU.
+ export RUSTFLAGS="$RUSTFLAGS -C target-cpu=native"
+ export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -mcpu=native"
+ ;;
+esac
rm genbindings_path_map_test_file.c
cargo build
rm genbindings_path_map_test_file.c
cargo build