summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-10-20 12:18:14 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-30 16:38:04 +0000
commit52dc5edde36f7bd9a94277cc9390e273fc0df9b6 (patch)
tree6fdfed9e5e017b0ff00ffc00c21b0232032331c7 /meta/recipes-devtools/gcc/gcc-4.6
parent9d086cd1519b95bff27ca1cda4555ffae92c5ce3 (diff)
downloadpoky-52dc5edde36f7bd9a94277cc9390e273fc0df9b6.tar.gz
gcc-4.6: Backport fix for PR32219
This fix is needed for gold to work. Otherwise connman fails to build since it used hidden weak symbols. See http://gcc.gnu.org/bugzilla/PR32219 http://www.cygwin.com/ml/binutils/2008-02/msg00239.html The fix proposed to gcc had reviews which were not addressed hence the patch is not yet applied to gcc upstream. connman can also have workaround by changing the visibility of these symbols to be default __attribute__ ((weak, visibility("hidden"))) to __attribute__ ((weak, visibility("default"))) in include/plugin.h (From OE-Core rev: 3cb2b003db7371b3a47d02c08352a262e1e419b4) (From OE-Core rev: 9a160921a16c9c37e07e4b5cb30e37348ecd205b) 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/pr32219.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch b/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch
new file mode 100644
index 0000000000..e310080a30
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch
@@ -0,0 +1,71 @@
1Hi,
2
3As suggested by richi.
4regtested on i686-linux-gnu with all default languages and no regressions.
5Ok for trunk?
6
7gcc/ChangeLog
82010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9
10 PR target/32219
11 * varasm.c (default_binds_local_p_1): Weak data is not local.
12
13gcc/testsuite/ChangeLog
142010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
15
16 PR target/32219
17 * gcc.dg/visibility-21.c: New test.
18
19Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
20---
21 gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++
22 gcc/varasm.c | 8 ++++----
23 2 files changed, 18 insertions(+), 4 deletions(-)
24 create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c
25
26Index: gcc-4_6-branch/gcc/testsuite/gcc.dg/visibility-21.c
27===================================================================
28--- /dev/null 1970-01-01 00:00:00.000000000 +0000
29+++ gcc-4_6-branch/gcc/testsuite/gcc.dg/visibility-21.c 2011-10-18 17:11:33.224827436 -0700
30@@ -0,0 +1,14 @@
31+/* PR target/32219 */
32+/* { dg-do run } */
33+/* { dg-require-visibility "" } */
34+/* { dg-options "-fPIC" { target fpic } } */
35+
36+extern void f() __attribute__((weak,visibility("hidden")));
37+extern int puts( char const* );
38+int main()
39+{
40+ if (f)
41+ f();
42+ return 0;
43+}
44+
45Index: gcc-4_6-branch/gcc/varasm.c
46===================================================================
47--- gcc-4_6-branch.orig/gcc/varasm.c 2011-09-16 19:58:21.000000000 -0700
48+++ gcc-4_6-branch/gcc/varasm.c 2011-10-18 17:19:06.431074788 -0700
49@@ -6760,6 +6760,10 @@
50 /* Static variables are always local. */
51 else if (! TREE_PUBLIC (exp))
52 local_p = true;
53+ /* hidden weak can't be overridden by something non-local, all
54+ that is possible is that it is not defined at all. */
55+ else if (DECL_WEAK (exp))
56+ local_p = false;
57 /* A variable is local if the user has said explicitly that it will
58 be. */
59 else if ((DECL_VISIBILITY_SPECIFIED (exp)
60@@ -6773,11 +6777,6 @@
61 local. */
62 else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
63 local_p = true;
64- /* Default visibility weak data can be overridden by a strong symbol
65- in another module and so are not local. */
66- else if (DECL_WEAK (exp)
67- && !resolved_locally)
68- local_p = false;
69 /* If PIC, then assume that any global name can be overridden by
70 symbols resolved from other modules. */
71 else if (shlib)