summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch212
1 files changed, 212 insertions, 0 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch
new file mode 100644
index 0000000000..ac4281ac28
--- /dev/null
+++ b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch
@@ -0,0 +1,212 @@
1Upstream-Status: Backport
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4commit 3cb9bbfa927aa187048534f9069202c017a78e38
5Author: ppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4>
6Date: Wed May 11 18:28:14 2011 +0000
7
8 2011-05-11 Satoru Takabayashi <satorux@google.com>
9 Paul Pluzhnikov <ppluzhnikov@google.com>
10
11 * gcc/doc/install.texi (Configuration): Document
12 --with-linker-hash-style.
13 * gcc/gcc.c (init_spec): Handle LINKER_HASH_STYLE.
14 * gcc/config.in: Add LINKER_HASH_STYLE.
15 * gcc/configure.ac: Add --with-linker-hash-style.
16 * gcc/configure: Regenerate.
17
18
19
20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173668 138bc75d-0d04-0410-961f-82ee72b054a4
21
22Index: gcc-4_5-branch/gcc/config.in
23===================================================================
24--- gcc-4_5-branch.orig/gcc/config.in 2011-12-03 13:41:00.000000000 -0800
25+++ gcc-4_5-branch/gcc/config.in 2011-12-03 13:44:46.287530329 -0800
26@@ -113,6 +113,12 @@
27 #endif
28
29
30+/* The linker hash style */
31+#ifndef USED_FOR_TARGET
32+#undef LINKER_HASH_STYLE
33+#endif
34+
35+
36 /* Define to enable LTO support. */
37 #ifndef USED_FOR_TARGET
38 #undef ENABLE_LTO
39Index: gcc-4_5-branch/gcc/configure
40===================================================================
41--- gcc-4_5-branch.orig/gcc/configure 2011-12-03 13:41:00.000000000 -0800
42+++ gcc-4_5-branch/gcc/configure 2011-12-03 13:46:12.747530321 -0800
43@@ -600,6 +600,7 @@
44
45 ac_subst_vars='LTLIBOBJS
46 LIBOBJS
47+enable_target_optspace
48 enable_plugin
49 pluginlibs
50 LIBELFINC
51@@ -915,7 +916,7 @@
52 with_slibdir
53 enable_poison_system_directories
54 enable_plugin
55-enable_target_optspace
56+with_linker_hash_style
57 '
58 ac_precious_vars='build_alias
59 host_alias
60@@ -1663,6 +1664,8 @@
61 with the compiler
62 --with-system-zlib use installed libz
63 --with-slibdir=DIR shared libraries in DIR [LIBDIR]
64+ --with-linker-hash-style={sysv,gnu,both}
65+ specify the linker hash style
66
67 Some influential environment variables:
68 CC C compiler command
69@@ -17115,7 +17118,7 @@
70 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
71 lt_status=$lt_dlunknown
72 cat > conftest.$ac_ext <<_LT_EOF
73-#line 17114 "configure"
74+#line 17121 "configure"
75 #include "confdefs.h"
76
77 #if HAVE_DLFCN_H
78@@ -17221,7 +17224,7 @@
79 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
80 lt_status=$lt_dlunknown
81 cat > conftest.$ac_ext <<_LT_EOF
82-#line 17220 "configure"
83+#line 17227 "configure"
84 #include "confdefs.h"
85
86 #if HAVE_DLFCN_H
87@@ -25659,12 +25662,42 @@
88
89 fi
90
91-if test x"$enable_target_optspace" != x; then :
92+
93+if test x"$enable_target_optspace" != x; then
94
95 $as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h
96
97 fi
98
99+# Specify what hash style to use by default.
100+
101+# Check whether --with-linker-hash-style was given.
102+if test "${with_linker_hash_style+set}" = set; then :
103+ withval=$with_linker_hash_style; case x"$withval" in
104+ xsysv)
105+ LINKER_HASH_STYLE=sysv
106+ ;;
107+ xgnu)
108+ LINKER_HASH_STYLE=gnu
109+ ;;
110+ xboth)
111+ LINKER_HASH_STYLE=both
112+ ;;
113+ *)
114+ as_fn_error "$withval is an invalid option to --with-linker-hash-style" "$LINENO" 5
115+ ;;
116+ esac
117+else
118+ LINKER_HASH_STYLE=''
119+fi
120+
121+if test x"${LINKER_HASH_STYLE}" != x; then
122+
123+cat >>confdefs.h <<_ACEOF
124+#define LINKER_HASH_STYLE "$LINKER_HASH_STYLE"
125+_ACEOF
126+
127+fi
128
129 # Configure the subdirectories
130 # AC_CONFIG_SUBDIRS($subdirs)
131Index: gcc-4_5-branch/gcc/configure.ac
132===================================================================
133--- gcc-4_5-branch.orig/gcc/configure.ac 2011-12-03 13:41:00.000000000 -0800
134+++ gcc-4_5-branch/gcc/configure.ac 2011-12-03 13:41:04.499530358 -0800
135@@ -4664,6 +4664,30 @@
136 AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.])
137 fi
138
139+# Specify what hash style to use by default.
140+AC_ARG_WITH([linker-hash-style],
141+[AC_HELP_STRING([--with-linker-hash-style={sysv,gnu,both}],
142+ [specify the linker hash style])],
143+[case x"$withval" in
144+ xsysv)
145+ LINKER_HASH_STYLE=sysv
146+ ;;
147+ xgnu)
148+ LINKER_HASH_STYLE=gnu
149+ ;;
150+ xboth)
151+ LINKER_HASH_STYLE=both
152+ ;;
153+ *)
154+ AC_MSG_ERROR([$withval is an invalid option to --with-linker-hash-style])
155+ ;;
156+ esac],
157+[LINKER_HASH_STYLE=''])
158+if test x"${LINKER_HASH_STYLE}" != x; then
159+ AC_DEFINE_UNQUOTED(LINKER_HASH_STYLE, "$LINKER_HASH_STYLE",
160+ [The linker hash style])
161+fi
162+
163 # Configure the subdirectories
164 # AC_CONFIG_SUBDIRS($subdirs)
165
166Index: gcc-4_5-branch/gcc/doc/install.texi
167===================================================================
168--- gcc-4_5-branch.orig/gcc/doc/install.texi 2011-12-03 13:15:09.000000000 -0800
169+++ gcc-4_5-branch/gcc/doc/install.texi 2011-12-03 13:41:04.499530358 -0800
170@@ -1630,6 +1630,11 @@
171 support @option{--build-id} option, a warning is issued and the
172 @option{--enable-linker-build-id} option is ignored. The default is off.
173
174+@item --with-linker-hash-style=@var{choice}
175+Tells GCC to pass @option{--hash-style=@var{choice}} option to the
176+linker for all final links. @var{choice} can be one of
177+@samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default.
178+
179 @item --enable-gnu-unique-object
180 @itemx --disable-gnu-unique-object
181 Tells GCC to use the gnu_unique_object relocation for C++ template
182Index: gcc-4_5-branch/gcc/gcc.c
183===================================================================
184--- gcc-4_5-branch.orig/gcc/gcc.c 2011-12-03 13:41:00.000000000 -0800
185+++ gcc-4_5-branch/gcc/gcc.c 2011-12-03 13:41:04.499530358 -0800
186@@ -1917,7 +1917,8 @@
187 }
188 #endif
189
190-#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC
191+#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \
192+ defined LINKER_HASH_STYLE
193 # ifdef LINK_BUILDID_SPEC
194 /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
195 obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof(LINK_BUILDID_SPEC) - 1);
196@@ -1926,6 +1927,16 @@
197 /* Prepend LINK_EH_SPEC to whatever link_spec we had before. */
198 obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1);
199 # endif
200+# ifdef LINKER_HASH_STYLE
201+ /* Prepend --hash-style=LINKER_HASH_STYLE to whatever link_spec we had
202+ before. */
203+ {
204+ static const char hash_style[] = "--hash-style=";
205+ obstack_grow (&obstack, hash_style, sizeof(hash_style) - 1);
206+ obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof(LINKER_HASH_STYLE) - 1);
207+ obstack_1grow (&obstack, ' ');
208+ }
209+# endif
210 obstack_grow0 (&obstack, link_spec, strlen (link_spec));
211 link_spec = XOBFINISH (&obstack, const char *);
212 #endif