[PATCH] Fix segmentation fault when linking -mavx on new CPUs is enabled by explicitly adding -mno-avx to CXXFLAGS.

Tomáš Chvátal tomas.chvatal at gmail.com
Mon Aug 1 08:41:29 PDT 2011


Signed-off-by: Tomáš Chvátal <tomas.chvatal at gmail.com>
---
 .../source/cpp_uno/gcc3_linux_intel/makefile.mk    |    6 ++++++
 .../source/cpp_uno/gcc3_linux_x86-64/makefile.mk   |    6 ++++++
 bridges/source/cpp_uno/mingw_intel/makefile.mk     |    6 ++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
index beedf9d..d0acc23 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
@@ -52,6 +52,12 @@ CFLAGS += -DLEAK_STATIC_DATA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer -fno-strict-aliasing
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 CFLAGSNOOPT=-O0
 
 SLOFILES= \
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
index dd35432..ee934e0 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
@@ -52,6 +52,12 @@ CFLAGS += -DLEAK_STATIC_DATA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer -fno-strict-aliasing
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 SLOFILES= \
     $(SLO)$/abi.obj			\
     $(SLO)$/except.obj		\
diff --git a/bridges/source/cpp_uno/mingw_intel/makefile.mk b/bridges/source/cpp_uno/mingw_intel/makefile.mk
index 2c7a8da..189cb15 100644
--- a/bridges/source/cpp_uno/mingw_intel/makefile.mk
+++ b/bridges/source/cpp_uno/mingw_intel/makefile.mk
@@ -51,6 +51,12 @@ CFLAGS += -DBROKEN_ALLOCA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 NOOPTFILES= \
     $(SLO)$/uno2cpp.obj
 
-- 
1.7.3.4


--------------090305030809010405060409--


More information about the LibreOffice mailing list