From 5adf5fde271d208e077b84624d42491eaae8b83c Mon Sep 17 00:00:00 2001 From: Fedor Date: Tue, 12 Nov 2019 08:37:13 +0300 Subject: [PATCH] Don't assume Intel architecture for compiler optimizations on Linux/gcc. --- build/autoconf/compiler-opts.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index 82d0b43fc..0848d78d9 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -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