This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[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: Sat, 19 Jan 2008 23:01:32 +0100
- Subject: [PATCH] add configure check for __stack_chk_fail on uClibc
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.
gcc/ChangeLog:
2008-01-19 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