summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-08-16 15:20:15 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-28 14:58:51 +0100
commit46ad3b0e2c603ebbd510f59796bf44fcabe70aaa (patch)
tree95b25b0096e62da3293028861e1152b0247c8a2e /meta/recipes-devtools/gcc/gcc-4.6
parent81d9b54d7e6335d7d0aeff3fa6ac083989c2f69d (diff)
downloadpoky-46ad3b0e2c603ebbd510f59796bf44fcabe70aaa.tar.gz
gcc-4.6: Use --with-linker-hash-style configure option
Depending upon what hash style is in use this uses the right flag for setting the hash style type. This fixes the QA errors about missing GNU hash style reported in gcc-runtime build particularly libgcc (From OE-Core rev: f8edd9b872bcf14da037bd0b501ccc8c6fcc79bf) 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-4.6')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch196
1 files changed, 196 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch
new file mode 100644
index 0000000000..4fa3cbe276
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch
@@ -0,0 +1,196 @@
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_6-branch/gcc/config.in
23===================================================================
24--- gcc-4_6-branch.orig/gcc/config.in 2011-09-09 08:26:10.000000000 -0700
25+++ gcc-4_6-branch/gcc/config.in 2011-09-09 08:27:14.142981164 -0700
26@@ -1583,6 +1583,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 the name of the LTO plugin DSO that must be passed to the
37 linker's -plugin=LIB option. */
38 #ifndef USED_FOR_TARGET
39Index: gcc-4_6-branch/gcc/configure
40===================================================================
41--- gcc-4_6-branch.orig/gcc/configure 2011-09-09 08:26:15.000000000 -0700
42+++ gcc-4_6-branch/gcc/configure 2011-09-09 08:27:42.793023181 -0700
43@@ -915,6 +915,7 @@
44 enable_poison_system_directories
45 enable_plugin
46 enable_libquadmath_support
47+with_linker_hash_style
48 '
49 ac_precious_vars='build_alias
50 host_alias
51@@ -1667,6 +1668,8 @@
52 with the compiler
53 --with-system-zlib use installed libz
54 --with-slibdir=DIR shared libraries in DIR [LIBDIR]
55+ --with-linker-hash-style={sysv,gnu,both}
56+ specify the linker hash style
57
58 Some influential environment variables:
59 CC C compiler command
60@@ -17511,7 +17514,7 @@
61 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
62 lt_status=$lt_dlunknown
63 cat > conftest.$ac_ext <<_LT_EOF
64-#line 17514 "configure"
65+#line 17517 "configure"
66 #include "confdefs.h"
67
68 #if HAVE_DLFCN_H
69@@ -17617,7 +17620,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 17620 "configure"
74+#line 17623 "configure"
75 #include "confdefs.h"
76
77 #if HAVE_DLFCN_H
78@@ -26434,6 +26437,36 @@
79 fi
80
81
82+# Specify what hash style to use by default.
83+
84+# Check whether --with-linker-hash-style was given.
85+if test "${with_linker_hash_style+set}" = set; then :
86+ withval=$with_linker_hash_style; case x"$withval" in
87+ xsysv)
88+ LINKER_HASH_STYLE=sysv
89+ ;;
90+ xgnu)
91+ LINKER_HASH_STYLE=gnu
92+ ;;
93+ xboth)
94+ LINKER_HASH_STYLE=both
95+ ;;
96+ *)
97+ as_fn_error "$withval is an invalid option to --with-linker-hash-style" "$LINENO" 5
98+ ;;
99+ esac
100+else
101+ LINKER_HASH_STYLE=''
102+fi
103+
104+if test x"${LINKER_HASH_STYLE}" != x; then
105+
106+cat >>confdefs.h <<_ACEOF
107+#define LINKER_HASH_STYLE "$LINKER_HASH_STYLE"
108+_ACEOF
109+
110+fi
111+
112 # Configure the subdirectories
113 # AC_CONFIG_SUBDIRS($subdirs)
114
115Index: gcc-4_6-branch/gcc/configure.ac
116===================================================================
117--- gcc-4_6-branch.orig/gcc/configure.ac 2011-09-09 08:26:15.000000000 -0700
118+++ gcc-4_6-branch/gcc/configure.ac 2011-09-09 08:27:14.162981193 -0700
119@@ -4907,6 +4907,30 @@
120 fi
121
122
123+# Specify what hash style to use by default.
124+AC_ARG_WITH([linker-hash-style],
125+[AC_HELP_STRING([--with-linker-hash-style={sysv,gnu,both}],
126+ [specify the linker hash style])],
127+[case x"$withval" in
128+ xsysv)
129+ LINKER_HASH_STYLE=sysv
130+ ;;
131+ xgnu)
132+ LINKER_HASH_STYLE=gnu
133+ ;;
134+ xboth)
135+ LINKER_HASH_STYLE=both
136+ ;;
137+ *)
138+ AC_MSG_ERROR([$withval is an invalid option to --with-linker-hash-style])
139+ ;;
140+ esac],
141+[LINKER_HASH_STYLE=''])
142+if test x"${LINKER_HASH_STYLE}" != x; then
143+ AC_DEFINE_UNQUOTED(LINKER_HASH_STYLE, "$LINKER_HASH_STYLE",
144+ [The linker hash style])
145+fi
146+
147 # Configure the subdirectories
148 # AC_CONFIG_SUBDIRS($subdirs)
149
150Index: gcc-4_6-branch/gcc/doc/install.texi
151===================================================================
152--- gcc-4_6-branch.orig/gcc/doc/install.texi 2011-06-24 08:13:00.000000000 -0700
153+++ gcc-4_6-branch/gcc/doc/install.texi 2011-09-09 08:27:14.172981215 -0700
154@@ -1665,6 +1665,11 @@
155 support @option{--build-id} option, a warning is issued and the
156 @option{--enable-linker-build-id} option is ignored. The default is off.
157
158+@item --with-linker-hash-style=@var{choice}
159+Tells GCC to pass @option{--hash-style=@var{choice}} option to the
160+linker for all final links. @var{choice} can be one of
161+@samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default.
162+
163 @item --enable-gnu-unique-object
164 @itemx --disable-gnu-unique-object
165 Tells GCC to use the gnu_unique_object relocation for C++ template
166Index: gcc-4_6-branch/gcc/gcc.c
167===================================================================
168--- gcc-4_6-branch.orig/gcc/gcc.c 2011-09-09 08:26:14.000000000 -0700
169+++ gcc-4_6-branch/gcc/gcc.c 2011-09-09 08:27:14.172981215 -0700
170@@ -1427,7 +1427,8 @@
171 }
172 #endif
173
174-#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC
175+#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \
176+ defined LINKER_HASH_STYLE
177 # ifdef LINK_BUILDID_SPEC
178 /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
179 obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof(LINK_BUILDID_SPEC) - 1);
180@@ -1436,6 +1437,16 @@
181 /* Prepend LINK_EH_SPEC to whatever link_spec we had before. */
182 obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1);
183 # endif
184+# ifdef LINKER_HASH_STYLE
185+ /* Prepend --hash-style=LINKER_HASH_STYLE to whatever link_spec we had
186+ before. */
187+ {
188+ static const char hash_style[] = "--hash-style=";
189+ obstack_grow (&obstack, hash_style, sizeof(hash_style) - 1);
190+ obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof(LINKER_HASH_STYLE) - 1);
191+ obstack_1grow (&obstack, ' ');
192+ }
193+# endif
194 obstack_grow0 (&obstack, link_spec, strlen (link_spec));
195 link_spec = XOBFINISH (&obstack, const char *);
196 #endif