This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ping: [PATCH] add configure check for __stack_chk_fail on uClibc
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rep dot dot dot nop at gmail dot com
- Date: Tue, 22 Jan 2008 12:23:23 +0100
- Subject: ping: [PATCH] add configure check for __stack_chk_fail on uClibc
- References: <20080119220132.GE26554@aon.at> <9930fb0a0801191436r20ca3br17cdd1e713d3f66a@mail.gmail.com> <9930fb0a0801191441p2846aab0x75c7152f346cd4a9@mail.gmail.com>
On Sat, Jan 19, 2008 at 11:41:51PM +0100, Bernhard Fischer wrote:
>Hi,
>
>The attached patch adds a check to configure for the availability of
>__stack_check_fail to distinguish whether libssp should or libc does
>provide these functions.
>
>Previously the missing check led to build failures when compiling or
>linking with a SSP-enabled uClibc.
>
>OK for trunk?
>
>PS:
>Can somebody please regenerate configure properly and commit this, if
>it's OKed? Thanks alot in advance.
I'm attaching a corrected version that was properly regenerated.
gcc/ChangeLog:
2008-01-22 Bernhard Fischer <>
* configure.ac (__stack_chk_fail): Add detecion for availability
of SSP in uClibc by checking if __UCLIBC_HAS_SSP__ is defined.
* configure: Regenerate.
Index: gcc-4.3.0/gcc/configure.ac
===================================================================
--- gcc-4.3.0/gcc/configure.ac (revision 131656)
+++ gcc-4.3.0/gcc/configure.ac (working copy)
@@ -3408,8 +3408,14 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
&& $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__GLIBC_MINOR__[ ]+([1-9][0-9]|[4-9])' \
$glibc_header_dir/features.h > /dev/null; then
gcc_cv_libc_provides_ssp=yes
+ elif $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__UCLIBC__[ ]+1' \
+ $glibc_header_dir/features.h > /dev/null && \
+ test -f $glibc_header_dir/bits/uClibc_config.h && \
+ $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__UCLIBC_HAS_SSP__[ ]+1' \
+ $glibc_header_dir/bits/uClibc_config.h > /dev/null; then
+ gcc_cv_libc_provides_ssp=yes
fi
- fi
+ fi
;;
*-*-darwin*)
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
Index: gcc-4.3.0/gcc/configure
===================================================================
--- gcc-4.3.0/gcc/configure (revision 131656)
+++ gcc-4.3.0/gcc/configure (working copy)
@@ -16672,8 +16672,14 @@ else
&& $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC_MINOR__[ ]+([1-9][0-9]|[4-9])' \
$glibc_header_dir/features.h > /dev/null; then
gcc_cv_libc_provides_ssp=yes
+ elif $EGREP '^[ ]*#[ ]*define[ ]+__UCLIBC__[ ]+1' \
+ $glibc_header_dir/features.h > /dev/null && \
+ test -f $glibc_header_dir/bits/uClibc_config.h && \
+ $EGREP '^[ ]*#[ ]*define[ ]+__UCLIBC_HAS_SSP__[ ]+1' \
+ $glibc_header_dir/bits/uClibc_config.h > /dev/null; then
+ gcc_cv_libc_provides_ssp=yes
fi
- fi
+ fi
;;
*-*-darwin*)
echo "$as_me:$LINENO: checking for __stack_chk_fail" >&5