This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ping: [PATCH] add configure check for __stack_chk_fail on uClibc


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]