component(developer/golang-123): Add Component
[oi-userland.git] / components / developer / gcc-14 / patches / 0007-sol2-enable-full-__cxa_atexit-support.patch
blob01d3bcaadd47738cce897a28f7b5800181ca5c21
1 From 37050a5dc2b0d5856a31ea14fc085e866562a150 Mon Sep 17 00:00:00 2001
2 From: Richard Lowe <richlowe@richlowe.net>
3 Date: Tue, 4 Mar 2014 22:11:03 +0000
4 Subject: sol2: enable full __cxa_atexit support
6 ---
7 gcc/config/sol2.h | 4 ++--
8 libgcc/config.host | 3 ++-
9 2 files changed, 4 insertions(+), 3 deletions(-)
11 diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
12 index 85c1f9daf6a9..7f01b22d2229 100644
13 --- a/gcc/config/sol2.h
14 +++ b/gcc/config/sol2.h
15 @@ -209,7 +209,7 @@ along with GCC; see the file COPYING3. If not see
16 shared|" PIE_SPEC ":crtbeginS.o%s; \
17 :crtbegin.o%s}"
18 #else
19 -#define STARTFILE_CRTBEGIN_SPEC "crtbegin.o%s"
20 +#define STARTFILE_CRTBEGIN_SPEC "%{shared:crtbeginS.o%s;:crtbegin.o%s}"
21 #endif
23 #if ENABLE_VTABLE_VERIFY
24 @@ -289,7 +289,7 @@ along with GCC; see the file COPYING3. If not see
25 shared|" PIE_SPEC ":crtendS.o%s; \
26 :crtend.o%s}"
27 #else
28 -#define ENDFILE_CRTEND_SPEC "crtend.o%s"
29 +#define ENDFILE_CRTEND_SPEC "%{shared:crtendS.o%s;:crtend.o%s}"
30 #endif
32 #undef ENDFILE_SPEC
33 diff --git a/libgcc/config.host b/libgcc/config.host
34 index e75a7af647f6..78443a65e19f 100644
35 --- a/libgcc/config.host
36 +++ b/libgcc/config.host
37 @@ -336,7 +336,7 @@ case ${host} in
38 *-*-solaris2*)
39 # Unless linker support and dl_iterate_phdr are present,
40 # unwind-dw2-fde-dip.c automatically falls back to unwind-dw2-fde.c.
41 - tmake_file="$tmake_file sol2/t-sol2 t-eh-dw2-dip t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-elf-ver"
42 + tmake_file="$tmake_file sol2/t-sol2 t-eh-dw2-dip t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-elf-ver t-crtstuff-pic"
43 if test $with_gnu_ld = yes; then
44 tmake_file="$tmake_file t-slibgcc-gld"
45 else
46 @@ -356,6 +356,7 @@ case ${host} in
47 i?86-*-solaris2* | x86_64-*-solaris2*)
48 # Solaris 10+/x86 provides crt1.o, crti.o, crtn.o, and gcrt1.o as
49 # part of the base system.
50 + extra_parts="$extra_parts crtbeginS.o crtendS.o"
52 sparc*-*-solaris2*)
53 # Solaris 10+/SPARC lacks crt1.o and gcrt1.o.