blob: 97913420e003e329381fd359f5c9593aaed75c67 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 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