patches/gcc/3.3.3/pr12009.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/3.3.3/pr12009.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,85 @@
     1.4 +See http://gcc.gnu.org/PR12009
     1.5 +
     1.6 +Fixes the following problems when testing a cross-compiler:
     1.7 +
     1.8 +============================================
     1.9 +Testing g++.dg/compat/abi/bitfield1,
    1.10 +...
    1.11 +Invoking the compiler as /crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-gli
    1.12 +bc-2.2.5/build-gcc/gcc/testsuite/../g++  ...
    1.13 +/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/gcc/test
    1.14 +suite/g++.dg/compat/abi/bitfield1_main.C
    1.15 +pid is 16028 -16028
    1.16 +compiler exited with status 1
    1.17 +output is:
    1.18 +sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-750-linux-gnu/gc
    1.19 +c-3.3-glibc-2.2.5/powerpc-750-linux-gnu/./lib/libdl.so.2: ELF file data encoding
    1.20 + not little-endian
    1.21 +/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/build-gcc/gcc/te
    1.22 +stsuite/../g++: error while loading shared libraries: /opt/cegl-2.0/powerpc-750-
    1.23 +linux-gnu/gcc-3.3-glibc-2.2.5/powerpc-750-linux-gnu/./lib/libc.so.6: ELF file da
    1.24 +ta encoding not little-endian
    1.25 +
    1.26 +FAIL: g++.dg/compat/abi/bitfield1 main_tst.o compile
    1.27 +============================================
    1.28 +
    1.29 +and
    1.30 +
    1.31 +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
    1.32 +
    1.33 +
    1.34 +
    1.35 +--- gcc-3.3/gcc/testsuite/g++.dg/compat/compat.exp.old	Thu Oct 17 17:22:57 2002
    1.36 ++++ gcc-3.3/gcc/testsuite/g++.dg/compat/compat.exp	Mon Jul 14 10:59:19 2003
    1.37 +@@ -42,11 +42,13 @@
    1.38 + proc compat-fix-library-path { } {
    1.39 +     global ld_library_path
    1.40 + 
    1.41 +-    # See comments in lib/g++.exp for why this is needed.
    1.42 +-    setenv  LD_LIBRARY_PATH     $ld_library_path
    1.43 +-    setenv  SHLIB_PATH          $ld_library_path
    1.44 +-    setenv  LD_LIBRARYN32_PATH  $ld_library_path
    1.45 +-    setenv  LD_LIBRARY64_PATH   $ld_library_path
    1.46 ++    if {![is_remote target]} {
    1.47 ++	# See comments in lib/g++.exp for why this is needed.
    1.48 ++	setenv  LD_LIBRARY_PATH     $ld_library_path
    1.49 ++	setenv  SHLIB_PATH          $ld_library_path
    1.50 ++	setenv  LD_LIBRARYN32_PATH  $ld_library_path
    1.51 ++	setenv  LD_LIBRARY64_PATH   $ld_library_path
    1.52 ++    }
    1.53 + }
    1.54 + 
    1.55 + #
    1.56 +--- gcc-3.4-20030813/gcc/testsuite/lib/g++.exp.orig	Tue Jun 17 18:56:45 2003
    1.57 ++++ gcc-3.4-20030813/gcc/testsuite/lib/g++.exp	Sun Aug 17 18:35:38 2003
    1.58 +@@ -166,16 +182,20 @@
    1.59 +       }
    1.60 +     }
    1.61 + 
    1.62 +-    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
    1.63 +-    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
    1.64 +-    # (for the 64-bit ABI).  The right way to do this would be to modify
    1.65 +-    # unix.exp -- but that's not an option since it's part of DejaGNU
    1.66 +-    # proper, so we do it here.  We really only need to do 
    1.67 +-    # this on IRIX, but it shouldn't hurt to do it anywhere else.
    1.68 +-    setenv  LD_LIBRARY_PATH     $ld_library_path
    1.69 +-    setenv  SHLIB_PATH          $ld_library_path
    1.70 +-    setenv  LD_LIBRARYN32_PATH  $ld_library_path
    1.71 +-    setenv  LD_LIBRARY64_PATH   $ld_library_path
    1.72 ++    if {![is_remote target]} {
    1.73 ++      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
    1.74 ++      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
    1.75 ++      # (for the 64-bit ABI).  The right way to do this would be to modify
    1.76 ++      # unix.exp -- but that's not an option since it's part of DejaGNU
    1.77 ++      # proper, so we do it here.  We really only need to do 
    1.78 ++      # this on IRIX, but it shouldn't hurt to do it anywhere else.
    1.79 ++
    1.80 ++      # Doing this causes us to be unable to run cross-compilers.
    1.81 ++      setenv  LD_LIBRARY_PATH     $ld_library_path
    1.82 ++      setenv  SHLIB_PATH          $ld_library_path
    1.83 ++      setenv  LD_LIBRARYN32_PATH  $ld_library_path
    1.84 ++      setenv  LD_LIBRARY64_PATH   $ld_library_path
    1.85 ++    }
    1.86 + 
    1.87 +     return "$flags"
    1.88 + }