This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA] Fix libstdc++ configure failure on cross-builds
- From: Paul Koning <paul_koning at dell dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 3 Dec 2010 11:19:40 -0500
- Subject: [RFA] Fix libstdc++ configure failure on cross-builds
This patch fixes failures of libstdc++ to configure when cross-building to NetBSD target. The issue is that there are two places that do link tests, which are disallowed in cross builds. The libtool.m4 change supplies values for netbsd similar to what's already done for selected other targets. The patch to libstdc++-v3/acinclude.m4 lets configure rely on the ld version number to determine support for --gc-sections if a cross-build is being done, rather than doing a double-check.
Ok to commit?
ChangeLog (top level):
2010-12-03 Paul Koning <paul_koning@dell.com>
* configure.ac (LT_SYS_DLOPEN_SELF): Add settings for NetBSD.
ChangeLog (libstdc++-v3):
2010-12-03 Paul Koning <paul_koning@dell.com>
* acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Don't double-check
--gc-sections support if cross-build.
Index: gcc-4.5.1/libtool.m4
===================================================================
--- gcc-4.5.1/libtool.m4 (revision 147400)
+++ gcc-4.5.1/libtool.m4 (working copy)
@@ -1715,6 +1715,11 @@
lt_cv_dlopen_self=yes
;;
+ netbsd*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
Index: gcc-4.5.1/libstdc++-v3/acinclude.m4
===================================================================
--- gcc-4.5.1/libstdc++-v3/acinclude.m4 (revision 147400)
+++ gcc-4.5.1/libstdc++-v3/acinclude.m4 (working copy)
@@ -230,7 +230,8 @@
glibcxx_have_gc_sections=yes
fi
fi
- if test "$glibcxx_have_gc_sections" = "yes"; then
+ if test "$glibcxx_have_gc_sections" = "yes" &&
+ test x$gcc_no_link != xyes; then
# Sufficiently young GNU ld it is! Joy and bunny rabbits!
# NB: This flag only works reliably after 2.16.1. Configure tests
# for this are difficult, so hard wire a value that should work.