summaryrefslogtreecommitdiff
blob: 18563055f44bd0b0eb233747cbd3f200d395b0db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 16d4258863c936538ef3b7ff13a95f7567a62044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tomas.chvatal@gmail.com>
Date: Mon, 1 Aug 2011 17:41:29 +0200
Subject: [PATCH] Fix segmentation fault when linking -mavx on new CPUs is enabled by explicitly adding -mno-avx to CXXFLAGS.

---
 .../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..609e09a 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.
+.IF "$(HAVE_GCC_AVX)" == "TRUE"
+    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..e519105 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.
+.IF "$(HAVE_GCC_AVX)" == "TRUE"
+    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..d2b0809 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.
+.IF "$(HAVE_GCC_AVX)" == "TRUE"
+    CFLAGSCXX+= -mno-avx
+.ENDIF
+
 NOOPTFILES= \
     $(SLO)$/uno2cpp.obj
 
-- 
1.7.3.4