summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/4.2-apple64/fix-libstdc++-link.patch
blob: 5a417f8151b535469917af752d4b3bbee192a7da (plain) (blame)
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
Prevent our libstdc++.dylib from having a runtime dependency on
/usr/lib/libstdc++.dylib.  This is caused by the implicit -lstdc++
passed by g++ when it links libstdc++.dylib.  Adding "-nostdlib" to
the g++ invocation prevents this.

jww (2014-06-21): I've added several more patches to this, for building on
Mavericks.

diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstdcxx-39/libstdcxx/libstdc++-v3/src/Makefile.in
--- x/libstdcxx/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
+++ y/libstdcxx/libstdc++-v3/src/Makefile.in	2012-02-17 18:44:05.210570590 +0100
@@ -388,7 +388,7 @@
 
 libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
 libstdc___la_LDFLAGS = \
-	-version-info $(libtool_VERSION) ${version_arg} -lm 
+	-version-info $(libtool_VERSION) ${version_arg} -lm -Wc,-nostdlib
 
 
 # Use special rules for the deprecated source files so that they find
--- x/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
+++ y/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -38,7 +38,7 @@
 #include <typeinfo>
 #include <exception>
 #include <cstddef>
-#include "unwind.h"
+#include "unwind-generic.h"
 
 #pragma GCC visibility push(default)
 
@@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid ();
 // throws, and if bad_exception needs to be thrown.  Called from the
 // compiler.
 extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
-extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn));
+extern "C" void __cxa_call_terminate(_Unwind_Exception* ue_header);
 
 #ifdef __ARM_EABI_UNWINDER__
 // Arm EABI specified routines.
--- x/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
+++ y/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -549,6 +549,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
    */
   class free_list
   {
+  public:
     typedef size_t* 				value_type;
     typedef __detail::__mini_vector<value_type> vector_type;
     typedef vector_type::iterator 		iterator;
--- x/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
+++ y/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
@@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     {
       size_t __old_len = __r->_M_size;
       _CharT* __new_data = (_CharT*)
-	_Data_allocate(_S_rounded_up_size(__old_len + __len));
+	_Base::_Data_allocate(_S_rounded_up_size(__old_len + __len));
       _RopeLeaf* __result;
 
       uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
@@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 	    if (__result_len > __lazy_threshold)
 	      goto lazy;
 	    __section = (_CharT*)
-	      _Data_allocate(_S_rounded_up_size(__result_len));
+	      _Base::_Data_allocate(_S_rounded_up_size(__result_len));
 	    try
 	      {	(*(__f->_M_fn))(__start, __result_len, __section); }
 	    catch(...)