summaryrefslogtreecommitdiff
path: root/libssp
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2006-09-29 22:18:51 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2006-09-29 22:18:51 +0100
commitbe14fe72cbae6192bfa999ce25e07ecb0e53fc5f (patch)
tree346dee200c6a0383469b6f2717eb67627098f850 /libssp
parent4a44c1a228783f56c4c4b7e7aeee102115a6696d (diff)
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
Diffstat (limited to 'libssp')
-rw-r--r--libssp/ChangeLog9
-rw-r--r--libssp/Makefile.in1
-rw-r--r--libssp/aclocal.m41
-rwxr-xr-xlibssp/configure76
-rw-r--r--libssp/configure.ac20
5 files changed, 101 insertions, 6 deletions
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 <joseph@codesourcery.com>
+
+ 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 <carlos@codesourcery.com>
* 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
@@ -2299,6 +2300,39 @@ 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 ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
@@ -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([