summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-03-28 04:00:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-29 23:20:13 +0100
commit6dff6392d8286a52d2b3cc921dc3939c8e5cc095 (patch)
treeea5f7a3079e2dbea482ab666ce390639789d4f0d /meta/recipes-devtools/gcc
parentab206592881ec94a4905c4185933e669219831b7 (diff)
downloadpoky-6dff6392d8286a52d2b3cc921dc3939c8e5cc095.tar.gz
gcc: Backport fixes for musl ssp configuration
We were trying to inject cached configure variables via EXTRA_OECONF, but that was not working due to the fact that gcc configure is called recursively via makefiles and hence these were getting lost. These backports from master fixes the problem by defining the options in configure itself dl_iterate_phdr is provided by musl as well, so lets not depend on glibc defines like inhibit_libc alone (From OE-Core rev: b3f80743cd1b9a15a8ee4d20c2a54c2f6cbcd13c) 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')
-rw-r--r--meta/recipes-devtools/gcc/gcc-5.3.inc3
-rw-r--r--meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch85
-rw-r--r--meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch42
3 files changed, 129 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc
index aa011fd03d..4adafd50fe 100644
--- a/meta/recipes-devtools/gcc/gcc-5.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -85,6 +85,8 @@ SRC_URI = "\
85 file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \ 85 file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \
86 file://0054-support-ffile-prefix-map.patch \ 86 file://0054-support-ffile-prefix-map.patch \
87 file://0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \ 87 file://0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
88 file://0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch \
89 file://0057-unwind-fix-for-musl.patch \
88" 90"
89 91
90BACKPORTS = "" 92BACKPORTS = ""
@@ -132,7 +134,6 @@ EXTRA_OECONF_INITIAL = "\
132" 134"
133 135
134EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float " 136EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
135EXTRA_OECONF_append_libc-musl = " gcc_cv_libc_provides_ssp=yes gcc_cv_target_dl_iterate_phdr=yes "
136 137
137EXTRA_OECONF_PATHS = "\ 138EXTRA_OECONF_PATHS = "\
138 --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \ 139 --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch b/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
new file mode 100644
index 0000000000..97913420e0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
@@ -0,0 +1,85 @@
1From 5c7bd853c8703f65904083778712ef625c3f3814 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 Mar 2016 20:31:50 -0700
4Subject: [PATCH 56/57] Enable libc provide ssp and
5 gcc_cv_target_dl_iterate_phdr for musl
6
7 * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*.
8 (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*.
9 * configure: Regenerate.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13Upstream-Status: Backport
14
15 gcc/configure | 7 +++++++
16 gcc/configure.ac | 7 +++++++
17 2 files changed, 14 insertions(+)
18
19diff --git a/gcc/configure b/gcc/configure
20index fcb05e7..81a449c 100755
21--- a/gcc/configure
22+++ b/gcc/configure
23@@ -27814,6 +27814,9 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then :
24 else
25 gcc_cv_libc_provides_ssp=no
26 case "$target" in
27+ *-*-musl*)
28+ # All versions of musl provide stack protector
29+ gcc_cv_libc_provides_ssp=yes;;
30 *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
31 # glibc 2.4 and later provides __stack_chk_fail and
32 # either __stack_chk_guard, or TLS access to stack guard canary.
33@@ -27846,6 +27849,7 @@ fi
34 # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
35 # simply assert that glibc does provide this, which is true for all
36 # realistically usable GNU/Hurd configurations.
37+ # All supported versions of musl provide it as well
38 gcc_cv_libc_provides_ssp=yes;;
39 *-*-darwin* | *-*-freebsd*)
40 ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
41@@ -27942,6 +27946,9 @@ case "$target" in
42 gcc_cv_target_dl_iterate_phdr=no
43 fi
44 ;;
45+ *-linux-musl*)
46+ gcc_cv_target_dl_iterate_phdr=yes
47+ ;;
48 esac
49
50 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
51diff --git a/gcc/configure.ac b/gcc/configure.ac
52index 923bc9a..b08e3dc 100644
53--- a/gcc/configure.ac
54+++ b/gcc/configure.ac
55@@ -5291,6 +5291,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
56 gcc_cv_libc_provides_ssp,
57 [gcc_cv_libc_provides_ssp=no
58 case "$target" in
59+ *-*-musl*)
60+ # All versions of musl provide stack protector
61+ gcc_cv_libc_provides_ssp=yes;;
62 *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
63 # glibc 2.4 and later provides __stack_chk_fail and
64 # either __stack_chk_guard, or TLS access to stack guard canary.
65@@ -5317,6 +5320,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
66 # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
67 # simply assert that glibc does provide this, which is true for all
68 # realistically usable GNU/Hurd configurations.
69+ # All supported versions of musl provide it as well
70 gcc_cv_libc_provides_ssp=yes;;
71 *-*-darwin* | *-*-freebsd*)
72 AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
73@@ -5390,6 +5394,9 @@ case "$target" in
74 gcc_cv_target_dl_iterate_phdr=no
75 fi
76 ;;
77+ *-linux-musl*)
78+ gcc_cv_target_dl_iterate_phdr=yes
79+ ;;
80 esac
81 GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
82 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
83--
842.7.4
85
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch b/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
new file mode 100644
index 0000000000..c193587bf9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
@@ -0,0 +1,42 @@
1From c5c33bf881a2aea355310dd90873ed39bc272b3c Mon Sep 17 00:00:00 2001
2From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 22 Apr 2015 14:20:01 +0000
4Subject: [PATCH 57/57] unwind fix for musl
5
6On behalf of szabolcs.nagy@arm.com
7
82015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
9 Szabolcs Nagy <szabolcs.nagy@arm.com>
10
11 * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on
12 Linux if target provides dl_iterate_phdr.
13
14git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18Upstream-Status: Backport
19
20 libgcc/unwind-dw2-fde-dip.c | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
24index e1e566b..137dced 100644
25--- a/libgcc/unwind-dw2-fde-dip.c
26+++ b/libgcc/unwind-dw2-fde-dip.c
27@@ -59,6 +59,12 @@
28
29 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
30 && defined(TARGET_DL_ITERATE_PHDR) \
31+ && defined(__linux__)
32+# define USE_PT_GNU_EH_FRAME
33+#endif
34+
35+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
36+ && defined(TARGET_DL_ITERATE_PHDR) \
37 && (defined(__DragonFly__) || defined(__FreeBSD__))
38 # define ElfW __ElfN
39 # define USE_PT_GNU_EH_FRAME
40--
412.7.4
42