diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-05-11 10:35:04 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:28 +0100 |
commit | 6ea164c208ab43251544525e83644a8f84d3a6f8 (patch) | |
tree | 44b2e95c00a32006e8c39d35cd48105e3126d15e /meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch | |
parent | 1f2108f0f4bf7d71adb39297c3b3f8b7bcea0ca0 (diff) | |
download | poky-6ea164c208ab43251544525e83644a8f84d3a6f8.tar.gz |
gcc: Add gcc6 recipes
(From OE-Core rev: 93226e8c74be438781df79f0be5cbf563c79df8b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch new file mode 100644 index 0000000000..44b0cc7d6e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-6.1/0014-optional-libstdc.patch | |||
@@ -0,0 +1,125 @@ | |||
1 | From 36275f7981bdaf919bbc9b51a7c7fae1e192adb3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:12:56 +0400 | ||
4 | Subject: [PATCH 14/46] optional libstdc | ||
5 | |||
6 | gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ | ||
7 | will not run correctly since by default the linker will try to link against libstdc++ | ||
8 | which shouldn't exist yet. We need an option to disable -lstdc++ | ||
9 | option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc | ||
10 | driver. This patch adds such an option which only disables the -lstdc++. | ||
11 | |||
12 | A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to | ||
13 | do this officially, the likely answer is don't build libstdc++ separately. | ||
14 | |||
15 | RP 29/6/10 | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | |||
19 | Upstream-Status: Inappropriate [embedded specific] | ||
20 | --- | ||
21 | gcc/c-family/c.opt | 4 ++++ | ||
22 | gcc/cp/g++spec.c | 1 + | ||
23 | gcc/doc/invoke.texi | 32 +++++++++++++++++++++++++++++++- | ||
24 | gcc/gcc.c | 1 + | ||
25 | 4 files changed, 37 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt | ||
28 | index 4f86876..660da6c 100644 | ||
29 | --- a/gcc/c-family/c.opt | ||
30 | +++ b/gcc/c-family/c.opt | ||
31 | @@ -1647,6 +1647,10 @@ nostdinc++ | ||
32 | C++ ObjC++ | ||
33 | Do not search standard system include directories for C++. | ||
34 | |||
35 | +nostdlib++ | ||
36 | +Driver | ||
37 | +Do not link standard C++ runtime library | ||
38 | + | ||
39 | o | ||
40 | C ObjC C++ ObjC++ Joined Separate | ||
41 | ; Documented in common.opt | ||
42 | diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c | ||
43 | index 03cbde0..3642540 100644 | ||
44 | --- a/gcc/cp/g++spec.c | ||
45 | +++ b/gcc/cp/g++spec.c | ||
46 | @@ -137,6 +137,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, | ||
47 | switch (decoded_options[i].opt_index) | ||
48 | { | ||
49 | case OPT_nostdlib: | ||
50 | + case OPT_nostdlib__: | ||
51 | case OPT_nodefaultlibs: | ||
52 | library = -1; | ||
53 | break; | ||
54 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi | ||
55 | index 8bb49e7..84d68aa 100644 | ||
56 | --- a/gcc/doc/invoke.texi | ||
57 | +++ b/gcc/doc/invoke.texi | ||
58 | @@ -207,6 +207,9 @@ in the following sections. | ||
59 | -fno-weak -nostdinc++ @gol | ||
60 | -fvisibility-inlines-hidden @gol | ||
61 | -fvisibility-ms-compat @gol | ||
62 | +-fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol | ||
63 | +-fvtv-counts -fvtv-debug @gol | ||
64 | +-nostdlib++ @gol | ||
65 | -fext-numeric-literals @gol | ||
66 | -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol | ||
67 | -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol | ||
68 | @@ -470,7 +473,7 @@ Objective-C and Objective-C++ Dialects}. | ||
69 | -s -static -static-libgcc -static-libstdc++ @gol | ||
70 | -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol | ||
71 | -static-libmpx -static-libmpxwrappers @gol | ||
72 | --shared -shared-libgcc -symbolic @gol | ||
73 | +-shared -shared-libgcc -symbolic -nostdlib++ @gol | ||
74 | -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol | ||
75 | -u @var{symbol} -z @var{keyword}} | ||
76 | |||
77 | @@ -10601,6 +10604,33 @@ library subroutines. | ||
78 | constructors are called; @pxref{Collect2,,@code{collect2}, gccint, | ||
79 | GNU Compiler Collection (GCC) Internals}.) | ||
80 | |||
81 | +@item -nostdlib++ | ||
82 | +@opindex nostdlib++ | ||
83 | +Do not use the standard system C++ runtime libraries when linking. | ||
84 | +Only the libraries you specify will be passed to the linker. | ||
85 | + | ||
86 | +@cindex @option{-lgcc}, use with @option{-nostdlib} | ||
87 | +@cindex @option{-nostdlib} and unresolved references | ||
88 | +@cindex unresolved references and @option{-nostdlib} | ||
89 | +@cindex @option{-lgcc}, use with @option{-nodefaultlibs} | ||
90 | +@cindex @option{-nodefaultlibs} and unresolved references | ||
91 | +@cindex unresolved references and @option{-nodefaultlibs} | ||
92 | +One of the standard libraries bypassed by @option{-nostdlib} and | ||
93 | +@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines | ||
94 | +which GCC uses to overcome shortcomings of particular machines, or special | ||
95 | +needs for some languages. | ||
96 | +(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler | ||
97 | +Collection (GCC) Internals}, | ||
98 | +for more discussion of @file{libgcc.a}.) | ||
99 | +In most cases, you need @file{libgcc.a} even when you want to avoid | ||
100 | +other standard libraries. In other words, when you specify @option{-nostdlib} | ||
101 | +or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well. | ||
102 | +This ensures that you have no unresolved references to internal GCC | ||
103 | +library subroutines. | ||
104 | +(An example of such an internal subroutine is @code{__main}, used to ensure C++ | ||
105 | +constructors are called; @pxref{Collect2,,@code{collect2}, gccint, | ||
106 | +GNU Compiler Collection (GCC) Internals}.) | ||
107 | + | ||
108 | @item -pie | ||
109 | @opindex pie | ||
110 | Produce a position independent executable on targets that support it. | ||
111 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
112 | index 4cfef7f..da0b482 100644 | ||
113 | --- a/gcc/gcc.c | ||
114 | +++ b/gcc/gcc.c | ||
115 | @@ -1028,6 +1028,7 @@ proper position among the other output files. */ | ||
116 | %(mflib) " STACK_SPLIT_SPEC "\ | ||
117 | %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ | ||
118 | %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ | ||
119 | + %{!nostdlib++:}\ | ||
120 | %{!nostdlib:%{!nostartfiles:%E}} %{T*} \n%(post_link) }}}}}}" | ||
121 | #endif | ||
122 | |||
123 | -- | ||
124 | 2.8.2 | ||
125 | |||