summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch
new file mode 100644
index 0000000000..6e7536b693
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/optional_libstdc.patch
@@ -0,0 +1,86 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
4will not run correctly since by default the linker will try to link against libstdc++
5which shouldn't exist yet. We need an option to disable -lstdc++
6option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
7driver. This patch adds such an option which only disables the -lstdc++.
8
9A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
10do this officially, the likely answer is don't build libstdc++ separately.
11
12RP 29/6/10
13
14Index: gcc-4_7-branch/gcc/cp/g++spec.c
15===================================================================
16--- gcc-4_7-branch.orig/gcc/cp/g++spec.c 2012-04-10 10:17:24.647330074 -0700
17+++ gcc-4_7-branch/gcc/cp/g++spec.c 2012-04-10 10:37:49.479389235 -0700
18@@ -127,6 +127,7 @@
19 switch (decoded_options[i].opt_index)
20 {
21 case OPT_nostdlib:
22+ case OPT_nostdlib__:
23 case OPT_nodefaultlibs:
24 library = -1;
25 break;
26Index: gcc-4_7-branch/gcc/doc/invoke.texi
27===================================================================
28--- gcc-4_7-branch.orig/gcc/doc/invoke.texi 2012-04-10 10:37:09.343387385 -0700
29+++ gcc-4_7-branch/gcc/doc/invoke.texi 2012-04-10 10:37:49.483389340 -0700
30@@ -194,7 +194,7 @@
31 -fno-pretty-templates @gol
32 -frepo -fno-rtti -fstats -ftemplate-depth=@var{n} @gol
33 -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol
34--fno-default-inline -fvisibility-inlines-hidden @gol
35+-nostdlib++ -fno-default-inline -fvisibility-inlines-hidden @gol
36 -fvisibility-ms-compat @gol
37 -Wabi -Wconversion-null -Wctor-dtor-privacy @gol
38 -Wdelete-non-virtual-dtor -Wnarrowing -Wnoexcept @gol
39@@ -445,7 +445,7 @@
40 @gccoptlist{@var{object-file-name} -l@var{library} @gol
41 -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
42 -s -static -static-libgcc -static-libstdc++ -shared @gol
43--shared-libgcc -symbolic @gol
44+-shared-libgcc -symbolic -nostdlib++ @gol
45 -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
46 -u @var{symbol}}
47
48@@ -9438,6 +9438,11 @@
49 libc. These entry points should be supplied through some other
50 mechanism when this option is specified.
51
52+@item -nostdlib++
53+@opindex nostdlib++
54+Do not use the standard system C++ runtime libraries when linking.
55+Only the libraries you specify will be passed to the linker.
56+
57 @cindex @option{-lgcc}, use with @option{-nostdlib}
58 @cindex @option{-nostdlib} and unresolved references
59 @cindex unresolved references and @option{-nostdlib}
60Index: gcc-4_7-branch/gcc/c-family/c.opt
61===================================================================
62--- gcc-4_7-branch.orig/gcc/c-family/c.opt 2012-04-10 10:17:24.667330076 -0700
63+++ gcc-4_7-branch/gcc/c-family/c.opt 2012-04-10 10:37:49.483389340 -0700
64@@ -1171,6 +1171,10 @@
65 C++ ObjC++
66 Do not search standard system include directories for C++
67
68+nostdlib++
69+Driver
70+Do not link standard C++ runtime library
71+
72 o
73 C ObjC C++ ObjC++ Joined Separate
74 ; Documented in common.opt
75Index: gcc-4_7-branch/gcc/gcc.c
76===================================================================
77--- gcc-4_7-branch.orig/gcc/gcc.c 2012-04-10 10:37:09.343387385 -0700
78+++ gcc-4_7-branch/gcc/gcc.c 2012-04-10 10:37:49.487389409 -0700
79@@ -681,6 +681,7 @@
80 %(mflib) " STACK_SPLIT_SPEC "\
81 %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
82 %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
83+ %{!nostdlib++:}\
84 %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
85 #endif
86