summaryrefslogtreecommitdiff
path: root/libssp
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2010-07-02 10:15:09 +0000
committerRainer Orth <ro@gcc.gnu.org>2010-07-02 10:15:09 +0000
commitca6d1176f717cfb0ba3e0ea1a930aa3d33905a9e (patch)
tree68173ee2d5bd4b1b5fc1a277f153743209eb7dda /libssp
parentbaf7c318bbcad3acee65f8400c34665b9345f09a (diff)
downloadgcc-ca6d1176f717cfb0ba3e0ea1a930aa3d33905a9e.tar.gz
configure.ac: Check for Sun symbol versioning.
* configure.ac: Check for Sun symbol versioning. Check for memmove. * configure: Regenerate. * config.h.in: Regenerate. * Makefile.am [LIBSSP_USE_SYMVER]: Protect version_arg, version_dep with LIBSSP_USE_SYMVER_GNU. [LIBSSP_USE_SYMVER_SUN]: Handle Sun symbol versioning. * Makefile.in: Regenerate. * ssp.map: Reformat. * memmove-chk.c: Change guard to HAVE_MEMMOVE. From-SVN: r161699
Diffstat (limited to 'libssp')
-rw-r--r--libssp/ChangeLog16
-rw-r--r--libssp/Makefile.am17
-rw-r--r--libssp/Makefile.in15
-rw-r--r--libssp/config.h.in3
-rwxr-xr-xlibssp/configure85
-rw-r--r--libssp/configure.ac35
-rw-r--r--libssp/memmove-chk.c4
-rw-r--r--libssp/ssp.map21
8 files changed, 163 insertions, 33 deletions
diff --git a/libssp/ChangeLog b/libssp/ChangeLog
index 1745d5b5f07..e947735b7a6 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Check for Sun symbol versioning.
+ Check for memmove.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+ * Makefile.am [LIBSSP_USE_SYMVER]: Protect version_arg,
+ version_dep with LIBSSP_USE_SYMVER_GNU.
+ [LIBSSP_USE_SYMVER_SUN]: Handle Sun symbol versioning.
+ * Makefile.in: Regenerate.
+
+ * ssp.map: Reformat.
+
+ * memmove-chk.c: Change guard to HAVE_MEMMOVE.
+
2010-05-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR other/43620
diff --git a/libssp/Makefile.am b/libssp/Makefile.am
index 7b6e9465084..e25bd8458ce 100644
--- a/libssp/Makefile.am
+++ b/libssp/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the toplevel directory of the libssp library.
##
-## Copyright (C) 2005
+## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
## Free Software Foundation, Inc.
##
@@ -12,8 +12,23 @@ MAINT_CHARSET = latin1
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
if LIBSSP_USE_SYMVER
+if LIBSSP_USE_SYMVER_GNU
version_arg = -Wl,--version-script=$(srcdir)/ssp.map
version_dep = $(srcdir)/ssp.map
+endif
+if LIBSSP_USE_SYMVER_SUN
+version_arg = -Wl,-M,ssp.map-sun
+version_dep = ssp.map-sun
+ssp.map-sun : $(srcdir)/ssp.map \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libssp_la_OBJECTS) $(libssp_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/ssp.map \
+ $(libssp_la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libssp_la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
else
version_arg =
version_dep =
diff --git a/libssp/Makefile.in b/libssp/Makefile.in
index e70d622b3f6..d9f952fd50c 100644
--- a/libssp/Makefile.in
+++ b/libssp/Makefile.in
@@ -250,9 +250,11 @@ MAINT_CHARSET = latin1
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@LIBSSP_USE_SYMVER_FALSE@version_arg =
-@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,-M,ssp.map-sun
@LIBSSP_USE_SYMVER_FALSE@version_dep =
-@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = ssp.map-sun
AM_CFLAGS = -Wall
toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
@@ -694,6 +696,15 @@ uninstall-am: uninstall-nobase_libsubincludeHEADERS \
uninstall-am uninstall-nobase_libsubincludeHEADERS \
uninstall-toolexeclibLTLIBRARIES
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ssp.map-sun : $(srcdir)/ssp.map \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(libssp_la_OBJECTS) $(libssp_la_LIBADD)
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(srcdir)/ssp.map \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(libssp_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ `echo $(libssp_la_LIBADD) | \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libssp/config.h.in b/libssp/config.h.in
index d55c0f18b86..2815ce7c4d5 100644
--- a/libssp/config.h.in
+++ b/libssp/config.h.in
@@ -21,6 +21,9 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff --git a/libssp/configure b/libssp/configure
index d5e83844f01..7722c954148 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -625,6 +625,10 @@ LIBTOOL
ssp_have_usable_vsnprintf
EGREP
GREP
+LIBSSP_USE_SYMVER_SUN_FALSE
+LIBSSP_USE_SYMVER_SUN_TRUE
+LIBSSP_USE_SYMVER_GNU_FALSE
+LIBSSP_USE_SYMVER_GNU_TRUE
LIBSSP_USE_SYMVER_FALSE
LIBSSP_USE_SYMVER_TRUE
CPP
@@ -4093,18 +4097,18 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
$as_echo_n "checking whether symbol versioning is supported... " >&6; }
-cat > conftest.map <<EOF
-FOO_1.0 {
- global: *foo*; bar; local: *;
-};
-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
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
if test x$gcc_no_link = xyes; then
as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
fi
@@ -4120,17 +4124,48 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ssp_use_symver=yes
+ ssp_use_symver=gnu
else
ssp_use_symver=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ if test x$ssp_use_symver = xno; then
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ssp_use_symver=sun
+else
+ ssp_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ LDFLAGS="$save_LDFLAGS"
fi
-LDFLAGS="$save_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssp_use_symver" >&5
$as_echo "$ssp_use_symver" >&6; }
- if test "x$ssp_use_symver" = xyes; then
+ if test "x$ssp_use_symver" != xno; then
LIBSSP_USE_SYMVER_TRUE=
LIBSSP_USE_SYMVER_FALSE='#'
else
@@ -4138,6 +4173,22 @@ else
LIBSSP_USE_SYMVER_FALSE=
fi
+ if test "x$ssp_use_symver" = xgnu; then
+ LIBSSP_USE_SYMVER_GNU_TRUE=
+ LIBSSP_USE_SYMVER_GNU_FALSE='#'
+else
+ LIBSSP_USE_SYMVER_GNU_TRUE='#'
+ LIBSSP_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$ssp_use_symver" = xsun; then
+ LIBSSP_USE_SYMVER_SUN_TRUE=
+ LIBSSP_USE_SYMVER_SUN_FALSE='#'
+else
+ LIBSSP_USE_SYMVER_SUN_TRUE='#'
+ LIBSSP_USE_SYMVER_SUN_FALSE=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
@@ -4423,7 +4474,7 @@ if test x$gcc_no_link = xyes; then
$as_echo "#define HAVE_STRNCAT 1" >>confdefs.h
else
- for ac_func in mempcpy strncpy strncat
+ for ac_func in memmove mempcpy strncpy strncat
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -10591,7 +10642,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10594 "configure"
+#line 10645 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10697,7 +10748,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10700 "configure"
+#line 10751 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11096,6 +11147,14 @@ if test -z "${LIBSSP_USE_SYMVER_TRUE}" && test -z "${LIBSSP_USE_SYMVER_FALSE}";
as_fn_error "conditional \"LIBSSP_USE_SYMVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBSSP_USE_SYMVER_GNU_TRUE}" && test -z "${LIBSSP_USE_SYMVER_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBSSP_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBSSP_USE_SYMVER_SUN_TRUE}" && test -z "${LIBSSP_USE_SYMVER_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBSSP_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
diff --git a/libssp/configure.ac b/libssp/configure.ac
index 8192167a32d..005e3bd2260 100644
--- a/libssp/configure.ac
+++ b/libssp/configure.ac
@@ -72,23 +72,36 @@ if test x$ssp_hidden = xyes; then
fi
AC_MSG_CHECKING([whether symbol versioning is supported])
-cat > conftest.map <<EOF
-FOO_1.0 {
- global: *foo*; bar; local: *;
-};
-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
- AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no])
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[ssp_use_symver=gnu],[ssp_use_symver=no])
+ if test x$ssp_use_symver = xno; then
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[ssp_use_symver=sun],[ssp_use_symver=no])
+ fi
+ LDFLAGS="$save_LDFLAGS"
fi
-LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($ssp_use_symver)
-AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" = xyes])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" != xno])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER_SUN, [test "x$ssp_use_symver" = xsun])
AC_CHECK_HEADERS(alloca.h malloc.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h)
@@ -98,7 +111,7 @@ if test x$gcc_no_link = xyes; then
AC_DEFINE(HAVE_STRNCPY)
AC_DEFINE(HAVE_STRNCAT)
else
- AC_CHECK_FUNCS(mempcpy strncpy strncat)
+ AC_CHECK_FUNCS(memmove mempcpy strncpy strncat)
fi
AC_MSG_CHECKING([whether vsnprintf is usable])
diff --git a/libssp/memmove-chk.c b/libssp/memmove-chk.c
index 3e2904a3b0d..c28e1b59f2f 100644
--- a/libssp/memmove-chk.c
+++ b/libssp/memmove-chk.c
@@ -1,5 +1,5 @@
/* Checking memmove.
- Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -40,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
extern void __chk_fail (void) __attribute__((__noreturn__));
-#ifdef HAVE_MEMPCPY
+#ifdef HAVE_MEMMOVE
void *
__memmove_chk (void *dest, const void *src, size_t len, size_t slen)
{
diff --git a/libssp/ssp.map b/libssp/ssp.map
index 76c233562a7..34de964e368 100644
--- a/libssp/ssp.map
+++ b/libssp/ssp.map
@@ -1,9 +1,22 @@
LIBSSP_1.0 {
global:
- __stack_chk_fail; __stack_chk_guard; __chk_fail;
- __gets_chk; __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk;
- __snprintf_chk; __sprintf_chk; __stpcpy_chk; __strcat_chk; __strcpy_chk;
- __strncat_chk; __strncpy_chk; __vsnprintf_chk; __vsprintf_chk;
+ __stack_chk_fail;
+ __stack_chk_guard;
+ __chk_fail;
+ __gets_chk;
+ __memcpy_chk;
+ __memmove_chk;
+ __mempcpy_chk;
+ __memset_chk;
+ __snprintf_chk;
+ __sprintf_chk;
+ __stpcpy_chk;
+ __strcat_chk;
+ __strcpy_chk;
+ __strncat_chk;
+ __strncpy_chk;
+ __vsnprintf_chk;
+ __vsprintf_chk;
local:
*;
};