Commit c98b201b by Phil Edwards

acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Also check version.

2002-02-20  Phil Edwards  <pme@gcc.gnu.org>

	* acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES):  Also check version.
	(GLIBCPP_ENABLE_SYMVERS):  Redo logic, use linker version.
	* configure.in (GLIBCPP_ENABLE_SYMVERS):  Move later in the script.
	* aclocal.m4:  Regenerate.
	* configure:  Regenerate.
	* config/linker-map.dummy:  New file.  Contains nothing useful.

From-SVN: r49913
parent 59bef189
2002-02-20 Phil Edwards <pme@gcc.gnu.org>
* acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Also check version.
(GLIBCPP_ENABLE_SYMVERS): Redo logic, use linker version.
* configure.in (GLIBCPP_ENABLE_SYMVERS): Move later in the script.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config/linker-map.dummy: New file. Contains nothing useful.
2002-02-20 Benjamin Kosnik <bkoz@redhat.com> 2002-02-20 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/22_locale/money_put_members_char.cc: Fix. * testsuite/22_locale/money_put_members_char.cc: Fix.
......
...@@ -49,6 +49,7 @@ AC_SUBST(glibcpp_srcdir) ...@@ -49,6 +49,7 @@ AC_SUBST(glibcpp_srcdir)
dnl This is here just to satisfy automake. dnl This is here just to satisfy automake.
ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)]) ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
AC_PROG_AWK
# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
# be 'cp -p' if linking isn't available. # be 'cp -p' if linking isn't available.
#ac_cv_prog_LN_S='cp -p' #ac_cv_prog_LN_S='cp -p'
...@@ -280,6 +281,8 @@ dnl safe (like an empty string). ...@@ -280,6 +281,8 @@ dnl safe (like an empty string).
dnl dnl
dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible. dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
dnl Define OPT_LDFLAGS='-Wl,-O1' if possible. dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
dnl side-effects of testing.
dnl dnl
dnl GLIBCPP_CHECK_LINKER_FEATURES dnl GLIBCPP_CHECK_LINKER_FEATURES
AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
...@@ -290,8 +293,32 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [ ...@@ -290,8 +293,32 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD]) AC_REQUIRE([AC_PROG_LD])
# The name set by libtool depends on the version of libtool. Shame on us
# for depending on an impl detail, but c'est la vie. Older versions used
# ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
# top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
# makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
# set (hence we're using an older libtool), then set it.
if test x${with_gnu_ld+set} != xset; then
if test x${ac_cv_prog_gnu_ld+set} != xset; then
# We got through "ac_require(ac_prog_ld)" and still not set? Huh?
with_gnu_ld=no
else
with_gnu_ld=$ac_cv_prog_gnu_ld
fi
fi
# Start by getting the version number. I think the libtool test already
# does some of this, but throws away the result.
changequote(,)
ldver=`$LD --version 2>/dev/null | head -1 | \
sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
changequote([,])
glibcpp_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
# Set --gc-sections. # Set --gc-sections.
if test "$ac_cv_prog_gnu_ld" = "notbroken"; then if test "$with_gnu_ld" = "notbroken"; then
# GNU ld it is! Joy and bunny rabbits! # GNU ld it is! Joy and bunny rabbits!
# All these tests are for C++; save the language and the compiler flags. # All these tests are for C++; save the language and the compiler flags.
...@@ -329,7 +356,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [ ...@@ -329,7 +356,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
fi fi
# Set linker optimization flags. # Set linker optimization flags.
if test x"$ac_cv_prog_gnu_ld" = x"yes" && if test x"$with_gnu_ld" = x"yes" &&
test x"$enable_debug" = x"no"; then test x"$enable_debug" = x"no"; then
OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi fi
...@@ -2009,52 +2036,67 @@ dnl Add version tags to symbols in shared library (or not), additionally ...@@ -2009,52 +2036,67 @@ dnl Add version tags to symbols in shared library (or not), additionally
dnl marking other symbols as private/local (or not). dnl marking other symbols as private/local (or not).
dnl dnl
dnl GLIBCPP_ENABLE_SYMVERS dnl GLIBCPP_ENABLE_SYMVERS
dnl --enable-symvers adds a version script to the linker call when creating dnl --enable-symvers=style adds a version script to the linker call when
dnl the shared library. dnl creating the shared library. The choice of version script is
dnl controlled by 'style'.
dnl --disable-symvers does not. dnl --disable-symvers does not.
dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)] dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'. dnl defaults to `no'. Passing `yes' tries to choose a default style
dnl based on linker characteristics.
AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
AC_REQUIRE([AC_PROG_LD])
define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(symvers, AC_ARG_ENABLE(symvers,
changequote(<<, >>)dnl changequote(<<, >>)dnl
<< --enable-symvers enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT], << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
changequote([, ])dnl changequote([, ])dnl
[case "$enableval" in [case "$enableval" in
yes) enable_symvers=yes ;; yes) enable_symvers=default ;;
no) enable_symvers=no ;; no) enable_symvers=no ;;
# other names here, just as sanity checks
#gnu|sun|etcetera) enable_symvers=$enableval ;;
gnu) enable_symvers=$enableval ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;; *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
esac], esac],
enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
dnl Option parsed, now set things appropriately
# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD... I think.
AC_MSG_CHECKING([whether to version shared lib symbols]) AC_MSG_CHECKING([whether to version shared lib symbols])
if test $enable_shared = no; then if test $enable_shared = no || test x$LD = x ; then
enable_symvers=irrelevant enable_symvers=irrelevant
fi fi
# placeholder -- maybe have a fallback later
LINKER_MAP=config/linker-map.gnu # For GNU ld, we need at least this version. It's 2.12 in the same format
# symvers variable may evolve into holding the type of linker map someday # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
if test $enable_symvers = yes; then glibcpp_min_gnu_ld_version=21200
# flat-out assume a whole bunch of things right now
# dnl Everything parsed; figure out the actions.
# The name of this variable changed between autoconf versions (our problem LINKER_MAP=config/linker-map.dummy
# for depending on an impl detail, tsk tsk). It used to be case $enable_symvers in
# ac_cv_prog_gnu_ld but is now lt_cv_prog_gnu_ld, and is copied back into no | irrelevant)
# with_gnu_ld which can also be user-settable. Let's use that one. ;;
if test $with_gnu_ld = yes; then gnu)
# we also assume that the gnu ld in question has phil's patches... can't LINKER_MAP=config/linker-map.gnu
# think today of an easy way to programatically test for that; revisit ;;
LINKER_MAP=config/linker-map.gnu dnl sun)
else dnl LINKER_MAP=config/linker-map....?
# placeholder -- maybe have a fallback later dnl ;;
LINKER_MAP=config/linker-map.gnu default) # not specified by user, try to figure it out
enable_symvers=no if test $with_gnu_ld = yes &&
fi test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ;
fi then
LINKER_MAP=config/linker-map.gnu
else
# just fail for now
enable_symvers=no
fi
;;
esac
AC_LINK_FILES($LINKER_MAP, src/linker.map) AC_LINK_FILES($LINKER_MAP, src/linker.map)
AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test "$enable_symvers" = yes) AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB,
test $enable_symvers != no && test $enable_symvers != irrelevant)
AC_MSG_RESULT($enable_symvers) AC_MSG_RESULT($enable_symvers)
]) ])
......
#
# This is a placeholder file. It does nothing and is not used.
#
# If you are seeing this file as your linker script (named linker.map), then
# either 1) the configuration process determined that symbol versioning should
# not be done, or 2) you specifically turned it off.
#
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -49,7 +49,6 @@ GLIBCPP_ENABLE_THREADS ...@@ -49,7 +49,6 @@ GLIBCPP_ENABLE_THREADS
GLIBCPP_ENABLE_CXX_FLAGS([none]) GLIBCPP_ENABLE_CXX_FLAGS([none])
GLIBCPP_ENABLE_SJLJ_EXCEPTIONS GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
GLIBCPP_ENABLE_CONCEPT_CHECKS GLIBCPP_ENABLE_CONCEPT_CHECKS
GLIBCPP_ENABLE_SYMVERS([no])
if test -n "$with_cross_host" || test x"$build" != x"$host"; then if test -n "$with_cross_host" || test x"$build" != x"$host"; then
...@@ -250,6 +249,8 @@ else ...@@ -250,6 +249,8 @@ else
GLIBCPP_CONFIGURE_TESTSUITE GLIBCPP_CONFIGURE_TESTSUITE
fi fi
# This depends on the possibly-skipped linker test above.
GLIBCPP_ENABLE_SYMVERS([no])
# Propagate the target-specific source directories through the build chain. # Propagate the target-specific source directories through the build chain.
OS_INC_SRCDIR=$os_include_dir/bits OS_INC_SRCDIR=$os_include_dir/bits
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment