[RFA] Fix libstdc++ configure failure on cross-builds

Paul Koning paul_koning@dell.com
Fri Dec 3 16:19:00 GMT 2010


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.



More information about the Gcc-patches mailing list