uclibc: Fix build with gcc5
PATCH 1/1 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.
--- meta/recipes-core/uclibc/uclibc-git.inc | 1 + ...zes-away-the-write-only-static-functions-.patch | 51 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch
meta/recipes-core/uclibc/uclibc-git.inc +1 -0
@@ -16,5 +16,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ file://0005-Always-use-O2-for-compiling-fork.c.patch \ file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ + file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \ " S = "${WORKDIR}/git"
meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.6.1
please backport this to jethro as well. with out this uclibc images won't build.
Quoted 83 lines · Khem Raj
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 I8ecf3999a0855b3bbf4bc2df576be5351f9be5b0Signed-off-by Khem Raj <[email protected]>--- meta/recipes-core/uclibc/uclibc-git.inc | 1 + ...zes-away-the-write-only-static-functions-.patch | 51 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patchmeta/recipes-core/uclibc/uclibc-git.inc +1
-0@@ -16,5 +16,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ file://0005-Always-use-O2-for-compiling-fork.c.patch \ file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ + file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \ " S = "${WORKDIR}/git"meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch new file +51
-1@@ -0,0 +1,51 @@ +From 2659fb25d32f4b29c1c96aa5730fe40e19d53ab0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 14 Oct 2015 17:38:37 -0700 +Subject: [PATCH] gcc5 optimizes away the write only static functions and we + end up with + + librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume': + rt-unwind-resume.c:(.text+0x3c): undefined reference to `libgcc_s_resume' + collect2: error: ld returned 1 exit status + make[2]: *** [lib/librt.so] Error 1 + +marking these functions explicitly used with __attribute_used__ avoids +that optimization. + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 2 +- + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +index f4d6f41..0c2edd7 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +@@ -27,7 +27,7 @@ + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + + static void *libgcc_s_handle; +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + static _Unwind_Reason_Code (*libgcc_s_forcedunwind) +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +index f9a4ffb..f0c3047 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +@@ -25,7 +25,7 @@ + #define __libc_dlclose dlclose + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + +-- +2.6.1 + --2.6.1
Quoted 3 lines · Khem Raj
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.
Just for reference, the same fix has been in uclibc-ng since June:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=96807d27a3ea01f427b6b98618ca87e9c1c00683
It looks like uclibc-ng is really becoming the new upstream for uclibc.
Quoted 84 lines
Change-Id I8ecf3999a0855b3bbf4bc2df576be5351f9be5b0Signed-off-by Khem Raj <[email protected]>--- meta/recipes-core/uclibc/uclibc-git.inc | 1 + ...zes-away-the-write-only-static-functions-.patch | 51 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patchmeta/recipes-core/uclibc/uclibc-git.inc +1
-0@@ -16,5 +16,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ file://0005-Always-use-O2-for-compiling-fork.c.patch \ file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ + file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \ " S = "${WORKDIR}/git"meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch new file +51
-1@@ -0,0 +1,51 @@ +From 2659fb25d32f4b29c1c96aa5730fe40e19d53ab0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 14 Oct 2015 17:38:37 -0700 +Subject: [PATCH] gcc5 optimizes away the write only static functions and we + end up with + + librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume': + rt-unwind-resume.c:(.text+0x3c): undefined reference to `libgcc_s_resume' + collect2: error: ld returned 1 exit status + make[2]: *** [lib/librt.so] Error 1 + +marking these functions explicitly used with __attribute_used__ avoids +that optimization. + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 2 +- + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +index f4d6f41..0c2edd7 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +@@ -27,7 +27,7 @@ + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + + static void *libgcc_s_handle; +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + static _Unwind_Reason_Code (*libgcc_s_forcedunwind) +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +index f9a4ffb..f0c3047 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +@@ -25,7 +25,7 @@ + #define __libc_dlclose dlclose + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + +-- +2.6.1 + --2.6.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 9 lines · Andre McCurdy
Quoted 3 lines · Khem Raj
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.
Just for reference, the same fix has been in uclibc-ng since June:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=96807d27a3ea01f427b6b98618ca87e9c1c00683
ah nice.
Quoted 1 line
It looks like uclibc-ng is really becoming the new upstream for uclibc.
yeah they should submit the patches to uclibc upstream and take more active role.
Quoted 86 lines
Quoted 86 lines
Change-Id I8ecf3999a0855b3bbf4bc2df576be5351f9be5b0Signed-off-by Khem Raj <[email protected]>--- meta/recipes-core/uclibc/uclibc-git.inc | 1 + ...zes-away-the-write-only-static-functions-.patch | 51 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patchmeta/recipes-core/uclibc/uclibc-git.inc +1
-0@@ -16,5 +16,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ file://0005-Always-use-O2-for-compiling-fork.c.patch \ file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ + file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \ " S = "${WORKDIR}/git"meta/recipes-core/uclibc/uclibc-git/0001-gcc5-optimizes-away-the-write-only-static-functions-.patch new file +51
-1@@ -0,0 +1,51 @@ +From 2659fb25d32f4b29c1c96aa5730fe40e19d53ab0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 14 Oct 2015 17:38:37 -0700 +Subject: [PATCH] gcc5 optimizes away the write only static functions and we + end up with + + librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume': + rt-unwind-resume.c:(.text+0x3c): undefined reference to `libgcc_s_resume' + collect2: error: ld returned 1 exit status + make[2]: *** [lib/librt.so] Error 1 + +marking these functions explicitly used with __attribute_used__ avoids +that optimization. + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 2 +- + libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +index f4d6f41..0c2edd7 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +@@ -27,7 +27,7 @@ + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + + static void *libgcc_s_handle; +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + static _Unwind_Reason_Code (*libgcc_s_forcedunwind) +diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +index f9a4ffb..f0c3047 100644 +--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c ++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +@@ -25,7 +25,7 @@ + #define __libc_dlclose dlclose + #define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();} + +-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); ++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__; + static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + +-- +2.6.1 + --2.6.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core