This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR libstdc++/25797: [4.2 Regression] almost all libstdc++ tests fail
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: bkoz at redhat dot com, libstdc++ at gcc dot gnu dot org
- Date: Thu, 19 Jan 2006 08:12:56 -0800
- Subject: PATCH: PR libstdc++/25797: [4.2 Regression] almost all libstdc++ tests fail
We need to check linker warnings to make sure that --gc-sections is
really supported. I have tested this patch on Linux/ia64 and
Linux/ia32.
H.J.
----
2006-01-19 H.J. Lu <hongjiu.lu@intel.com>
PR libstdc++/25797
* acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Check if linker
really supports --gc-sections.
* configure: Regenerated.
--- libstdc++-v3/acinclude.m4.warning 2006-01-17 06:42:36.000000000 -0800
+++ libstdc++-v3/acinclude.m4 2006-01-19 07:59:40.000000000 -0800
@@ -245,6 +245,17 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES]
int two(void) { return 2; }
], [ two(); ] , [ac_gcsections=yes], [ac_gcsections=no])
if test "$ac_gcsections" = "yes"; then
+ rm -f conftest.c
+ touch conftest.c
+ if $CC -c conftest.c; then
+ if $LD --gc-sections -o conftest conftest.o 2>&1 | \
+ grep "Warning: gc-sections option ignored" > /dev/null; then
+ ac_gcsections=no
+ fi
+ fi
+ rm -f conftest.c conftest.o conftest
+ fi
+ if test "$ac_gcsections" = "yes"; then
SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
AC_MSG_RESULT($ac_gcsections)