patches/linux/2.4.26/110-kaz-types.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
The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4:
yann@402
     2
yann@402
     3
In file included from sys/ustat.h:30,
yann@402
     4
                 from ../sysdeps/unix/sysv/linux/ustat.c:21:
yann@402
     5
../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat'
yann@402
     6
make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1
yann@402
     7
make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc'
yann@402
     8
make[1]: *** [misc/subdir_lib] Error 2
yann@402
     9
make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2'
yann@402
    10
make: *** [all] Error 2
yann@402
    11
yann@402
    12
----------- snip ---------------
yann@402
    13
yann@402
    14
Date: Fri, 06 Jun 2003 08:00:00 +0900
yann@402
    15
From: kaz Kojima <kkojima@rr.iij4u.or.jp>
yann@402
    16
Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32:
yann@402
    17
 error: redefinition of `struct user_fpu_struct'"
yann@402
    18
To: linux-sh@m17n.org
yann@402
    19
Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp>
yann@402
    20
yann@402
    21
Hi,
yann@402
    22
yann@402
    23
Dan Kegel <dank@kegel.com> wrote:
yann@402
    24
> When I try to build glibc-2.3.2 for sh4, it fails with the error
yann@402
    25
[snip]
yann@402
    26
> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct'
yann@402
    27
> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user'
yann@402
    28
[snip]
yann@402
    29
> The error reminds me of the kind of thing fixed by
yann@402
    30
> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch
yann@402
    31
yann@402
    32
It seems that the definitions in asm/user.h and the above patch collide.
yann@402
    33
I'm not sure why you need this patch, but is it needed for the problem
yann@402
    34
about struct ustat that you pointed out in this list, isn't it?
yann@402
    35
I found why I don't hit ustat problem - my local kernel tree includes
yann@402
    36
the following patch, though I can't recall about it.
yann@402
    37
yann@402
    38
Regards,
yann@402
    39
	kaz
yann@402
    40
--
yann@402
    41
diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h
yann@402
    42
--- linux-2.5.69-sf-orig/include/linux/types.h	Wed Mar  5 12:29:34 2003
yann@402
    43
+++ sh4-unknown-linux-gnu/include/linux/types.h	Sat Apr 19 10:05:52 2003
yann@402
    44
@@ -141,6 +141,7 @@
yann@402
    45
 
yann@402
    46
 #endif /* __KERNEL_STRICT_NAMES */
yann@402
    47
 
yann@402
    48
+#ifdef	__KERNEL__
yann@402
    49
 /*
yann@402
    50
  * Below are truly Linux-specific types that should never collide with
yann@402
    51
  * any application/library that wants linux/types.h.
yann@402
    52
@@ -152,5 +153,6 @@
yann@402
    53
 	char			f_fname[6];
yann@402
    54
 	char			f_fpack[6];
yann@402
    55
 };
yann@402
    56
+#endif
yann@402
    57
 
yann@402
    58
 #endif /* _LINUX_TYPES_H */
yann@402
    59
yann@402
    60