patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
yann@402
     1
Without this patch, the command
yann@402
     2
yann@402
     3
RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3
yann@402
     4
yann@402
     5
fails in two ways:
yann@402
     6
1. the -L option meant to locate the testsuite directory is incorrect, and
yann@402
     7
2. the wrong compiler is invoked, causing all sorts of havoc, not least of which
yann@402
     8
is the native compiler is invoked when we really wanted to invoke the cross-compiler
yann@402
     9
we just built.
yann@402
    10
yann@402
    11
Here's an example log of the problem in action.  Every testcase fails, this shows just one:
yann@402
    12
-------------
yann@402
    13
Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc   -g -O2 -DDEBUG_ASSERT  -L/testsuite -lv3test -lm  -o ./binders.exe
yann@402
    14
compiler exited with status 1
yann@402
    15
output is:
yann@402
    16
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd<mem_fun1_ref_t<void,Elem,int> >::operator ()(const Elem &) const':^M
yann@402
    17
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83:   instantiated from `for_each<Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> > >(Elem *, Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> >)'^M
yann@402
    18
/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43:   instantiated from here^M
yann@402
    19
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M
yann@402
    20
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t<void,Elem,int>::operator ()(Elem &, int) const'^M
yann@402
    21
...
yann@402
    22
FAIL: 20_util/binders.cc (test for excess errors)
yann@402
    23
WARNING: 20_util/binders.cc compilation failed to produce executable
yann@402
    24
-------------
yann@402
    25
yann@402
    26
And here's the patch.  I'm not happy with it, and it probably gets some cases wrong,
yann@402
    27
but it seems to work for the common native case and for my cross-compiler case.
yann@402
    28
yann@402
    29
--- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old	Sun Jul 13 10:42:01 2003
yann@402
    30
+++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp	Sun Jul 13 11:39:54 2003
yann@402
    31
@@ -46,8 +46,23 @@
yann@402
    32
     global gluefile wrap_flags
yann@402
    33
     global ld_library_path
yann@402
    34
     global tool_root_dir
yann@402
    35
+    global target_triplet
yann@402
    36
 
yann@402
    37
     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
yann@402
    38
+    if { $blddir == "" } {
yann@402
    39
+        set multilibs [get_multilibs]
yann@402
    40
+        # FIXME: assume multilib only one level deep
yann@402
    41
+        set multisub [file tail $multilibs]
yann@402
    42
+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
yann@402
    43
+        set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
yann@402
    44
+    }
yann@402
    45
+    if { $blddir == "" } {
yann@402
    46
+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
yann@402
    47
+        set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
yann@402
    48
+    }
yann@402
    49
+    if { $blddir == "" } {
yann@402
    50
+         error "Can't find libstdc++-v3"
yann@402
    51
+    }
yann@402
    52
 
yann@402
    53
     # By default, we assume we want to run program images.
yann@402
    54
     global dg-do-what-default