diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/meta/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch deleted file mode 100644 index b856c5dea3..0000000000 --- a/meta/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
2 | Subject: [PATCH 3/5] gcc: Add --nostdlib++ option | ||
3 | |||
4 | [gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ | ||
5 | will not run correctly since by default the linker will try to link against libstdc++ | ||
6 | which shouldn't exist yet. We need an option to disable -lstdc++ | ||
7 | option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc | ||
8 | driver. This patch adds such an option which only disables the -lstdc++.] | ||
9 | |||
10 | [A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to | ||
11 | do this officially, the likely answer is don't build libstdc++ separately.] | ||
12 | |||
13 | OpenEmbedded/Yocto Project builds libgcc and the other gcc runtime libraries | ||
14 | separately from the compiler and slightly differently to the standard gcc build. | ||
15 | |||
16 | In general this works well but in trying to build them separately we run into | ||
17 | an issue since we're using our gcc, not xgcc and there is no way to tell configure | ||
18 | to use libgcc but not look for libstdc++. | ||
19 | |||
20 | This adds such an option allowing such configurations to work. | ||
21 | |||
22 | 2021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org> | ||
23 | |||
24 | gcc/c-family/ChangeLog: | ||
25 | |||
26 | * c.opt: Add --nostdlib++ option | ||
27 | |||
28 | gcc/cp/ChangeLog: | ||
29 | |||
30 | * g++spec.c (lang_specific_driver): Add --nostdlib++ option | ||
31 | |||
32 | gcc/ChangeLog: | ||
33 | |||
34 | * doc/invoke.texi: Document --nostdlib++ option | ||
35 | * gcc.c: Add --nostdlib++ option | ||
36 | |||
37 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
38 | |||
39 | Upstream-Status: Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582724.html] | ||
40 | --- | ||
41 | gcc/c-family/c.opt | 4 ++++ | ||
42 | gcc/cp/g++spec.c | 1 + | ||
43 | gcc/doc/invoke.texi | 8 +++++++- | ||
44 | gcc/gcc.c | 1 + | ||
45 | 4 files changed, 13 insertions(+), 1 deletion(-) | ||
46 | |||
47 | Index: gcc-11.2.0/gcc/c-family/c.opt | ||
48 | =================================================================== | ||
49 | --- gcc-11.2.0.orig/gcc/c-family/c.opt | ||
50 | +++ gcc-11.2.0/gcc/c-family/c.opt | ||
51 | @@ -2153,6 +2153,10 @@ nostdinc++ | ||
52 | C++ ObjC++ | ||
53 | Do not search standard system include directories for C++. | ||
54 | |||
55 | +nostdlib++ | ||
56 | +Driver | ||
57 | +Do not link standard C++ runtime library | ||
58 | + | ||
59 | o | ||
60 | C ObjC C++ ObjC++ Joined Separate | ||
61 | ; Documented in common.opt | ||
62 | Index: gcc-11.2.0/gcc/cp/g++spec.c | ||
63 | =================================================================== | ||
64 | --- gcc-11.2.0.orig/gcc/cp/g++spec.c | ||
65 | +++ gcc-11.2.0/gcc/cp/g++spec.c | ||
66 | @@ -159,6 +159,7 @@ lang_specific_driver (struct cl_decoded_ | ||
67 | switch (decoded_options[i].opt_index) | ||
68 | { | ||
69 | case OPT_nostdlib: | ||
70 | + case OPT_nostdlib__: | ||
71 | case OPT_nodefaultlibs: | ||
72 | library = -1; | ||
73 | break; | ||
74 | Index: gcc-11.2.0/gcc/doc/invoke.texi | ||
75 | =================================================================== | ||
76 | --- gcc-11.2.0.orig/gcc/doc/invoke.texi | ||
77 | +++ gcc-11.2.0/gcc/doc/invoke.texi | ||
78 | @@ -239,6 +239,7 @@ in the following sections. | ||
79 | -fno-weak -nostdinc++ @gol | ||
80 | -fvisibility-inlines-hidden @gol | ||
81 | -fvisibility-ms-compat @gol | ||
82 | +-nostdlib++ @gol | ||
83 | -fext-numeric-literals @gol | ||
84 | -flang-info-include-translate@r{[}=@var{header}@r{]} @gol | ||
85 | -flang-info-include-translate-not @gol | ||
86 | @@ -632,7 +633,7 @@ Objective-C and Objective-C++ Dialects}. | ||
87 | -pie -pthread -r -rdynamic @gol | ||
88 | -s -static -static-pie -static-libgcc -static-libstdc++ @gol | ||
89 | -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol | ||
90 | --shared -shared-libgcc -symbolic @gol | ||
91 | +-shared -shared-libgcc -symbolic -nostdlib++ @gol | ||
92 | -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol | ||
93 | -u @var{symbol} -z @var{keyword}} | ||
94 | |||
95 | @@ -15721,6 +15722,11 @@ Specify that the program entry point is | ||
96 | interpreted by the linker; the GNU linker accepts either a symbol name | ||
97 | or an address. | ||
98 | |||
99 | +@item -nostdlib++ | ||
100 | +@opindex nostdlib++ | ||
101 | +Do not use the standard system C++ runtime libraries when linking. | ||
102 | +Only the libraries you specify will be passed to the linker. | ||
103 | + | ||
104 | @item -pie | ||
105 | @opindex pie | ||
106 | Produce a dynamically linked position independent executable on targets | ||
107 | Index: gcc-11.2.0/gcc/gcc.c | ||
108 | =================================================================== | ||
109 | --- gcc-11.2.0.orig/gcc/gcc.c | ||
110 | +++ gcc-11.2.0/gcc/gcc.c | ||
111 | @@ -1162,6 +1162,7 @@ proper position among the other output f | ||
112 | %(mflib) " STACK_SPLIT_SPEC "\ | ||
113 | %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ | ||
114 | %{!nostdlib:%{!r:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}}\ | ||
115 | + %{!nostdlib++:}\ | ||
116 | %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} \n%(post_link) }}}}}}" | ||
117 | #endif | ||
118 | |||