From be14fe72cbae6192bfa999ce25e07ecb0e53fc5f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 29 Sep 2006 22:18:51 +0100 Subject: re PR other/25035 (libssp causes a failure with cross compilers with unified trees) PR other/25035 * configure.ac (AC_EXEEXT): Remove. (GCC_NO_EXECUTABLES): Call. (ssp_use_symver): Default to no if unable to link. (AC_CHECK_FUNCS): Hardwire results if unable to link. * aclocal.m4, configure, Makefile.in: Regenerate. From-SVN: r117318 --- libssp/configure | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 3 deletions(-) (limited to 'libssp/configure') diff --git a/libssp/configure b/libssp/configure index a892313b8eb..dbb7abbd3c1 100755 --- a/libssp/configure +++ b/libssp/configure @@ -1897,6 +1897,7 @@ fi + # Default to --enable-multilib # Check whether --enable-multilib or --disable-multilib was given. if test "${enable_multilib+set}" = set; then @@ -2291,6 +2292,39 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +int +main () +{ + + ; + return 0; +} +_ACEOF +# FIXME: Cleanup? +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + gcc_no_link=no +else + gcc_no_link=yes +fi + +if test x$gcc_no_link = xyes; then + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally + # correct if we can't link. + cross_compiling=yes + EXEEXT= +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { @@ -2435,6 +2469,7 @@ echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT +fi echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then @@ -3422,6 +3457,16 @@ FOO_1.0 { EOF save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" +if test x$gcc_no_link = xyes; then + # If we cannot link, we cannot build shared libraries, so do not use + # symbol versioning. + ssp_use_symver=no +else + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3468,6 +3513,7 @@ ssp_use_symver=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +fi LDFLAGS="$save_LDFLAGS" echo "$as_me:$LINENO: result: $ssp_use_symver" >&5 echo "${ECHO_T}$ssp_use_symver" >&6 @@ -3894,6 +3940,18 @@ fi done +if test x$gcc_no_link = xyes; then + # Presume the ISO C functions are available; add target-specific + # configuration here if required. + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRNCPY 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRNCAT 1 +_ACEOF + +else @@ -3905,7 +3963,12 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3998,6 +4061,7 @@ _ACEOF fi done +fi echo "$as_me:$LINENO: checking whether vsnprintf is usable" >&5 echo $ECHO_N "checking whether vsnprintf is usable... $ECHO_C" >&6 @@ -4468,6 +4532,7 @@ deplibs_check_method=$lt_cv_deplibs_check_method + # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments @@ -4864,7 +4929,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4867 "configure"' > conftest.$ac_ext + echo '#line 4932 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4982,7 +5047,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext -- cgit v1.2.3