Commit 952c7b74 by Benjamin Kosnik Committed by Benjamin Kosnik

acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Enable --gc-sections in more cases.

2006-01-12  Benjamin Kosnik  <bkoz@redhat.com>

	* acinclude.m4(GLIBCXX_CHECK_LINKER_FEATURES): Enable
	--gc-sections in more cases.	
	* configure: Regenerate.
	* scripts/testsuite_flags.in: Remove SECTION_LDFLAGS.
	* scripts/testsuite_flags.in (cxxldflags): New.
	* testsuite/lib/libstdc++.exp (v3_target_compile): Add cxxldflags.
	(libstdc++_init ): Same.

From-SVN: r109662
parent 23fed240
2006-01-12 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4(GLIBCXX_CHECK_LINKER_FEATURES): Enable
--gc-sections in more cases.
* configure: Regenerate.
* scripts/testsuite_flags.in: Remove SECTION_LDFLAGS.
* scripts/testsuite_flags.in (cxxldflags): New.
* testsuite/lib/libstdc++.exp (v3_target_compile): Add cxxldflags.
(libstdc++_init ): Same.
2006-01-12 Jan Beulich <jbeulich@novell.com>
* crossconfig.m4: Add AC_DEFINE-s for HAVE_HYPOT, HAVE_ISINF, and
......@@ -6,7 +16,8 @@
2006-01-11 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4: Use -Wl,-z,relro if possible.
* acinclude.m4(GLIBCXX_CHECK_LINKER_FEATURES): Use -Wl,-z,relro if
possible.
* configure: Regenerate.
2006-01-10 Paolo Carlini <pcarlini@suse.de>
......
......@@ -230,7 +230,7 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
$AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
# Set --gc-sections.
if test "$with_gnu_ld" = "notbroken"; then
if test x"$with_gnu_ld" = x"yes"; then
# GNU ld it is! Joy and bunny rabbits!
# All these tests are for C++; save the language and the compiler flags.
......@@ -240,14 +240,9 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
CFLAGS='-x c++ -Wl,--gc-sections'
# Check for -Wl,--gc-sections
# XXX This test is broken at the moment, as symbols required for linking
# are now in libsupc++ (not built yet). In addition, this test has
# cored on solaris in the past. In addition, --gc-sections doesn't
# really work at the moment (keeps on discarding used sections, first
# .eh_frame and now some of the glibc sections for iconv).
# Bzzzzt. Thanks for playing, maybe next time.
# Note: It's supposed to work now, so ease off until proven wrong...
AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
AC_TRY_RUN([
AC_TRY_COMPILE([
int main(void)
{
try { throw 1; }
......@@ -268,7 +263,7 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
fi
# Set -z,relro.
# Note this is only for shared objects
# Note this is only for shared objects.
ac_ld_relro=no
if test x"$with_gnu_ld" = x"yes"; then
AC_MSG_CHECKING([for ld that supports -Wl,-z,relro])
......
......@@ -18,6 +18,7 @@ Usage:
--install-cxx
--cxxflags
--cxxpchflags
--cxxldflags
EOF
}
......@@ -48,7 +49,7 @@ case ${query} in
;;
--cxxflags)
CXXFLAGS_save="-g -O2 -D_GLIBCXX_ASSERT"
CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0
CXXFLAGS_config='@SECTION_FLAGS@ -fmessage-length=0
@EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcxx_localedir@" '
echo ${CXXFLAGS_save} ${CXXFLAGS_config}
;;
......@@ -56,6 +57,10 @@ case ${query} in
PCHFLAGS="@glibcxx_PCHFLAGS@"
echo ${PCHFLAGS}
;;
--cxxldflags)
SECTIONLDFLAGS="@SECTION_LDFLAGS@"
echo ${SECTIONLDFLAGS}
;;
*)
print_usage
;;
......
......@@ -82,7 +82,7 @@ proc libstdc++_init { testfile } {
global env
global v3-sharedlib
global srcdir blddir objdir tool_root_dir
global cxx cxxflags
global cxx cxxflags cxxldflags
global includes
global gluefile wrap_flags
global ld_library_path
......@@ -179,17 +179,20 @@ proc libstdc++_init { testfile } {
}
set cxx [transform "g++"]
set cxxflags "-ggdb3"
set cxxldflags ""
set includes "-I./"
} else {
# If we find a testsuite_flags file, we're testing in the build dir.
if { [file exists $flags_file] } {
set cxx [exec sh $flags_file --build-cxx]
set cxxflags [exec sh $flags_file --cxxflags]
set cxxldflags [exec sh $flags_file --cxxldflags]
set includes [exec sh $flags_file --build-includes]
} else {
set cxx [transform "g++"]
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
set includes "-I${srcdir}"
set cxxldflags ""
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
# Guess at the location of the installed locale files.
# (It would be nice if "gcc --print-file-name" could find
# message files, but it cannot.)
......@@ -321,6 +324,7 @@ proc v3_target_compile { source dest type options } {
global wrap_flags
global cxx
global cxxflags
global cxxldflags
global includes
global blddir
global v3-test_objs
......@@ -340,6 +344,7 @@ proc v3_target_compile { source dest type options } {
if { $type == "executable" } {
# Link the support objects into executables.
set cxx_final [concat $cxx_final ${v3-test_objs}]
set cxx_final [concat $cxx_final $cxxldflags]
} else {
if { $type == "sharedlib" } {
# Don't link in anything.
......
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