Better darwin cross support

Geoffrey Keating gkeating@apple.com
Wed Aug 3 23:16:00 GMT 2005


This makes the libstdc++ configury behave like GCC's configury:
crosses between darwin architectures don't really count as crosses.

The reason for this is that although crossconfig.m4 is a solution, it
gets out-of-date quickly (I noticed particularly the int64_t test) and
it's hard to keep track of all the things that matter; so it's a lot
easier to just have autoconf do its thing.

I also noticed that the testsuite behaviour changed radically when
I put in the export control.  That's very undesirable, so let's not do
that: more tests all the time!

Tested by building a cross libstdc++ from powerpc-darwin to i686-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/libstdc++-darwin-crosses.patch============
2005-08-03  Geoffrey Keating  <geoffk@apple.com>

	* configure.ac: Don't use GCC_NO_EXECUTABLES or clear
	GLIBCXX_IS_NATIVE on Darwin crosses.
	* acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Don't skip configuring
	the testsuite just because there's no symbol versioning.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.ac,v
retrieving revision 1.38
diff -u -p -u -p -r1.38 configure.ac
--- configure.ac	17 Jun 2005 07:33:18 -0000	1.38
+++ configure.ac	3 Aug 2005 23:11:27 -0000
@@ -41,7 +41,24 @@ target_alias=${target_alias-$host_alias}
 if test "$build" != "$host"; then
   # We are being configured with some form of cross compiler.
   GLIBCXX_IS_NATIVE=false
-  GCC_NO_EXECUTABLES
+  case "$host","$target" in
+    # Darwin crosses can use the host system's libraries and headers,
+    # because of the fat library support.  Of course, it must be the
+    # same version of Darwin on both sides.  Allow the user to
+    # just say --target=foo-darwin without a version number to mean
+    # "the version on this system".
+      *-*-darwin*,*-*-darwin*)
+	hostos=`echo $host | sed 's/.*-darwin/darwin/'`
+	targetos=`echo $target | sed 's/.*-darwin/darwin/'`
+	if test $hostos = $targetos -o $targetos = darwin ; then
+	  GLIBCXX_IS_NATIVE=true
+	fi
+	;;
+
+      *)
+	GCC_NO_EXECUTABLES
+	;;
+  esac
 else
   GLIBCXX_IS_NATIVE=true
 fi
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.322
diff -u -p -u -p -r1.322 acinclude.m4
--- acinclude.m4	3 Aug 2005 21:03:28 -0000	1.322
+++ acinclude.m4	3 Aug 2005 23:11:28 -0000
@@ -554,24 +554,22 @@ dnl Substs:
 dnl  baseline_dir
 dnl
 AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [
-  if $GLIBCXX_IS_NATIVE && test $is_hosted = yes && 
-			test $enable_symvers != no; then
+  if $GLIBCXX_IS_NATIVE ; then
     # Do checks for resource limit functions.
     GLIBCXX_CHECK_SETRLIMIT
 
     # Look for setenv, so that extended locale tests can be performed.
     GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+  fi
 
-    if test $enable_symvers = no; then
-      enable_abi_check=no
-    else
-      case "$host" in
-        *-*-cygwin*)
-          enable_abi_check=no ;;
-        *)
-          enable_abi_check=yes ;;
-      esac
-    fi
+  if $GLIBCXX_IS_NATIVE && test $is_hosted = yes &&
+     test $enable_symvers != no; then
+    case "$host" in
+      *-*-cygwin*)
+        enable_abi_check=no ;;
+      *)
+        enable_abi_check=yes ;;
+    esac
   else
     # Only build this as native, since automake does not understand
     # CXX_FOR_BUILD.
============================================================



More information about the Gcc-patches mailing list