patches/gcc/3.3.1/gcc-3.2.3-g++.exp.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 See http://gcc.gnu.org/PR12010
     2 
     3 g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
     4 
     5 The first hunk fixes the error
     6 
     7 /testsuite_flags: /testsuite_flags: No such file or directory
     8     while executing
     9 "exec sh ${odir_v3}/testsuite_flags --build-includes"
    10     (procedure "g++_include_flags" line 21)
    11     invoked from within
    12 "g++_include_flags [get_multilibs] "
    13     (procedure "g++_init" line 63)
    14     invoked from within
    15 "${tool}_init $test_file_name"
    16     (procedure "runtest" line 19)
    17     invoked from within
    18 "runtest $test_name"
    19     ("foreach" body line 42)
    20     invoked from within
    21 ...
    22 make[1]: [check-g++] Error 1 (ignored)
    23 
    24 The fix isn't especially pretty, but it worked for me, and can't hurt the
    25 more common native compiler case.  Maybe someone who knows the code better 
    26 can come up with a better fix.
    27 
    28 The second hunk fixes the error
    29 
    30 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
    31 
    32 when trying to compile g++ testcases (!); setting up
    33 the shared library environment when running crosstests of g++ 
    34 should either be done by a special board file, or by
    35 setting up a remote chroot environment (see http://kegel.com/crosstool),
    36 not by blithely setting LD_LIBRARY_PATH on the local system.
    37 
    38 --- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old	Fri Jul 11 15:42:47 2003
    39 +++ gcc-3.2.3/gcc/testsuite/lib/g++.exp	Sat Jul 12 12:57:07 2003
    40 @@ -72,6 +72,8 @@
    41  #
    42  proc g++_include_flags { paths } {
    43      global srcdir
    44 +    global objdir
    45 +    global target_triplet
    46      global HAVE_LIBSTDCXX_V3
    47      global TESTING_IN_BUILD_TREE
    48  
    49 @@ -90,6 +92,20 @@
    50  
    51      if { ${HAVE_LIBSTDCXX_V3} } {
    52        set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
    53 +      if { $odir_v3 == "" } {
    54 +          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
    55 +	  # first assume no multilibs
    56 +          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
    57 +      }
    58 +      if { $odir_v3 == "" } {
    59 +          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
    60 +	  # assume multilib only one level deep
    61 +          set multisub [file tail $gccpath]
    62 +          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
    63 +      }
    64 +      if { $odir_v3 == "" } {
    65 +           error "Can't find libstdc++-v3"
    66 +      }
    67        append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
    68      } else {
    69        set odir_v2 [lookfor_file ${gccpath} libstdc++]
    70 @@ -192,16 +192,20 @@
    71        }
    72      }
    73  
    74 -    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
    75 -    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
    76 -    # (for the 64-bit ABI).  The right way to do this would be to modify
    77 -    # unix.exp -- but that's not an option since it's part of DejaGNU
    78 -    # proper, so we do it here.  We really only need to do 
    79 -    # this on IRIX, but it shouldn't hurt to do it anywhere else.
    80 -    setenv  LD_LIBRARY_PATH     $ld_library_path
    81 -    setenv  SHLIB_PATH          $ld_library_path
    82 -    setenv  LD_LIBRARYN32_PATH  $ld_library_path
    83 -    setenv  LD_LIBRARY64_PATH   $ld_library_path
    84 +    if {![is_remote target]} {
    85 +      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
    86 +      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
    87 +      # (for the 64-bit ABI).  The right way to do this would be to modify
    88 +      # unix.exp -- but that's not an option since it's part of DejaGNU
    89 +      # proper, so we do it here.  We really only need to do 
    90 +      # this on IRIX, but it shouldn't hurt to do it anywhere else.
    91 +
    92 +      # Doing this causes us to be unable to run cross-compilers.
    93 +      setenv  LD_LIBRARY_PATH     $ld_library_path
    94 +      setenv  SHLIB_PATH          $ld_library_path
    95 +      setenv  LD_LIBRARYN32_PATH  $ld_library_path
    96 +      setenv  LD_LIBRARY64_PATH   $ld_library_path
    97 +    }
    98  
    99      return "$flags"
   100  }