patches/gcc/4.3.2/130-cross-compile.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu Apr 26 19:55:59 2012 -0600 (2012-04-26)
changeset 2939 58974be61289
parent 747 d3e603e7c17c
permissions -rw-r--r--
Allow multi-word "install" command.

Autoconf can determine that the correct install command includes flags,
e.g., "/usr/bin/install -c". When using this as a command, we can't
enclose the value in double-quotes, as that makes some shells use the
whole expression as a filename:

# this is the value returned by autoconf and stored in CT_install
$ ins="/usr/bin/install -c"

# if we call it with quotes, the command is not found
$ "${ins}"
bash: /usr/bin/install -c: No such file or directory

# removing the quotes lets it work as expected
$ ${ins}
/usr/bin/install: missing file operand
Try `/usr/bin/install --help' for more information.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@552
     1
Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
yann@552
     2
Some notes on the 'bootstrap with or without libc headers' debate:
yann@552
     3
http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
yann@552
     4
http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
yann@552
     5
yann@874
     6
diff -durN gcc-4.3.2.orig/gcc/configure gcc-4.3.2/gcc/configure
yann@874
     7
--- gcc-4.3.2.orig/gcc/configure	2008-08-01 11:51:03.000000000 +0200
yann@874
     8
+++ gcc-4.3.2/gcc/configure	2008-09-23 19:39:43.000000000 +0200
yann@874
     9
@@ -13442,7 +13442,7 @@
yann@552
    10
 	    | powerpc*-*-*,powerpc64*-*-*)
yann@552
    11
 		CROSS="$CROSS -DNATIVE_CROSS" ;;
yann@552
    12
 	esac
yann@552
    13
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
yann@552
    14
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
yann@552
    15
         SYSTEM_HEADER_DIR=$build_system_header_dir
yann@552
    16
 fi
yann@552
    17
 
yann@874
    18
diff -durN gcc-4.3.2.orig/gcc/configure.ac gcc-4.3.2/gcc/configure.ac
yann@874
    19
--- gcc-4.3.2.orig/gcc/configure.ac	2008-08-01 11:51:03.000000000 +0200
yann@874
    20
+++ gcc-4.3.2/gcc/configure.ac	2008-09-23 19:39:43.000000000 +0200
yann@552
    21
@@ -1749,7 +1749,7 @@
yann@552
    22
 	    | powerpc*-*-*,powerpc64*-*-*)
yann@552
    23
 		CROSS="$CROSS -DNATIVE_CROSS" ;;
yann@552
    24
 	esac
yann@552
    25
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
yann@552
    26
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
yann@552
    27
         SYSTEM_HEADER_DIR=$build_system_header_dir 
yann@552
    28
 fi
yann@552
    29
 
yann@874
    30
diff -durN gcc-4.3.2.orig/gcc/unwind-dw2.c gcc-4.3.2/gcc/unwind-dw2.c
yann@874
    31
--- gcc-4.3.2.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
yann@874
    32
+++ gcc-4.3.2/gcc/unwind-dw2.c	2008-09-23 19:39:43.000000000 +0200
yann@552
    33
@@ -334,9 +334,11 @@
yann@552
    34
 }
yann@552
    35
 #endif
yann@552
    36
 
yann@552
    37
+#ifndef inhibit_libc
yann@552
    38
 #ifdef MD_UNWIND_SUPPORT
yann@552
    39
 #include MD_UNWIND_SUPPORT
yann@552
    40
 #endif
yann@552
    41
+#endif
yann@552
    42
 
yann@552
    43
 /* Extract any interesting information from the CIE for the translation
yann@552
    44
    unit F belongs to.  Return a pointer to the byte after the augmentation,