From: Matt Corallo Date: Thu, 1 Feb 2024 19:28:11 +0000 (+0000) Subject: Optimize for sandy when building extra x86-64 builds X-Git-Tag: v0.0.121.2~1^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=cf97d5f47727b88684afb704eb30ff5212886c2f;p=ldk-c-bindings Optimize for sandy when building extra x86-64 builds --- diff --git a/genbindings.sh b/genbindings.sh index fd797d7..dd76e30 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -562,7 +562,14 @@ for IDX in ${!EXTRA_TARGETS[@]}; do EXTRA_ENV_TARGET=$(echo "${EXTRA_TARGETS[$IDX]}" | sed 's/-/_/g') export CFLAGS_$EXTRA_ENV_TARGET="$BASE_CFLAGS" export CC_$EXTRA_ENV_TARGET=${EXTRA_CCS[$IDX]} - RUSTFLAGS="$BASE_RUSTFLAGS -C embed-bitcode=yes -C lto -C linker=${EXTRA_CCS[$IDX]}" CARGO_PROFILE_RELEASE_LTO=true cargo build $CARGO_BUILD_ARGS -v --release --target "${EXTRA_TARGETS[$IDX]}" + EXTRA_RUSTFLAGS="" + case "$EXTRA_ENV_TARGET" in + "x86_64"*) + export CFLAGS_$EXTRA_ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mtune=sandybridge" + EXTRA_RUSTFLAGS="-C target-cpu=sandybridge" + ;; + esac + RUSTFLAGS="$BASE_RUSTFLAGS -C embed-bitcode=yes -C lto -C linker=${EXTRA_CCS[$IDX]} $EXTRA_RUSTFLAGS" CARGO_PROFILE_RELEASE_LTO=true cargo build $CARGO_BUILD_ARGS -v --release --target "${EXTRA_TARGETS[$IDX]}" done if [ "$CLANGPP" != "" -a "$LLD" != "" ]; then