Still needed and patch

Marcin Dalecki (dalecki@cs.net.pl)
Wed, 15 Apr 1998 14:24:19 -0700


This is a multi-part message in MIME format.
--------------47D64CD2D9E5C3CFFBD4E84E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The following patch is the same I already submitted months ago!
It makes it feasible to compile the kernel without support for
networking.

Alan Cox promised that there will be some better cleaner ... solution.
It didn't appear. And since we are going to stabilize the kernel again
this should
be applied. Toght even if the CONFIG_UNIX is a compleate missnomer.

If you are not connected this patch will you save some several 100k's in
kernel size.
(Yes the current TCP/IP networking code is HUGE).

If there are doubt's about why I did rearrange the compilation of some
otherwise not used
stuff please just think about the following scenario:

There are the modules A.o B.o and C.o. Let C.o be the main modules (in
esp. containing the main entry point.)

C.o doesn't use anything from A.o and anything from B.o but A.o contains
refferences to
symbols defined in B.o and B.o contains refferences to symbols defined
in A.o.

What do You think ld does with them? It's simple it sees some symbols
from A.o beeing used (used in B.o!) and it sees some symbols from B.o
beeing used (in A.o). Therefore it includes BOTH A.o and B.o into the
produced executable. Despite the fact that both of them are COMPLEATLY
DEAD code. Call it a bug or a feature of the binutils I don't see any
way
to correct this problem in them easly. And I wonder it there are even
more circumstances like that in the kernel.

-- 
=========================================================================
  In real life:         System Programmer at AIS AXON GmbH
--------------47D64CD2D9E5C3CFFBD4E84E
Content-Type: text/plain; charset=us-ascii; name="diff-applied"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="diff-applied"

diff -ur linux-2.1.92/Makefile linux/Makefile --- linux-2.1.92/Makefile Fri Mar 27 00:58:18 1998 +++ linux/Makefile Thu Apr 2 18:57:44 1998 @@ -11,7 +11,7 @@ # # For UP operations COMMENT THIS OUT, simply setting SMP = 0 won't work # -SMP = 1 +# SMP = 1 .EXPORT_ALL_VARIABLES: diff -ur linux-2.1.92/arch/alpha/config.in linux/arch/alpha/config.in --- linux-2.1.92/arch/alpha/config.in Mon Mar 30 10:21:39 1998 +++ linux/arch/alpha/config.in Thu Apr 2 18:57:44 1998 @@ -183,6 +183,7 @@ bool 'Backward-compatible /proc/pci' CONFIG_PCI_OLD_PROC fi bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'System V IPC' CONFIG_SYSVIPC bool 'Sysctl support' CONFIG_SYSCTL tristate 'Kernel support for a.out (ECOFF) binaries' CONFIG_BINFMT_AOUT diff -ur linux-2.1.92/arch/alpha/defconfig linux/arch/alpha/defconfig --- linux-2.1.92/arch/alpha/defconfig Mon Mar 30 10:21:39 1998 +++ linux/arch/alpha/defconfig Thu Apr 2 18:57:44 1998 @@ -50,6 +50,7 @@ CONFIG_TGA_CONSOLE=y CONFIG_PCI_OLD_PROC=y CONFIG_NET=y +CONFIG_UNIX=y CONFIG_SYSVIPC=y CONFIG_SYSCTL=y CONFIG_BINFMT_AOUT=y diff -ur linux-2.1.92/arch/i386/Makefile linux/arch/i386/Makefile --- linux-2.1.92/arch/i386/Makefile Fri Mar 27 18:32:02 1998 +++ linux/arch/i386/Makefile Thu Apr 2 18:57:45 1998 @@ -24,7 +24,7 @@ LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) CFLAGS_PIPE := -pipe -CFLAGS_NSR := -fno-strength-reduce +CFLAGS_NSR := CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) $(CFLAGS_NSR) ifdef CONFIG_M386 @@ -36,7 +36,7 @@ endif ifdef CONFIG_M586 -CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 +CFLAGS := $(CFLAGS) -march=pentium -DCPU=586 endif ifdef CONFIG_M686 diff -ur linux-2.1.92/arch/i386/config.in linux/arch/i386/config.in --- linux-2.1.92/arch/i386/config.in Sun Mar 29 22:16:12 1998 +++ linux/arch/i386/config.in Thu Apr 2 18:57:45 1998 @@ -33,6 +33,7 @@ comment 'General setup' bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'PCI support' CONFIG_PCI if [ "$CONFIG_PCI" = "y" ]; then bool ' PCI BIOS support' CONFIG_PCI_BIOS Only in linux/arch/i386: config.in.orig diff -ur linux-2.1.92/arch/i386/defconfig linux/arch/i386/defconfig --- linux-2.1.92/arch/i386/defconfig Sun Mar 29 22:16:12 1998 +++ linux/arch/i386/defconfig Thu Apr 2 18:57:45 1998 @@ -28,6 +28,7 @@ # General setup # CONFIG_NET=y +CONFIG_UNIX=y CONFIG_PCI=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y @@ -88,7 +89,6 @@ # CONFIG_FIREWALL is not set # CONFIG_NET_ALIAS is not set # CONFIG_FILTER is not set -CONFIG_UNIX=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set diff -ur linux-2.1.92/arch/m68k/config.in linux/arch/m68k/config.in --- linux-2.1.92/arch/m68k/config.in Sun Mar 29 22:16:12 1998 +++ linux/arch/m68k/config.in Thu Apr 2 18:57:45 1998 @@ -64,6 +64,7 @@ comment 'General setup' bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL Only in linux/arch/m68k: config.in.orig diff -ur linux-2.1.92/arch/m68k/defconfig linux/arch/m68k/defconfig --- linux-2.1.92/arch/m68k/defconfig Tue Mar 10 23:43:13 1998 +++ linux/arch/m68k/defconfig Wed Mar 18 19:52:42 1998 @@ -37,6 +37,7 @@ # General setup # CONFIG_NET=y +CONFIG_UNIX=y CONFIG_SYSVIPC=y CONFIG_SYSCTL=y CONFIG_BINFMT_AOUT=y diff -ur linux-2.1.92/arch/mips/config.in linux/arch/mips/config.in --- linux-2.1.92/arch/mips/config.in Tue Mar 10 23:43:13 1998 +++ linux/arch/mips/config.in Wed Mar 18 19:52:42 1998 @@ -95,6 +95,7 @@ fi bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'System V IPC' CONFIG_SYSVIPC bool 'Sysctl support' CONFIG_SYSCTL diff -ur linux-2.1.92/arch/mips/defconfig linux/arch/mips/defconfig --- linux-2.1.92/arch/mips/defconfig Wed Dec 10 19:31:09 1997 +++ linux/arch/mips/defconfig Wed Mar 18 19:52:42 1998 @@ -38,6 +38,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_NET=y +CONFIG_UNIX=y CONFIG_SYSVIPC=y CONFIG_SYSCTL=y # CONFIG_PARPORT is not set diff -ur linux-2.1.92/arch/ppc/config.in linux/arch/ppc/config.in --- linux-2.1.92/arch/ppc/config.in Sun Mar 29 22:16:12 1998 +++ linux/arch/ppc/config.in Thu Apr 2 18:57:45 1998 @@ -41,6 +41,7 @@ fi bool 'Backward-compatible /proc/pci' CONFIG_PCI_OLD_PROC bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'Sysctl support' CONFIG_SYSCTL bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT Only in linux/arch/ppc: config.in.orig diff -ur linux-2.1.92/arch/ppc/defconfig linux/arch/ppc/defconfig --- linux-2.1.92/arch/ppc/defconfig Tue Mar 10 23:43:13 1998 +++ linux/arch/ppc/defconfig Wed Mar 18 19:52:42 1998 @@ -24,6 +24,7 @@ # CONFIG_PCI_OPTIMIZE is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y +CONFIG_UNIX=y # CONFIG_SYSCTL is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -79,7 +80,6 @@ # CONFIG_NETLINK is not set # CONFIG_FIREWALL is not set # CONFIG_NET_ALIAS is not set -CONFIG_UNIX=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set diff -ur linux-2.1.92/arch/sparc/config.in linux/arch/sparc/config.in --- linux-2.1.92/arch/sparc/config.in Sun Mar 29 22:16:12 1998 +++ linux/arch/sparc/config.in Thu Apr 2 18:57:45 1998 @@ -51,6 +51,7 @@ tristate 'Openprom tree appears in /proc/openprom (EXPERIMENTAL)' CONFIG_SUN_OPENPROMFS bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL Only in linux/arch/sparc: config.in.orig diff -ur linux-2.1.92/arch/sparc/defconfig linux/arch/sparc/defconfig --- linux-2.1.92/arch/sparc/defconfig Tue Mar 10 23:43:13 1998 +++ linux/arch/sparc/defconfig Wed Mar 18 19:52:42 1998 @@ -60,6 +60,7 @@ # CONFIG_SPARCAUDIO_CS4231 is not set CONFIG_SUN_OPENPROMFS=m CONFIG_NET=y +CONFIG_UNIX=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y diff -ur linux-2.1.92/arch/sparc64/config.in linux/arch/sparc64/config.in --- linux-2.1.92/arch/sparc64/config.in Sun Mar 29 22:16:12 1998 +++ linux/arch/sparc64/config.in Thu Apr 2 18:57:45 1998 @@ -51,6 +51,7 @@ tristate 'Openprom tree appears in /proc/openprom (EXPERIMENTAL)' CONFIG_SUN_OPENPROMFS bool 'Backward-compatible /proc/pci' CONFIG_PCI_OLD_PROC bool 'Networking support' CONFIG_NET +tristate 'Unix domain sockets' CONFIG_UNIX bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL Only in linux/arch/sparc64: config.in.orig diff -ur linux-2.1.92/arch/sparc64/defconfig linux/arch/sparc64/defconfig --- linux-2.1.92/arch/sparc64/defconfig Sun Mar 29 22:16:12 1998 +++ linux/arch/sparc64/defconfig Thu Apr 2 18:57:45 1998 @@ -57,6 +57,7 @@ # CONFIG_SUN_VIDEOPIX is not set CONFIG_SUN_OPENPROMFS=m CONFIG_NET=y +CONFIG_UNIX=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y diff -ur linux-2.1.92/net/Config.in linux/net/Config.in --- linux-2.1.92/net/Config.in Thu Feb 19 23:46:15 1998 +++ linux/net/Config.in Wed Mar 18 19:52:42 1998 @@ -12,7 +12,6 @@ bool 'Network firewalls' CONFIG_FIREWALL bool 'Network aliasing' CONFIG_NET_ALIAS bool 'Socket Filtering' CONFIG_FILTER -tristate 'Unix domain sockets' CONFIG_UNIX bool 'TCP/IP networking' CONFIG_INET if [ "$CONFIG_INET" = "y" ]; then source net/ipv4/Config.in diff -ur linux-2.1.92/net/core/Makefile linux/net/core/Makefile --- linux-2.1.92/net/core/Makefile Wed Jan 14 05:15:33 1998 +++ linux/net/core/Makefile Wed Mar 18 19:52:42 1998 @@ -9,8 +9,8 @@ O_TARGET := core.o -O_OBJS := sock.o skbuff.o iovec.o datagram.o dst.o scm.o \ - neighbour.o rtnetlink.o utils.o +O_OBJS := sock.o skbuff.o iovec.o datagram.o scm.o \ + rtnetlink.o utils.o ifeq ($(CONFIG_SYSCTL),y) O_OBJS += sysctl_net_core.o @@ -22,7 +22,7 @@ ifdef CONFIG_NET -O_OBJS += dev.o dev_mcast.o +O_OBJS += dst.o neighbour.o dev.o dev_mcast.o ifdef CONFIG_FIREWALL OX_OBJS += firewall.o diff -ur linux-2.1.92/net/core/sock.c linux/net/core/sock.c --- linux-2.1.92/net/core/sock.c Tue Mar 24 01:48:25 1998 +++ linux/net/core/sock.c Fri Mar 27 14:51:46 1998 @@ -153,7 +153,6 @@ int valbool; int err; struct linger ling; - struct ifreq req; int ret = 0; #ifdef CONFIG_FILTER @@ -289,7 +288,7 @@ sock->passcred = valbool; break; - +#ifdef CONFIG_NET case SO_BINDTODEVICE: /* Bind this socket to a particular device like "eth0", * as specified in an ifreq structure. If the device @@ -300,6 +299,7 @@ sk->bound_dev_if = 0; } else { + struct ifreq req; if (copy_from_user(&req, optval, sizeof(req))) return -EFAULT; @@ -316,6 +316,7 @@ } } return 0; +#endif #ifdef CONFIG_FILTER

--------------47D64CD2D9E5C3CFFBD4E84E--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu