- LOCAL_CFLAGS="$LOCAL_CFLAGS -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9"
- BASE_HOST_CFLAGS="$BASE_HOST_CFLAGS -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9"
+ LOCAL_CFLAGS="$LOCAL_CFLAGS --target=$HOST_PLATFORM -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9"
+ BASE_HOST_CFLAGS="$BASE_HOST_CFLAGS --target=$HOST_PLATFORM -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9"
# Targeting aarch64 appears to be supported only starting with Big Sur, so check it before use
clang -o /dev/null $BASE_HOST_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14 genbindings_path_map_test_file.c &&
export CFLAGS_aarch64_apple_darwin="$BASE_HOST_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14" ||
# Targeting aarch64 appears to be supported only starting with Big Sur, so check it before use
clang -o /dev/null $BASE_HOST_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14 genbindings_path_map_test_file.c &&
export CFLAGS_aarch64_apple_darwin="$BASE_HOST_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14" ||
case "$ENV_TARGET" in
"x86_64"*)
export RUSTFLAGS="$BASE_RUSTFLAGS -C target-cpu=sandybridge"
export CFLAGS_$ENV_TARGET="$BASE_HOST_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
;;
case "$ENV_TARGET" in
"x86_64"*)
export RUSTFLAGS="$BASE_RUSTFLAGS -C target-cpu=sandybridge"
export CFLAGS_$ENV_TARGET="$BASE_HOST_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
;;
*)
# Assume this isn't targeted at another host and build for the host's CPU.
export RUSTFLAGS="$BASE_RUSTFLAGS -C target-cpu=native"
*)
# Assume this isn't targeted at another host and build for the host's CPU.
export RUSTFLAGS="$BASE_RUSTFLAGS -C target-cpu=native"
if cargo +nightly --version >/dev/null 2>&1; then
LLVM_V=$(rustc +nightly --version --verbose | grep "LLVM version" | awk '{ print substr($3, 0, 2); }')
if [ -x "$(which clang-$LLVM_V)" ]; then
if cargo +nightly --version >/dev/null 2>&1; then
LLVM_V=$(rustc +nightly --version --verbose | grep "LLVM version" | awk '{ print substr($3, 0, 2); }')
if [ -x "$(which clang-$LLVM_V)" ]; then
fi
# Finally, if we're on OSX or on Linux, build the final debug binary with address sanitizer (and leave it there)
fi
# Finally, if we're on OSX or on Linux, build the final debug binary with address sanitizer (and leave it there)
if [ "$CLANGPP" != "" ]; then
if [ "$HOST_OSX" = "true" ]; then
# OSX sed is for some reason not compatible with GNU sed
if [ "$CLANGPP" != "" ]; then
if [ "$HOST_OSX" = "true" ]; then
# OSX sed is for some reason not compatible with GNU sed