Browse Source

Allow tweaking fast-math behaviour

Signed-off-by: falkTX <falktx@falktx.com>
test-github-breakage
falkTX 1 year ago
parent
commit
66336ddebc
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 16 additions and 6 deletions
  1. +4
    -2
      bootstrap-carla.sh
  2. +2
    -1
      bootstrap-python.sh
  3. +6
    -1
      setup/env.sh
  4. +4
    -2
      setup/functions.sh

+ 4
- 2
bootstrap-carla.sh View File

@@ -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//')"


+ 2
- 1
bootstrap-python.sh View File

@@ -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//')"


+ 6
- 1
setup/env.sh View File

@@ -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


+ 4
- 2
setup/functions.sh View File

@@ -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//')"


Loading…
Cancel
Save