patches/gcc/3.2.3/130-g++.exp.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Aug 07 14:05:47 2008 +0000 (2008-08-07)
changeset 766 717efd8b78b4
parent 402 197e1b49586e
permissions -rw-r--r--
Update all samples to the latest set of options.
Update some samples to use newer features.
Add patches for the uClibc-20080801 snapshot to be able to build with gcc-4.3.
Add a patch against glibc-2.7 to allow building PPC with latest kernel headers.
Add a patch to gcc to use an alternate unwinding when built against uClibc (after a private explanation/request by Daniel Egger <daniel@eggers-club.de>)

/trunk/patches/glibc/2.7/230-powerpc-private_futex.patch | 15 15 0 0 +
/trunk/patches/uClibc/20080801/300-fix-asm.patch | 175 175 0 0 +++++++++
/trunk/patches/uClibc/20080801/100-ifaddrs.patch | 190 190 0 0 +++++++++
/trunk/patches/uClibc/20080801/200-mips-typeof.patch | 112 112 0 0 ++++++
/trunk/patches/gcc/4.3.1/330-unwind-for-uClibc.patch | 25 25 0 0 +
/trunk/samples/x86_64-unknown-linux-gnu/crosstool.config | 17 10 7 0 +
/trunk/samples/armeb-unknown-linux-uclibc/crosstool.config | 7 5 2 0 +
/trunk/samples/arm-unknown-linux-gnueabi/crosstool.config | 7 5 2 0 +
/trunk/samples/ia64-unknown-linux-gnu/crosstool.config | 14 11 3 0 +
/trunk/samples/x86_64-unknown-linux-uclibc/uClibc-20080801.config | 232 232 0 0 ++++++++++++
/trunk/samples/x86_64-unknown-linux-uclibc/crosstool.config | 34 21 13 0 +-
/trunk/samples/i686-nptl-linux-gnu/crosstool.config | 10 7 3 0 +
/trunk/samples/powerpc-unknown-linux-gnu/crosstool.config | 12 9 3 0 +
/trunk/samples/mips-unknown-linux-uclibc/uClibc-20080801.config | 249 249 0 0 ++++++++++++
/trunk/samples/mips-unknown-linux-uclibc/crosstool.config | 38 23 15 0 +-
/trunk/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 14 10 4 0 +
/trunk/samples/armeb-unknown-linux-gnu/crosstool.config | 7 5 2 0 +
/trunk/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 12 9 3 0 +
/trunk/samples/arm-unknown-linux-uclibc/crosstool.config | 7 5 2 0 +
/trunk/samples/i586-geode-linux-uclibc/uClibc-20080801.config | 261 261 0 0 +++++++++++++
/trunk/samples/i586-geode-linux-uclibc/crosstool.config | 32 20 12 0 ++
/trunk/samples/powerpc-unknown-linux-uclibc/crosstool.config | 12 9 3 0 +
/trunk/samples/mipsel-unknown-linux-gnu/crosstool.config | 7 5 2 0 +
/trunk/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 7 5 2 0 +
/trunk/samples/alphaev56-unknown-linux-gnu/crosstool.config | 16 10 6 0 +
25 files changed, 1428 insertions(+), 84 deletions(-)
yann@402
     1
g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
yann@402
     2
yann@402
     3
The first hunk fixes the error
yann@402
     4
yann@402
     5
/testsuite_flags: /testsuite_flags: No such file or directory
yann@402
     6
    while executing
yann@402
     7
"exec sh ${odir_v3}/testsuite_flags --build-includes"
yann@402
     8
    (procedure "g++_include_flags" line 21)
yann@402
     9
    invoked from within
yann@402
    10
"g++_include_flags [get_multilibs] "
yann@402
    11
    (procedure "g++_init" line 63)
yann@402
    12
    invoked from within
yann@402
    13
"${tool}_init $test_file_name"
yann@402
    14
    (procedure "runtest" line 19)
yann@402
    15
    invoked from within
yann@402
    16
"runtest $test_name"
yann@402
    17
    ("foreach" body line 42)
yann@402
    18
    invoked from within
yann@402
    19
...
yann@402
    20
make[1]: [check-g++] Error 1 (ignored)
yann@402
    21
yann@402
    22
The fix isn't especially pretty, but it worked for me, and can't hurt the
yann@402
    23
more common native compiler case.  Maybe someone who knows the code better 
yann@402
    24
can come up with a better fix.
yann@402
    25
yann@402
    26
The second hunk fixes the error
yann@402
    27
yann@402
    28
sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian
yann@402
    29
yann@402
    30
when trying to compile g++ testcases (!); setting up
yann@402
    31
the shared library environment when running crosstests of g++ 
yann@402
    32
should either be done by a special board file, or by
yann@402
    33
setting up a remote chroot environment (see http://kegel.com/crosstool),
yann@402
    34
not by blithely setting LD_LIBRARY_PATH on the local system.
yann@402
    35
yann@402
    36
--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old	Fri Jul 11 15:42:47 2003
yann@402
    37
+++ gcc-3.2.3/gcc/testsuite/lib/g++.exp	Sat Jul 12 12:57:07 2003
yann@402
    38
@@ -72,6 +72,8 @@
yann@402
    39
 #
yann@402
    40
 proc g++_include_flags { paths } {
yann@402
    41
     global srcdir
yann@402
    42
+    global objdir
yann@402
    43
+    global target_triplet
yann@402
    44
     global HAVE_LIBSTDCXX_V3
yann@402
    45
     global TESTING_IN_BUILD_TREE
yann@402
    46
 
yann@402
    47
@@ -90,6 +92,20 @@
yann@402
    48
 
yann@402
    49
     if { ${HAVE_LIBSTDCXX_V3} } {
yann@402
    50
       set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
yann@402
    51
+      if { $odir_v3 == "" } {
yann@402
    52
+          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
yann@402
    53
+	  # first assume no multilibs
yann@402
    54
+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
yann@402
    55
+      }
yann@402
    56
+      if { $odir_v3 == "" } {
yann@402
    57
+          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
yann@402
    58
+	  # assume multilib only one level deep
yann@402
    59
+          set multisub [file tail $gccpath]
yann@402
    60
+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
yann@402
    61
+      }
yann@402
    62
+      if { $odir_v3 == "" } {
yann@402
    63
+           error "Can't find libstdc++-v3"
yann@402
    64
+      }
yann@402
    65
       append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
yann@402
    66
     } else {
yann@402
    67
       set odir_v2 [lookfor_file ${gccpath} libstdc++]
yann@402
    68
@@ -192,16 +192,20 @@
yann@402
    69
       }
yann@402
    70
     }
yann@402
    71
 
yann@402
    72
-    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
yann@402
    73
-    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
yann@402
    74
-    # (for the 64-bit ABI).  The right way to do this would be to modify
yann@402
    75
-    # unix.exp -- but that's not an option since it's part of DejaGNU
yann@402
    76
-    # proper, so we do it here.  We really only need to do 
yann@402
    77
-    # this on IRIX, but it shouldn't hurt to do it anywhere else.
yann@402
    78
-    setenv  LD_LIBRARY_PATH     $ld_library_path
yann@402
    79
-    setenv  SHLIB_PATH          $ld_library_path
yann@402
    80
-    setenv  LD_LIBRARYN32_PATH  $ld_library_path
yann@402
    81
-    setenv  LD_LIBRARY64_PATH   $ld_library_path
yann@402
    82
+    if {![is_remote target]} {
yann@402
    83
+      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
yann@402
    84
+      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
yann@402
    85
+      # (for the 64-bit ABI).  The right way to do this would be to modify
yann@402
    86
+      # unix.exp -- but that's not an option since it's part of DejaGNU
yann@402
    87
+      # proper, so we do it here.  We really only need to do 
yann@402
    88
+      # this on IRIX, but it shouldn't hurt to do it anywhere else.
yann@402
    89
+
yann@402
    90
+      # Doing this causes us to be unable to run cross-compilers.
yann@402
    91
+      setenv  LD_LIBRARY_PATH     $ld_library_path
yann@402
    92
+      setenv  SHLIB_PATH          $ld_library_path
yann@402
    93
+      setenv  LD_LIBRARYN32_PATH  $ld_library_path
yann@402
    94
+      setenv  LD_LIBRARY64_PATH   $ld_library_path
yann@402
    95
+    }
yann@402
    96
 
yann@402
    97
     return "$flags"
yann@402
    98
 }