Subject: Re: Armlinux 2.0.33 compile fails

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Tue, 28 Apr 1998 21:39:36 +0100 (BST)

Glenn Ramsey writes:
> > > I have been unable to compile the latest 2.0.33 kernel with
> > > the 19980426 patch or the 19980419 patch
> > If this doesn't work, let me know, and please include a copy of
> > the .config file (in the linux/ directory).
> 
> It didn't work.

Well done ;)  You've found a problem in Linus' source code that apparantly
no one else has found yet.  Here is the patch that I'm forwarding for 2.0.34
to fix this problem:

--- orig/linux/net/netsyms.c    Sun Jan 18 21:58:25 1998
+++ linux/net/netsyms.c Tue Apr 28 20:37:55 1998
@@ -13,6 +13,7 @@
 #include <linux/netdevice.h>
 #include <linux/trdevice.h>
 #include <linux/ioport.h>
+#include <net/sock.h>

 #ifdef CONFIG_AX25
 #include <net/ax25.h>

Also, there appear to be link errors in this configuration, which are
fixed by:

--- orig/linux/net/core/sock.c	Sun Jan 18 21:57:37 1998
+++ linux/net/core/sock.c	Tue Apr 28 20:55:05 1998
@@ -72,6 +72,7 @@
  *					easier (suggested by Craig Metz).
  *		Michael Pall	:	SO_ERROR returns positive errno again
  *              Elliot Poger    :       Added support for SO_BINDTODEVICE.
+ *		Russell King	:	Add #ifdef CONFIG_INET to SO_BINDTODEVICE
  *
  * To Fix:
  *
@@ -247,13 +248,13 @@
  				if(err)
  					return err;
  				memcpy_fromfs(&req,optval,sizeof(req));
-
+#ifdef CONFIG_INET
 				/* Remove any cached route for this socket. */
 				if (sk->ip_route_cache) {
 					ip_rt_put(sk->ip_route_cache);
 					sk->ip_route_cache=NULL;
 				}
-
+#endif
  				if (*(req.ifr_name) == '\0') {
  					sk->bound_device = NULL;
  				} else {
--- orig/linux/net/ethernet/eth.c	Mon Aug  5 08:13:55 1996
+++ linux/net/ethernet/eth.c	Tue Apr 28 20:56:16 1998
@@ -30,6 +30,8 @@
  *		Alan Cox	: Protect against forwarding explosions with
  *				  older network drivers and IFF_ALLMULTI.
  *	Christer Weinigel	: Better rebuild header message.
+ *		Russell King	: eth_header_cache_bind and eth_header_cache_update
+ *				  only compiled if CONFIG_INET is selected
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
@@ -218,6 +220,7 @@
 	return htons(ETH_P_802_2);
 }
 
+#ifdef CONFIG_INET
 /*
  * Upper level calls this function to bind hardware header cache entry.
  * If the call is successful, then corresponding Address Resolution Protocol
@@ -258,6 +261,7 @@
 	memcpy(hh->hh_data, haddr, ETH_ALEN);
 	hh->hh_uptodate = 1;
 }
+#endif
 
 /*
  *	Copy from an ethernet device memory space to an sk_buff while checksumming if IP

You will also have to edit arch/arm/lib/Makefile to include checksum.o
unconditionally.

These will, naturally, be in my next 2.0 kernel patches on Sunday (and hopefully
the 2.0.34 kernel release from Linus when it happens).
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.uk.linux.org/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]