summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-10-14 17:43:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:24:25 +0000
commit8bb6436295cfe4329ced0d01a4076662b59637b8 (patch)
tree0f2ad69e3b350087e0349de229da833e6806e8fb
parente5e8fce81a0501040235b2f680e1724d40f2f30e (diff)
downloadpoky-8bb6436295cfe4329ced0d01a4076662b59637b8.tar.gz
uclibc: Fix build with gcc5
An agressive optimization in gcc5 meant that we get linking errors with uclibc build, this patch fixes the issue by letting gcc know that these funcitons are used. Change-Id: I8ecf3999a0855b3bbf4bc2df576be5351f9be5b0 (From OE-Core rev: 458bfefecdd2b5e2efa743f29d3dc8b3471e6df1) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/uclibc/uclibc-git.inc1
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch51
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc
index 14a577f432..9e3d64408c 100644
--- a/meta/recipes-core/uclibc/uclibc-git.inc
+++ b/meta/recipes-core/uclibc/uclibc-git.inc
@@ -16,5 +16,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \
16 file://0005-Always-use-O2-for-compiling-fork.c.patch \ 16 file://0005-Always-use-O2-for-compiling-fork.c.patch \
17 file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ 17 file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \
18 file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ 18 file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \
19 file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \
19" 20"
20S = "${WORKDIR}/git" 21S = "${WORKDIR}/git"
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch b/meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch
new file mode 100644
index 0000000000..e622f87ba9
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch
@@ -0,0 +1,51 @@
1From 2659fb25d32f4b29c1c96aa5730fe40e19d53ab0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 14 Oct 2015 17:38:37 -0700
4Subject: [PATCH] gcc5 optimizes away the write only static functions and we
5 end up with
6
7 librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume':
8 rt-unwind-resume.c:(.text+0x3c): undefined reference to `libgcc_s_resume'
9 collect2: error: ld returned 1 exit status
10 make[2]: *** [lib/librt.so] Error 1
11
12marking these functions explicitly used with __attribute_used__ avoids
13that optimization.
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17Upstream-Status: Pending
18
19 libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 2 +-
20 libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 2 +-
21 2 files changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
24index f4d6f41..0c2edd7 100644
25--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
26+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
27@@ -27,7 +27,7 @@
28 #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();}
29
30 static void *libgcc_s_handle;
31-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
32+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
33 static _Unwind_Reason_Code (*libgcc_s_personality)
34 (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
35 static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
36diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
37index f9a4ffb..f0c3047 100644
38--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
39+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
40@@ -25,7 +25,7 @@
41 #define __libc_dlclose dlclose
42 #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();}
43
44-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
45+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
46 static _Unwind_Reason_Code (*libgcc_s_personality)
47 (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
48
49--
502.6.1
51