Compilation warnings with "proposed 2.2.11pre2" and redhat 6.0 system

bmccann@indusriver.com
Mon, 26 Jul 1999 06:55:55 -0400


Hi Alan,

I'm getting symbol redefinition warnings when compiling user space
applications on a Redhat 6.0 system with the proposed 2.2.11pre2 patch.

This was caused by the following change in asm-i386/socket.h:

diff -u --new-file --recursive --exclude-from ../exclude
linux.vanilla/include/asm-i386/socket.h linux.pre11.3/include/asm-i386/socket.h
--- linux.vanilla/include/asm-i386/socket.h Sun Nov 8 15:06:53 1998
+++ linux.pre11.3/include/asm-i386/socket.h Tue Jul 20 00:11:48 1999
@@ -39,4 +39,19 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27

+/* Nasty libc5 fixup - bletch */
+#if defined(__KERNEL__) || (LIBC_VERSION < 6)
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+#define SOCK_PACKET 10 /* linux specific way of */
+ /* getting packets at the dev */
+ /* level. For writing rarp and */
+ /* other similar things on the */
+ /* user level. */
+#endif
+
#endif /* _ASM_SOCKET_H */

The problem is 'LIBC_VERSION' is undefined in my Redhat 6.0 compilation
environment. (In fact, I can't find any definitions of LIBC_VERSION anywhere
in my /usr/include tree). I did some hunting around and I think a better patch
is:

diff -u --new-file --recursive --exclude-from ../exclude
linux.vanilla/include/asm-i386/socket.h linux.pre11.3/include/asm-i386/socket.h
--- linux.vanilla/include/asm-i386/socket.h Sun Nov 8 15:06:53 1998
+++ linux.pre11.3/include/asm-i386/socket.h Tue Jul 20 00:11:48 1999
@@ -39,4 +39,19 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27

+/* Nasty libc5 fixup - bletch */
+#if defined(__KERNEL__) || !defined(__GLIBC__)
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+#define SOCK_PACKET 10 /* linux specific way of */
+ /* getting packets at the dev */
+ /* level. For writing rarp and */
+ /* other similar things on the */
+ /* user level. */
+#endif
+
#endif /* _ASM_SOCKET_H */

Note the check of '__GLIBC__'. I think this symbol is undefined in
libc5 systems but I'm not sure. None of our systems use libc5 anymore.

Please check this and then fix include/asm-i386/socket.h as needed.

Thanks,
Ben McCann

-- 
---
Ben McCann                              Indus River Networks
                                        31 Nagog Park
                                        Acton, MA, 01720
email: bmccann@indusriver.com           web: www.indusriver.com 
phone: (978) 266-8140                   fax: (978) 266-8111

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/