summaryrefslogtreecommitdiff
blob: e43373915a8bfd5bd915f63864f4bdf5e87038d5 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Index: configure.in
===================================================================
RCS file: /cvsroot/mozilla/configure.in,v
retrieving revision 1.1056
diff -u -r1.1056 configure.in
--- configure.in	2 Jul 2002 20:26:10 -0000	1.1056
+++ configure.in	3 Jul 2002 22:46:49 -0000
@@ -883,6 +883,7 @@
     ;;
     i?86)
     	USE_ELF_DYNSTR_GC=1
+        MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
     ;;
     mips*)
         CFLAGS="$CFLAGS -Wa,-xgot"
@@ -3652,6 +3653,30 @@
 [  --enable-elf-dynstr-gc  Enable elf dynstr garbage collector (opt builds only)],
     USE_ELF_DYNSTR_GC=1,
     USE_ELF_DYNSTR_GC= )
+
+dnl ========================================================
+dnl = --enable-old-abi-compat-wrappers
+dnl ========================================================
+dnl on x86 linux, the current builds of some popular plugins (notably
+dnl flashplayer and real) expect a few builtin symbols from libgcc
+dnl which were available in some older versions of gcc.  However,
+dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
+dnl we want those plugin to work with a gcc-3.1 built binary, we need
+dnl to provide these symbols.  MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
+dnl to true on x86 linux, and false everywhere else.
+dnl
+
+MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers
+[  --old-abi-compat-wrappers,  Support old GCC ABI symbols to ease the pain of the linux compiler change],
+    MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
+    MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
+if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
+    AC_LANG_RESTORE
+    AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
+fi
 
 dnl ========================================================
 dnl = --enable-prebinding
Index: xpfe/bootstrap/nsAppRunner.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/bootstrap/nsAppRunner.cpp,v
retrieving revision 1.353
diff -u -r1.353 nsAppRunner.cpp
--- xpfe/bootstrap/nsAppRunner.cpp	16 May 2002 01:02:12 -0000	1.353
+++ xpfe/bootstrap/nsAppRunner.cpp	3 Jul 2002 22:46:49 -0000
@@ -134,6 +134,58 @@
 #include "jprof.h"
 #endif
 
+// on x86 linux, the current builds of some popular plugins (notably
+// flashplayer and real) expect a few builtin symbols from libgcc
+// which were available in some older versions of gcc.  However,
+// they're _NOT_ available in newer versions of gcc (eg 3.1), so if
+// we want those plugin to work with a gcc-3.1 built binary, we need
+// to provide these symbols.  MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
+// to true on x86 linux, and false everywhere else.
+//
+// The fact that the new and free operators are mismatched 
+// mirrors the way the original functions in egcs 1.1.2 worked.
+
+
+extern "C" {
+
+# ifndef HAVE___builtin_vec_new
+  void *__builtin_vec_new(size_t aSize, const std::nothrow_t &aNoThrow) throw()
+  {
+    return ::operator new(aSize, aNoThrow);
+  }
+# endif
+
+# ifndef HAVE___builtin_vec_delete
+  void __builtin_vec_delete(void *aPtr, const std::nothrow_t &) throw ()
+  {
+    if (aPtr) {
+      free(aPtr);
+    }
+  }
+# endif
+
+# ifndef HAVE__builtin_new
+	void *__builtin_new(int aSize)
+  {
+    return malloc(aSize);
+  }
+# endif
+
+# ifndef HAVE__builtin_delete
+	void __builtin_delete(void *aPtr)
+  {
+    free(aPtr);
+  }
+# endif
+
+# ifndef HAVE__pure_virtual
+  void __pure_virtual(void) {
+    extern void __cxa_pure_virtual(void);
+
+    __cxa_pure_virtual();
+  }
+# endif
+}
 
 #ifdef _BUILD_STATIC_BIN
 #include "nsStaticComponent.h"