Don't assume Intel architecture for compiler optimizations on Linux/gcc.

This only adds SSE2 flags when the CPU architecture is correct for it.
Resolves #1226
This commit is contained in:
wolfbeast 2019-09-10 10:44:10 +02:00 committed by Roy Tam
commit 3686403436

View file

@ -176,8 +176,13 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi
CFLAGS="$CFLAGS -fno-math-errno -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -msse2 -mfpmath=sse"
CFLAGS="$CFLAGS -fno-math-errno"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
if test "$CPU_ARCH" = x86; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
fi
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in