PATCH: PR libstdc++/25797: [4.2 Regression] almost all libstdc++ tests fail
H. J. Lu
hjl@lucon.org
Thu Jan 19 16:16:00 GMT 2006
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)
More information about the Gcc-patches
mailing list