aboutsummaryrefslogtreecommitdiff
path: root/patches/gcc/3.3/gcc-3.2.3-g++.exp.patch
blob: 0de46fc4f31bee7da5d7c8a162b95c083765473e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003

The first hunk fixes the error

/testsuite_flags: /testsuite_flags: No such file or directory
    while executing
"exec sh ${odir_v3}/testsuite_flags --build-includes"
    (procedure "g++_include_flags" line 21)
    invoked from within
"g++_include_flags [get_multilibs] "
    (procedure "g++_init" line 63)
    invoked from within
"${tool}_init $test_file_name"
    (procedure "runtest" line 19)
    invoked from within
"runtest $test_name"
    ("foreach" body line 42)
    invoked from within
...
make[1]: [check-g++] Error 1 (ignored)

The fix isn't especially pretty, but it worked for me, and can't hurt the
more common native compiler case.  Maybe someone who knows the code better 
can come up with a better fix.

The second hunk fixes the error

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

when trying to compile g++ testcases (!); setting up
the shared library environment when running crosstests of g++ 
should either be done by a special board file, or by
setting up a remote chroot environment (see http://kegel.com/crosstool),
not by blithely setting LD_LIBRARY_PATH on the local system.

--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old	Fri Jul 11 15:42:47 2003
+++ gcc-3.2.3/gcc/testsuite/lib/g++.exp	Sat Jul 12 12:57:07 2003
@@ -72,6 +72,8 @@
 #
 proc g++_include_flags { paths } {
     global srcdir
+    global objdir
+    global target_triplet
     global HAVE_LIBSTDCXX_V3
     global TESTING_IN_BUILD_TREE
 
@@ -90,6 +92,20 @@
 
     if { ${HAVE_LIBSTDCXX_V3} } {
       set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
+      if { $odir_v3 == "" } {
+          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
+	  # first assume no multilibs
+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
+      }
+      if { $odir_v3 == "" } {
+          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
+	  # assume multilib only one level deep
+          set multisub [file tail $gccpath]
+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
+      }
+      if { $odir_v3 == "" } {
+           error "Can't find libstdc++-v3"
+      }
       append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
     } else {
       set odir_v2 [lookfor_file ${gccpath} libstdc++]
@@ -192,16 +192,20 @@
       }
     }
 
-    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
-    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
-    # (for the 64-bit ABI).  The right way to do this would be to modify
-    # unix.exp -- but that's not an option since it's part of DejaGNU
-    # proper, so we do it here.  We really only need to do 
-    # this on IRIX, but it shouldn't hurt to do it anywhere else.
-    setenv  LD_LIBRARY_PATH     $ld_library_path
-    setenv  SHLIB_PATH          $ld_library_path
-    setenv  LD_LIBRARYN32_PATH  $ld_library_path
-    setenv  LD_LIBRARY64_PATH   $ld_library_path
+    if {![is_remote target]} {
+      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+      # (for the 64-bit ABI).  The right way to do this would be to modify
+      # unix.exp -- but that's not an option since it's part of DejaGNU
+      # proper, so we do it here.  We really only need to do 
+      # this on IRIX, but it shouldn't hurt to do it anywhere else.
+
+      # Doing this causes us to be unable to run cross-compilers.
+      setenv  LD_LIBRARY_PATH     $ld_library_path
+      setenv  SHLIB_PATH          $ld_library_path
+      setenv  LD_LIBRARYN32_PATH  $ld_library_path
+      setenv  LD_LIBRARY64_PATH   $ld_library_path
+    }
 
     return "$flags"
 }