From 0e0e2c16401e63777dce8c7958a3ca789055dfcf Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 20 Oct 2023 12:17:09 +0200 Subject: [PATCH] Use -O3 instead of -Ofast in dist-build scripts as well --- dist-build/apple-xcframework.sh | 42 ++++++++++++++++----------------- dist-build/macos.sh | 2 +- dist-build/msys2-win32.sh | 2 +- dist-build/msys2-win64.sh | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dist-build/apple-xcframework.sh b/dist-build/apple-xcframework.sh index bf1754e2..782e77f7 100755 --- a/dist-build/apple-xcframework.sh +++ b/dist-build/apple-xcframework.sh @@ -71,7 +71,7 @@ build_macos() { ## macOS arm64 if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" export LDFLAGS="-arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -81,7 +81,7 @@ build_macos() { fi ## macOS x86_64 - export CFLAGS="-Ofast -arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" export LDFLAGS="-arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -96,7 +96,7 @@ build_ios() { export SDK="${BASEDIR}/SDKs/iPhoneOS.sdk" ## 32-bit iOS - export CFLAGS="-Ofast -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" export LDFLAGS="-mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -105,7 +105,7 @@ build_ios() { make -j${PROCESSORS} install || exit 1 ## 32-bit armv7s iOS - export CFLAGS="-Ofast -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" export LDFLAGS="-mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -114,7 +114,7 @@ build_ios() { make -j${PROCESSORS} install || exit 1 ## 64-bit iOS - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -130,7 +130,7 @@ build_ios_simulator() { ## arm64 simulator if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -140,7 +140,7 @@ build_ios_simulator() { fi ## i386 simulator - export CFLAGS="-Ofast -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -149,7 +149,7 @@ build_ios_simulator() { make -j${PROCESSORS} install || exit 1 ## x86_64 simulator - export CFLAGS="-Ofast -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -164,7 +164,7 @@ build_watchos() { export SDK="${BASEDIR}/SDKs/WatchOS.sdk" # 32-bit watchOS - export CFLAGS="-Ofast -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" export LDFLAGS="-mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -173,7 +173,7 @@ build_watchos() { make -j${PROCESSORS} install || exit 1 ## 64-bit arm64_32 watchOS - export CFLAGS="-Ofast -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" export LDFLAGS="-mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -182,7 +182,7 @@ build_watchos() { make -j${PROCESSORS} install || exit 1 ## 64-bit arm64 watchOS - export CFLAGS="-Ofast -mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" export LDFLAGS="-mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -198,7 +198,7 @@ build_watchos_simulator() { ## arm64 simulator if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -208,7 +208,7 @@ build_watchos_simulator() { fi ## i386 simulator - export CFLAGS="-Ofast -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -217,7 +217,7 @@ build_watchos_simulator() { make -j${PROCESSORS} install || exit 1 ## x86_64 simulator - export CFLAGS="-Ofast -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -232,7 +232,7 @@ build_tvos() { export SDK="${BASEDIR}/SDKs/AppleTVOS.sdk" ## 64-bit tvOS - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -248,7 +248,7 @@ build_tvos_simulator() { ## arm64 simulator if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -258,7 +258,7 @@ build_tvos_simulator() { fi ## x86_64 simulator - export CFLAGS="-Ofast -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 @@ -272,7 +272,7 @@ build_visionos() { export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" export SDK="${BASEDIR}/SDKs/XROS.sdk" - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK}" export LDFLAGS="-arch arm64 -isysroot ${SDK}" make distclean >/dev/null 2>&1 @@ -287,7 +287,7 @@ build_visionos_simulator() { export SDK="${BASEDIR}/SDKs/XRSimulator.sdk" if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -isysroot ${SDK}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK}" export LDFLAGS="-arch arm64 -isysroot ${SDK}" make distclean >/dev/null 2>&1 @@ -304,7 +304,7 @@ build_catalyst() { ## arm64 catalyst if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-Ofast -arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}" + export CFLAGS="-O3 -arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}" export LDFLAGS="-arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}" make distclean >/dev/null 2>&1 @@ -314,7 +314,7 @@ build_catalyst() { fi ## x86_64 catalyst - export CFLAGS="-Ofast -arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}" + export CFLAGS="-O3 -arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}" export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}" make distclean >/dev/null 2>&1 diff --git a/dist-build/macos.sh b/dist-build/macos.sh index fed7f394..2d2e0302 100755 --- a/dist-build/macos.sh +++ b/dist-build/macos.sh @@ -14,7 +14,7 @@ PROCESSORS=${NPROCESSORS:-3} mkdir -p $PREFIX || exit 1 -export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -Ofast" +export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -O3" export LDFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN}" make distclean >/dev/null diff --git a/dist-build/msys2-win32.sh b/dist-build/msys2-win32.sh index 6e801404..6217bcc0 100755 --- a/dist-build/msys2-win32.sh +++ b/dist-build/msys2-win32.sh @@ -1,6 +1,6 @@ #! /bin/sh -export CFLAGS="-Ofast -fomit-frame-pointer -m32 -march=pentium3 -mtune=westmere" +export CFLAGS="-O3 -fomit-frame-pointer -m32 -march=pentium3 -mtune=westmere" export PREFIX="$(pwd)/libsodium-win32" if (i686-w64-mingw32-gcc --version >/dev/null 2>&1); then diff --git a/dist-build/msys2-win64.sh b/dist-build/msys2-win64.sh index ef69047d..24b3072a 100755 --- a/dist-build/msys2-win64.sh +++ b/dist-build/msys2-win64.sh @@ -1,6 +1,6 @@ #! /bin/sh -export CFLAGS="-Ofast -fomit-frame-pointer -m64 -mtune=westmere" +export CFLAGS="-O3 -fomit-frame-pointer -m64 -mtune=westmere" export PREFIX="$(pwd)/libsodium-win64" if (x86_64-w64-mingw32-gcc --version >/dev/null 2>&1); then