Full 2.3.40 compile overwhelms xargs, Makefile patch

Keith Owens kaos en ocs.com.au
Jue Ene 27 03:44:54 CST 2000


2.3.40 with almost every CONFIG_ option turned on is too much for
xargs.  As of findutils-4.1, xargs has a hardwired maximum value for
the environment of 20K.  With every CONFIG_ option turned on, the
kernel make environment is 23K and climbing, xargs refuses to run.

This patch against 2.3.40 removes CONFIG_ options from the environment
before running xargs proper.  Note: scripts/xargs must be chmod a+x.

Index: 40.1/Makefile
--- 40.1/Makefile Fri, 21 Jan 2000 21:04:07 +1100 keith (linux-2.3/M/b/40_Makefile 1.7.1.19.1.3.1.3.1.7.2.1 644)
+++ 40.1(w)/Makefile Thu, 27 Jan 2000 18:36:39 +1100 keith (linux-2.3/M/b/40_Makefile 1.7.1.19.1.3.1.3.1.7.2.1 644)
@@ -349,15 +349,15 @@
 
 TAGS: dummy
 	etags `find include/asm-$(ARCH) -name '*.h'`
-	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs etags -a
-	find $(SUBDIRS) init -name '*.c' | xargs etags -a
+	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | scripts/xargs etags -a
+	find $(SUBDIRS) init -name '*.c' | scripts/xargs etags -a
 
 # Exuberant ctags works better with -I 
 tags: dummy
 	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__initlocaldata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
 	ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
-	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
-	find $(SUBDIRS) init -name '*.c' | xargs ctags $$CTAGSF -a
+	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | scripts/xargs ctags $$CTAGSF -a && \
+	find $(SUBDIRS) init -name '*.c' | scripts/xargs ctags $$CTAGSF -a
 
 MODFLAGS = -DMODULE
 ifdef CONFIG_MODULES
@@ -426,7 +426,7 @@
 
 clean:	archclean
 	rm -f kernel/ksyms.lst include/linux/compile.h
-	find . -name '*.[oas]' -type f -print | grep -v lxdialog/ | xargs rm -f
+	find . -name '*.[oas]' -type f -print | grep -v lxdialog/ | scripts/xargs rm -f
 	rm -f core `find . -type f -name 'core' -print`
 	rm -f core `find . -type f -name '.*.flags' -print`
 	rm -f vmlinux System.map
@@ -470,7 +470,7 @@
 	sync
 
 sums:
-	find . -type f -print | sort | xargs sum > .SUMS
+	find . -type f -print | sort | scripts/xargs sum > .SUMS
 
 dep-files: scripts/mkdep archdep include/linux/version.h
 	scripts/mkdep init/*.c > .depend
@@ -487,7 +487,7 @@
 
 # make checkconfig: Prune 'scripts' directory to avoid "false positives".
 checkconfig:
-	find * -name '*.[hcS]' -type f -print | grep -v scripts/ | sort | xargs perl -w scripts/checkconfig.pl
+	find * -name '*.[hcS]' -type f -print | grep -v scripts/ | sort | scripts/xargs perl -w scripts/checkconfig.pl
 
 checkhelp:
 	perl -w scripts/checkhelp.pl `find * -name [cC]onfig.in -print`
Index: 40.1/scripts/xargs
--- 40.1/scripts/xargs Thu, 27 Jan 2000 18:36:42 +1100 keith ()
+++ 40.1(w)/scripts/xargs Thu, 27 Jan 2000 18:35:30 +1100 keith (linux-2.3/x/c/5_xargs  644)
@@ -0,0 +1,6 @@
+#!/bin/bash
+# xargs has hardwired limits on the "sensible" environment size.  A
+# kernel compile with every config option turned on blows this limit.
+# Strip out CONFIG_ env variables before calling xargs.
+unset `env | grep '^CONFIG_' | sed -e 's/=.*//'`
+xargs "$@"


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



Más información sobre la lista de distribución Ayuda