patches/gcc/3.2.3/100-config.sub.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:08:06 2008 +0000 (2008-02-17)
changeset 431 8bde4c6ea47a
permissions -rw-r--r--
Robert P. J. DAY says:

apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
yann@402
     1
When configuring a s390->s390 or cris->cris crosscompiler
yann@402
     2
(ok, I haven't hit this yet, but one of these days I'll get me an account
yann@402
     3
on an s390, and then I'll need this patch :-), you'll get the
yann@402
     4
following error:
yann@402
     5
yann@402
     6
+ /build/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/gcc-3.3/configure
yann@402
     7
--target=s390-unknown-linux-gnu --host=s390-host_unknown-linux-gnu
yann@402
     8
--prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2
yann@402
     9
--enable-languages=c
yann@402
    10
--with-local-prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/s390-
yann@402
    11
unknown-linux-gnu --enable-threads=no --without-headers --with-newlib
yann@402
    12
--disable-shared
yann@402
    13
...
yann@402
    14
*** --with-headers is only supported when cross compiling
yann@402
    15
yann@402
    16
This error pops up only when you're using Daniel Jacobowitz's technique
yann@402
    17
of slightly changing the target and host tuples to make them different
yann@402
    18
enough to force gcc's build system to not try to pull in system libraries
yann@402
    19
or headers.  This technique is needed e.g. to build an x86 -> x86
yann@402
    20
cross-compiler.
yann@402
    21
(The LFS developers ran into the same bug that prompted me to use
yann@402
    22
this technique; they point people who run into it to
yann@402
    23
http://linuxfromscratch.org/~greg/pure_lfs.txt, which is a different
yann@402
    24
way of avoiding this problem.  I think the tuple tweak is the way to go, though.)
yann@402
    25
yann@402
    26
config-patches@gnu.org rejected this patch, on the grounds that there
yann@402
    27
is only one vendor of each of those two architectures, so the 
yann@402
    28
canonicalization is by definition correct.  When I pointed out the
yann@402
    29
difficulty this causes for people building s390 -> s390 or
yann@402
    30
cris -> cris compilers that are incompatible with the system
yann@402
    31
libraries and thus must be built like cross-compilers, he grumped and said 
yann@402
    32
"autoconf should let you specify a cross-compiler in some other way than
yann@402
    33
comparing tuple strings".
yann@402
    34
yann@402
    35
yann@402
    36
yann@402
    37
--- gcc-3.3/config.sub.old	Sun Jun  8 20:38:47 2003
yann@402
    38
+++ gcc-3.3/config.sub	Sun Jun  8 20:40:34 2003
yann@402
    39
@@ -433,9 +433,12 @@
yann@402
    40
 	crds | unos)
yann@402
    41
 		basic_machine=m68k-crds
yann@402
    42
 		;;
yann@402
    43
-	cris | cris-* | etrax*)
yann@402
    44
+	cris | etrax*)
yann@402
    45
 		basic_machine=cris-axis
yann@402
    46
 		;;
yann@402
    47
+	cris-*)
yann@402
    48
+		basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'`
yann@402
    49
+		;;
yann@402
    50
 	da30 | da30-*)
yann@402
    51
 		basic_machine=m68k-da30
yann@402
    52
 		;;
yann@402
    53
@@ -820,11 +823,17 @@
yann@402
    54
 	rtpc | rtpc-*)
yann@402
    55
 		basic_machine=romp-ibm
yann@402
    56
 		;;
yann@402
    57
-	s390 | s390-*)
yann@402
    58
+	s390)
yann@402
    59
 		basic_machine=s390-ibm
yann@402
    60
 		;;
yann@402
    61
-	s390x | s390x-*)
yann@402
    62
+	s390-*)
yann@402
    63
+		basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'`
yann@402
    64
+		;;
yann@402
    65
+	s390x)
yann@402
    66
 		basic_machine=s390x-ibm
yann@402
    67
+		;;
yann@402
    68
+	s390x-*)
yann@402
    69
+		basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'`
yann@402
    70
 		;;
yann@402
    71
 	sa29200)
yann@402
    72
 		basic_machine=a29k-amd