summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6/optional_libstdc.patch
blob: fe157a892d4604a6a67c57e462fb7a1580fa02fa (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
Upstream-Status: Inappropriate [embedded specific]

gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ 
will not run correctly since by default the linker will try to link against libstdc++
which shouldn't exist yet. We need an option to disable -lstdc++
option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc 
driver. This patch adds such an option which only disables the -lstdc++.

A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to 
do this officially, the likely answer is don't build libstdc++ separately.

RP 29/6/10

Index: gcc-4.6.0/gcc/cp/g++spec.c
===================================================================
--- gcc-4.6.0.orig/gcc/cp/g++spec.c
+++ gcc-4.6.0/gcc/cp/g++spec.c
@@ -127,6 +127,7 @@ lang_specific_driver (struct cl_decoded_
       switch (decoded_options[i].opt_index)
 	{
 	case OPT_nostdlib:
+	case OPT_nostdlib__:
 	case OPT_nodefaultlibs:
 	  library = -1;
 	  break;
Index: gcc-4.6.0/gcc/doc/invoke.texi
===================================================================
--- gcc-4.6.0.orig/gcc/doc/invoke.texi
+++ gcc-4.6.0/gcc/doc/invoke.texi
@@ -193,7 +193,7 @@ in the following sections.
 -fno-pretty-templates @gol
 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
--fno-default-inline  -fvisibility-inlines-hidden @gol
+-nostdlib++ -fno-default-inline  -fvisibility-inlines-hidden @gol
 -fvisibility-ms-compat @gol
 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
@@ -431,7 +431,7 @@ Objective-C and Objective-C++ Dialects}.
 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
--shared-libgcc  -symbolic @gol
+-shared-libgcc  -symbolic -nostdlib++ @gol
 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
 -u @var{symbol}}
 
@@ -9069,6 +9069,11 @@ These entries are usually resolved by en
 libc.  These entry points should be supplied through some other
 mechanism when this option is specified.
 
+@item -nostdlib++
+@opindex nostdlib++
+Do not use the standard system C++ runtime libraries when linking.
+Only the libraries you specify will be passed to the linker.
+
 @cindex @option{-lgcc}, use with @option{-nostdlib}
 @cindex @option{-nostdlib} and unresolved references
 @cindex unresolved references and @option{-nostdlib}
Index: gcc-4.6.0/gcc/c-family/c.opt
===================================================================
--- gcc-4.6.0.orig/gcc/c-family/c.opt
+++ gcc-4.6.0/gcc/c-family/c.opt
@@ -1111,6 +1111,10 @@ nostdinc++
 C++ ObjC++
 Do not search standard system include directories for C++
 
+nostdlib++
+Driver
+Do not link standard C++ runtime library
+
 o
 C ObjC C++ ObjC++ Joined Separate
 ; Documented in common.opt
Index: gcc-4.6.0/gcc/gcc.c
===================================================================
--- gcc-4.6.0.orig/gcc/gcc.c
+++ gcc-4.6.0/gcc/gcc.c
@@ -666,6 +666,7 @@ proper position among the other output f
     %(mflib) " STACK_SPLIT_SPEC "\
     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
+    %{!nostdlib++:}\
     %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
 #endif