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