diff options
author | Andre McCurdy <armccurdy@gmail.com> | 2015-08-05 17:30:26 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-10 12:40:28 -0700 |
commit | 7137a31245fef41cc51cb819852f8acbed5e2c22 (patch) | |
tree | a44f283a75f24efe13b03d7c216b3a53df6cbbd1 | |
parent | 670244e447d7527e9698dae5306332ea925a4a42 (diff) | |
download | poky-7137a31245fef41cc51cb819852f8acbed5e2c22.tar.gz |
uclibc: backport upstream fix for SH4
Backport upstream fix for building uclibc for SH4 with recent gcc:
http://git.uclibc.org/uClibc/commit/?id=2c8a7766681b704e710f51c0817534e3f9a952d1
(From OE-Core rev: aa20c3dc33d93a9bd8c81a3b7c1f8f6bbb354d0b)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/uclibc/uclibc-git.inc | 1 | ||||
-rw-r--r-- | meta/recipes-core/uclibc/uclibc-git/ldso-mark-_dl_exit-as-noreturn.patch | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc index 8308e603cc..3c489406d9 100644 --- a/meta/recipes-core/uclibc/uclibc-git.inc +++ b/meta/recipes-core/uclibc/uclibc-git.inc | |||
@@ -25,5 +25,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ | |||
25 | file://0002-wire-setns-syscall.patch \ | 25 | file://0002-wire-setns-syscall.patch \ |
26 | file://0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch \ | 26 | file://0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch \ |
27 | file://0001-timex-Sync-with-glibc.patch \ | 27 | file://0001-timex-Sync-with-glibc.patch \ |
28 | file://ldso-mark-_dl_exit-as-noreturn.patch \ | ||
28 | " | 29 | " |
29 | S = "${WORKDIR}/git" | 30 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-core/uclibc/uclibc-git/ldso-mark-_dl_exit-as-noreturn.patch b/meta/recipes-core/uclibc/uclibc-git/ldso-mark-_dl_exit-as-noreturn.patch new file mode 100644 index 0000000000..5279f8a759 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/ldso-mark-_dl_exit-as-noreturn.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 2c8a7766681b704e710f51c0817534e3f9a952d1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | ||
3 | Date: Thu, 26 Mar 2015 00:02:58 +0100 | ||
4 | Subject: [PATCH] ldso: mark _dl_exit as noreturn | ||
5 | |||
6 | Otherwise gcc might not understand that oom() ended control-flow and | ||
7 | might emit an (untaken) reference to abort() in _dl_update_slotinfo() | ||
8 | on e.g. SH4 which breaks linking ld-uClibc.so. | ||
9 | Arguably -ffreestanding should prevent GCC from emitting this | ||
10 | '.global abort' but alas, it does not, which is another bug.. | ||
11 | |||
12 | Also mark the function cold to further lower the incoming frequency and | ||
13 | branch probability. | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | |||
17 | http://git.uclibc.org/uClibc/commit/?id=2c8a7766681b704e710f51c0817534e3f9a952d1 | ||
18 | |||
19 | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | ||
20 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | ||
21 | --- | ||
22 | ldso/include/dl-syscall.h | 10 +++++++++- | ||
23 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
24 | |||
25 | diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h | ||
26 | index 675b93a..e556f7b 100644 | ||
27 | --- a/ldso/include/dl-syscall.h | ||
28 | +++ b/ldso/include/dl-syscall.h | ||
29 | @@ -52,7 +52,15 @@ extern int _dl_errno; | ||
30 | dynamic linking at all, so we cannot return any error codes. | ||
31 | We just punt if there is an error. */ | ||
32 | #define __NR__dl_exit __NR_exit | ||
33 | -static __always_inline _syscall1(void, _dl_exit, int, status) | ||
34 | +static __always_inline attribute_noreturn __cold void _dl_exit(int status) | ||
35 | +{ | ||
36 | + INLINE_SYSCALL(_dl_exit, 1, status); | ||
37 | +#if defined __GNUC__ | ||
38 | + __builtin_unreachable(); /* shut up warning: 'noreturn' function does return*/ | ||
39 | +#else | ||
40 | + while (1); | ||
41 | +#endif | ||
42 | +} | ||
43 | |||
44 | #define __NR__dl_close __NR_close | ||
45 | static __always_inline _syscall1(int, _dl_close, int, fd) | ||
46 | -- | ||
47 | 1.9.1 | ||
48 | |||