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