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/ChangeLog | 9 +++++++ libssp/Makefile.in | 1 + libssp/aclocal.m4 | 1 + libssp/configure | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++--- libssp/configure.ac | 20 +++++++++++--- 5 files changed, 101 insertions(+), 6 deletions(-) (limited to 'libssp') diff --git a/libssp/ChangeLog b/libssp/ChangeLog index fcadf7b24c0..60d9a19d831 100644 --- a/libssp/ChangeLog +++ b/libssp/ChangeLog @@ -1,3 +1,12 @@ +2006-09-29 Joseph S. Myers + + 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. + 2006-05-23 Carlos O'Donell * Makefile.am: Add install-html target. Add install-html to .PHONY diff --git a/libssp/Makefile.in b/libssp/Makefile.in index 61fcffd5ec9..b098221eb50 100644 --- a/libssp/Makefile.in +++ b/libssp/Makefile.in @@ -53,6 +53,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) diff --git a/libssp/aclocal.m4 b/libssp/aclocal.m4 index 576735e1b47..7777acfc6d7 100644 --- a/libssp/aclocal.m4 +++ b/libssp/aclocal.m4 @@ -917,4 +917,5 @@ AC_SUBST([am__untar]) m4_include([../config/acx.m4]) m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) +m4_include([../config/no-executables.m4]) m4_include([../libtool.m4]) 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 diff --git a/libssp/configure.ac b/libssp/configure.ac index f8ed70c5105..99b4edfe104 100644 --- a/libssp/configure.ac +++ b/libssp/configure.ac @@ -22,7 +22,8 @@ AC_ARG_ENABLE(version-specific-runtime-libs, AC_MSG_RESULT($version_specific_libs) AM_MAINTAINER_MODE -AC_EXEEXT + +GCC_NO_EXECUTABLES AM_ENABLE_MULTILIB(, ..) @@ -78,14 +79,27 @@ FOO_1.0 { EOF save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" -AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no]) +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 + AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no]) +fi LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT($ssp_use_symver) AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" = xyes]) AC_CHECK_HEADERS(alloca.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h) -AC_CHECK_FUNCS(mempcpy strncpy strncat) +if test x$gcc_no_link = xyes; then + # Presume the ISO C functions are available; add target-specific + # configuration here if required. + AC_DEFINE(HAVE_STRNCPY) + AC_DEFINE(HAVE_STRNCAT) +else + AC_CHECK_FUNCS(mempcpy strncpy strncat) +fi AC_MSG_CHECKING([whether vsnprintf is usable]) AC_RUN_IFELSE(AC_LANG_PROGRAM([ -- cgit v1.2.1