diff --git a/bootstrap-carla.sh b/bootstrap-carla.sh index 0c7affe..c1355b3 100755 --- a/bootstrap-carla.sh +++ b/bootstrap-carla.sh @@ -66,13 +66,15 @@ function build_pyqt() { # remove flags not compatible with python export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fvisibility=hidden//')" - export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-finite-math-only//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-strict-aliasing -flto//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility=hidden//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility-inlines-hidden//')" - export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')" + export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')" + export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fno-finite-math-only//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fno-strict-aliasing -flto//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-dead_strip,-dead_strip_dylibs,-x//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-O1,--gc-sections,--no-undefined//')" diff --git a/bootstrap-python.sh b/bootstrap-python.sh index 967dcac..15611fd 100755 --- a/bootstrap-python.sh +++ b/bootstrap-python.sh @@ -153,8 +153,9 @@ function build_conf_python() { # remove flags not compatible with python export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fvisibility=hidden//')" - export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-finite-math-only//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-strict-aliasing -flto//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-dead_strip,-dead_strip_dylibs,-x//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,--gc-sections,--no-undefined//')" diff --git a/setup/env.sh b/setup/env.sh index 1a2c485..0a3dd4d 100644 --- a/setup/env.sh +++ b/setup/env.sh @@ -96,7 +96,6 @@ fi ## build flags BUILD_FLAGS="-pipe -I${PAWPAW_PREFIX}/include ${EXTRA_FLAGS}" -BUILD_FLAGS+=" -ffast-math" BUILD_FLAGS+=" -fPIC -DPIC" BUILD_FLAGS+=" -fdata-sections -ffunction-sections -fno-common -fvisibility=hidden" BUILD_FLAGS+=" -fno-stack-protector -U_FORTIFY_SOURCE -Wp,-U_FORTIFY_SOURCE" @@ -105,6 +104,12 @@ if [ "${GCC}" -eq 1 ]; then BUILD_FLAGS+=" -fno-gnu-unique" fi +if [ -z "${PAWPAW_FAST_MATH}" ] || [ "${PAWPAW_FAST_MATH}" -eq 2 ]; then + BUILD_FLAGS+=" -ffast-math" +elif [ "${PAWPAW_FAST_MATH}" -eq 1 ]; then + BUILD_FLAGS+=" -ffast-math -fno-finite-math-only" +fi + if [ -z "${PAWPAW_DEBUG}" ] || [ "${PAWPAW_DEBUG}" -eq 0 ]; then BUILD_FLAGS+=" -Os -DNDEBUG=1 -fomit-frame-pointer" else diff --git a/setup/functions.sh b/setup/functions.sh index e17895a..b5bd24d 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -483,13 +483,15 @@ function build_python() { # remove flags not compatible with python export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fvisibility=hidden//')" - export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-finite-math-only//')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fno-strict-aliasing -flto//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility=hidden//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility-inlines-hidden//')" - export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')" + export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')" + export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fno-finite-math-only//')" export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fno-strict-aliasing -flto//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-dead_strip,-dead_strip_dylibs,-x//')" export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,--gc-sections,--no-undefined//')"