New bbox build system In a few commits ending with rev 16310 bbox build system was replaces by with Linux kernel's one, slightly adapted. I resisted the desire to drop "unneeded" parts of kbuild (like support for modules). It simply isn't helpful in any way (busybox binary won't shrink because of that), but will add difficulties if someone will try to apply fixes from kernel's kbuild to bbox's one. So I basically just did 's/vmlinux/busybox' in Makefile and fixed only those parts which I really needed in order to make bbox build. The diff between kernel and bbox kbuild is shown at the end. How new system works (linkage) We compile all modules in the subdirectory with -ffunction-sections -fdata-sections so that each function or data object is in its own section. Then we can group modules in the directory into one .o module named built-in.o (using ld -r). Or we can just bundle them together into a "library", i.e., an archive file named lib.a. Then we do final link, combining them all. Unless we have gone to great pains and separated every last function and variable into their own small module, we will definitely have some unused objects within .o modules. Due to decades long historic baggage Unix linkers (including GNU ld) did NOT link applications by collecting C objects, they worked on the whole .o modules instead. It is starting to change. ld has --gc-sections, which directs it to throw away sections which are unreferenced. IOW: ld works like this (I think): 1. Link together all .o modules. 2. Resolve all undefined references using supplied .a and .so libs. 3. If --gc-sections is specified, find and throw away any unreferenced sections. Note that while unneeded parts from .a files (unreferenced *.o files) are never pulled in at all, unneeded parts of .o files are pulled in, and then removed again. However, there is a lot of various small special things added by gcc and/or ld to ELF object modules. Try objdump -sxdr busybox_unstripped. What .eh_frame, .ctors, .dtors, .jcr sections are? Well, I am not complaining, I suppose they are needed, but why they are not removed by --gc-sections when their .text counterparts are? This is why we build most of busybox into lib.a's. It pulls in less cruft. Small testcase where --gc-sections fail to remove unused code: /* Compile: ** gcc -ffunction-sections -fdata-sections -c -o test.o test.c ** gcc -o test -Wl,--gc-sections test.o ** ** First call to notexist() is optimized away by linker because ** function eliminated() is, er, eliminated by section GC. ** ** But second call to notexist() is not optimized away, ** despite the fact that getpwnam_r() is not called from anywhere. ** Then linking fails because notexist() isn't exist. ** ** Renaming getpwnam_r to any other name "fixes" this! */ void notexist(void); int main(void) { return 0; } void eliminated(void) { notexist(); } void getpwnam_r(void) { notexist(); } // HERE I suspect there is a lot of vaguely similar cases. I did not investigate them in depth. See three source tree snapshots: busybox.0 builds everything to .o modules, busybox.1 also does this but tries to paper over "getpwnam_r bug", and busybox.2 builds everything to .a modules. On a single-applet config: # size */busybox text data bss dec hex filename 17701 864 3624 22189 56ad busybox.0/busybox 14186 868 24 15078 3ae6 busybox.1/busybox 2682 304 24 3010 bc2 busybox.2/busybox I give up for now on the "make ld --gc-sections work right" front. Related binutils bugzilla entry: http://sourceware.org/bugzilla/show_bug.cgi?id=3315 diff -urp kernel.0/Makefile busybox.1/Makefile --- kernel.0/Makefile 2006-08-27 12:32:05.000000000 +0200 +++ busybox.1/Makefile 2006-10-06 15:41:11.000000000 +0200 @@ -1,8 +1,8 @@ -VERSION = 2 -PATCHLEVEL = 6 -SUBLEVEL = 17 -EXTRAVERSION = .8 -NAME=Crazed Snow-Weasel +VERSION = 1 +PATCHLEVEL = 2 +SUBLEVEL = 1 +EXTRAVERSION = .svn +NAME=Unnamed # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -268,7 +268,7 @@ include $(srctree)/scripts/Kbuild.inclu # For maximum performance (+ possibly random breakage, uncomment # the following) -#MAKEFLAGS += -rR +MAKEFLAGS += -rR # Make variables (CC, etc...) @@ -299,15 +299,10 @@ AFLAGS_KERNEL = # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option -LINUXINCLUDE := -Iinclude \ - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ - -include include/linux/autoconf.h - -CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) - -CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common -AFLAGS := -D__ASSEMBLY__ +CFLAGS := +CPPFLAGS := +AFLAGS := +include $(srctree)/Makefile.flags # Read KERNELRELEASE from .kernelrelease (if it exists) KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) @@ -400,7 +395,7 @@ ifeq ($(config-targets),1) # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. # KBUILD_DEFCONFIG may point out an alternative default configuration # used for 'make defconfig' -include $(srctree)/arch/$(ARCH)/Makefile +-include $(srctree)/arch/$(ARCH)/Makefile export KBUILD_DEFCONFIG config %config: scripts_basic outputmakefile FORCE @@ -421,14 +416,41 @@ PHONY += scripts scripts: scripts_basic include/config/MARKER $(Q)$(MAKE) $(build)=$(@) -scripts_basic: include/linux/autoconf.h +scripts_basic: include/autoconf.h # Objects we will link into busybox / subdirs we need to visit -init-y := init/ -drivers-y := drivers/ sound/ -net-y := net/ -libs-y := lib/ -core-y := usr/ +core-y := \ + applets/ \ + +libs-y := \ + archival/ \ + archival/libunarchive/ \ + console-tools/ \ + coreutils/ \ + coreutils/libcoreutils/ \ + debianutils/ \ + e2fsprogs/ \ + e2fsprogs/blkid/ \ + e2fsprogs/e2p/ \ + e2fsprogs/ext2fs/ \ + e2fsprogs/uuid/ \ + editors/ \ + findutils/ \ + init/ \ + libbb/ \ + libpwdgrp/ \ + loginutils/ \ + miscutils/ \ + modutils/ \ + networking/ \ + networking/libiproute/ \ + networking/udhcp/ \ + procps/ \ + runit/ \ + shell/ \ + sysklogd/ \ + util-linux/ \ + endif # KBUILD_EXTMOD ifeq ($(dot-config),1) @@ -438,23 +460,24 @@ ifeq ($(dot-config),1) # oldconfig if changes are detected. -include .kconfig.d -include .config +-include .config # If .config needs to be updated, it will be done via the dependency # that autoconf has on .config. # To avoid any implicit rule to kick in, define an empty command .config .kconfig.d: ; -# If .config is newer than include/linux/autoconf.h, someone tinkered +# If .config is newer than include/autoconf.h, someone tinkered # with it and forgot to run make oldconfig. # If kconfig.d is missing then we are probarly in a cleaned tree so # we execute the config step to be sure to catch updated Kconfig files -include/linux/autoconf.h: .kconfig.d .config +include/autoconf.h: .kconfig.d .config $(Q)mkdir -p include/linux $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig + else # Dummy target needed, because used as prerequisite -include/linux/autoconf.h: ; +include/autoconf.h: ; endif # The all: target is the default when no target is given on the @@ -463,31 +486,11 @@ endif # Defaults busybox but it is usually overriden in the arch makefile all: busybox -ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -CFLAGS += -Os -else -CFLAGS += -O2 -endif - -ifdef CONFIG_FRAME_POINTER -CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,) -else -CFLAGS += -fomit-frame-pointer -endif - -ifdef CONFIG_UNWIND_INFO -CFLAGS += -fasynchronous-unwind-tables -endif - -ifdef CONFIG_DEBUG_INFO -CFLAGS += -g -endif - -include $(srctree)/arch/$(ARCH)/Makefile +-include $(srctree)/arch/$(ARCH)/Makefile # arch Makefile may override CC so keep this after arch Makefile is included -NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) -CHECKFLAGS += $(NOSTDINC_FLAGS) +#bbox# NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +CHECKFLAGS += $(NOSTDINC_FLAGS) # warn about C99 declaration after statement CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) @@ -518,25 +521,18 @@ export MODLIB ifeq ($(KBUILD_EXTMOD),) -core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ - -busybox-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ - $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ - $(net-y) $(net-m) $(libs-y) $(libs-m))) +busybox-dirs := $(patsubst %/,%,$(filter %/, $(core-y) $(core-m) $(libs-y) $(libs-m))) busybox-alldirs := $(sort $(busybox-dirs) $(patsubst %/,%,$(filter %/, \ - $(init-n) $(init-) \ - $(core-n) $(core-) $(drivers-n) $(drivers-) \ - $(net-n) $(net-) $(libs-n) $(libs-)))) + $(core-n) $(core-) $(libs-n) $(libs-) \ + ))) -init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y)) -drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) -net-y := $(patsubst %/, %/built-in.o, $(net-y)) libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y := $(libs-y1) $(libs-y2) + # Build busybox # --------------------------------------------------------------------------- # busybox is build from the objects selected by $(busybox-init) and @@ -564,30 +560,14 @@ libs-y := $(libs-y1) $(libs-y2) # # System.map is generated to document addresses of all kernel symbols -busybox-init := $(head-y) $(init-y) -busybox-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) -busybox-all := $(busybox-init) $(busybox-main) -busybox-lds := arch/$(ARCH)/kernel/busybox.lds +busybox-all := $(core-y) $(libs-y) # Rule to link busybox - also used during CONFIG_KALLSYMS # May be overridden by arch/$(ARCH)/Makefile -quiet_cmd_busybox__ ?= LD $@ - cmd_busybox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_busybox) -o $@ \ - -T $(busybox-lds) $(busybox-init) \ - --start-group $(busybox-main) --end-group \ - $(filter-out $(busybox-lds) $(busybox-init) $(busybox-main) FORCE ,$^) - -# Generate new busybox version -quiet_cmd_busybox_version = GEN .version - cmd_busybox_version = set -e; \ - if [ ! -r .version ]; then \ - rm -f .version; \ - echo 1 >.version; \ - else \ - mv .version .old_version; \ - expr 0$$(cat .old_version) + 1 >.version; \ - fi; \ - $(MAKE) $(build)=init +quiet_cmd_busybox__ ?= LINK $@ + cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) -o $@ \ + -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ + -Wl,--start-group $(busybox-all) -Wl,--end-group \ # Generate System.map quiet_cmd_sysmap = SYSMAP @@ -600,19 +580,8 @@ quiet_cmd_sysmap = SYSMAP # First command is ':' to allow us to use + in front of the rule define rule_busybox__ : - $(if $(CONFIG_KALLSYMS),,+$(call cmd,busybox_version)) - $(call cmd,busybox__) $(Q)echo 'cmd_$@ := $(cmd_busybox__)' > $(@D)/.$(@F).cmd - - $(Q)$(if $($(quiet)cmd_sysmap), \ - echo ' $($(quiet)cmd_sysmap) System.map' &&) \ - $(cmd_sysmap) $@ System.map; \ - if [ $$? -ne 0 ]; then \ - rm -f $@; \ - /bin/false; \ - fi; - $(verify_kallsyms) endef @@ -700,13 +669,17 @@ debug_kallsyms: .tmp_map$(last_kallsyms) endif # ifdef CONFIG_KALLSYMS # busybox image - including updated kernel symbols -busybox: $(busybox-lds) $(busybox-init) $(busybox-main) $(kallsyms.o) FORCE +busybox_unstripped: $(busybox-all) FORCE $(call if_changed_rule,busybox__) $(Q)rm -f .old_version +busybox: busybox_unstripped + $(Q)strip -s --remove-section=.note --remove-section=.comment \ + busybox_unstripped -o $@ + # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(busybox-init) $(busybox-main)) $(busybox-lds): $(busybox-dirs) ; +$(sort $(busybox-all)): $(busybox-dirs) ; # Handle descending into subdirectories listed in $(busybox-dirs) # Preset locale variables to speed up the build process. Limit locale @@ -791,8 +764,7 @@ endif # prepare2 creates a makefile if using a separate output directory prepare2: prepare3 outputmakefile -prepare1: prepare2 include/linux/version.h include/asm \ - include/config/MARKER +prepare1: prepare2 include/config/MARKER ifneq ($(KBUILD_MODULES),) $(Q)mkdir -p $(MODVERDIR) $(Q)rm -f $(MODVERDIR)/* @@ -815,16 +787,21 @@ export CPPFLAGS_busybox.lds += -P -C -U$ # hard to detect, but I suppose "make mrproper" is a good idea # before switching between archs anyway. -include/asm: - @echo ' SYMLINK $@ -> include/asm-$(ARCH)' - $(Q)if [ ! -d include ]; then mkdir -p include; fi; - @ln -fsn asm-$(ARCH) $@ +#bbox# include/asm: +#bbox# @echo ' SYMLINK $@ -> include/asm-$(ARCH)' +#bbox# $(Q)if [ ! -d include ]; then mkdir -p include; fi; +#bbox# @ln -fsn asm-$(ARCH) $@ # Split autoconf.h into include/linux/config/* - -include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h - @echo ' SPLIT include/linux/autoconf.h -> include/config/*' - @scripts/basic/split-include include/linux/autoconf.h include/config +#bbox# piggybacked generation of few .h files +include/config/MARKER: scripts/basic/split-include include/autoconf.h + @echo ' SPLIT include/autoconf.h -> include/config/*' + @scripts/basic/split-include include/autoconf.h include/config + @echo ' GEN include/bbconfigopts.h' + @$(srctree)/scripts/mkconfigs >include/bbconfigopts.h + @$(MAKE) $(build)=scripts + @echo ' GEN include/usage_compressed.h' + @$(srctree)/scripts/usage_compressed include/usage_compressed.h scripts @touch $@ # Generate some files @@ -846,9 +823,6 @@ define filechk_version.h ) endef -include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE - $(call filechk,version.h) - # --------------------------------------------------------------------------- PHONY += depend dep @@ -935,13 +909,15 @@ endif # CONFIG_MODULES # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) -CLEAN_FILES += busybox System.map \ +CLEAN_FILES += busybox* System.map \ .tmp_kallsyms* .tmp_version .tmp_busybox* .tmp_System.map # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ - include/linux/autoconf.h include/linux/version.h \ + include/autoconf.h \ + include/bbconfigopts.h \ + include/usage_compressed.h \ .kernelrelease Module.symvers tags TAGS cscope* # clean - Delete most, but leave enough to build external modules @@ -966,7 +942,7 @@ clean: archclean $(clean-dirs) # mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) mrproper: rm-files := $(wildcard $(MRPROPER_FILES)) -mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts) +mrproper-dirs := $(addprefix _mrproper_,scripts) PHONY += $(mrproper-dirs) mrproper archmrproper $(mrproper-dirs): @@ -1006,55 +982,7 @@ rpm: FORCE boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) boards := $(notdir $(boards)) -help: - @echo 'Cleaning targets:' - @echo ' clean - remove most generated files but keep the config' - @echo ' mrproper - remove all generated files + config + various backup files' - @echo '' - @echo 'Configuration targets:' - @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help - @echo '' - @echo 'Other generic targets:' - @echo ' all - Build all targets marked with [*]' - @echo '* busybox - Build the bare kernel' - @echo '* modules - Build all modules' - @echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)' - @echo ' dir/ - Build all files in dir and below' - @echo ' dir/file.[ois] - Build specified target only' - @echo ' dir/file.ko - Build module including final link' - @echo ' rpm - Build a kernel as an RPM package' - @echo ' tags/TAGS - Generate tags file for editors' - @echo ' cscope - Generate cscope index' - @echo ' kernelrelease - Output the release version string' - @echo ' kernelversion - Output the version stored in Makefile' - @echo '' - @echo 'Static analysers' - @echo ' checkstack - Generate a list of stack hogs' - @echo ' namespacecheck - Name space analysis on compiled kernel' - @echo '' - @echo 'Kernel packaging:' - @$(MAKE) $(build)=$(package-dir) help - @echo '' - @echo 'Documentation targets:' - @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp - @echo '' - @echo 'Architecture specific targets ($(ARCH)):' - @$(if $(archhelp),$(archhelp),\ - echo ' No architecture specific help defined for $(ARCH)') - @echo '' - @$(if $(boards), \ - $(foreach b, $(boards), \ - printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \ - echo '') - - @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' - @echo ' make O=dir [targets] Locate all output files in "dir", including .config' - @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse)' - @echo ' make C=2 [targets] Force check of all c source with $$CHECK (sparse)' - @echo '' - @echo 'Execute "make" or "make all" to build all targets marked with [*] ' - @echo 'For further info see the ./README file' - +-include Makefile.help # Documentation targets # --------------------------------------------------------------------------- @@ -1348,6 +1276,7 @@ endif # skip-makefile PHONY += FORCE FORCE: +-include Makefile.custom # Declare the contents of the .PHONY variable as phony. We keep that # information in a variable se we can use it in if_changed and friends. diff -urp kernel.0/scripts/basic/fixdep.c busybox.1/scripts/basic/fixdep.c --- kernel.0/scripts/basic/fixdep.c 2006-08-07 06:18:54.000000000 +0200 +++ busybox.1/scripts/basic/fixdep.c 2006-10-05 12:10:57.000000000 +0200 @@ -320,7 +320,7 @@ void parse_dep_file(void *map, size_t le p++; } memcpy(s, m, p-m); s[p-m] = 0; - if (strrcmp(s, "include/linux/autoconf.h") && + if (strrcmp(s, "include/autoconf.h") && strrcmp(s, "arch/um/include/uml-config.h") && strrcmp(s, ".ver")) { printf(" %s \\\n", s); diff -urp kernel.0/scripts/kconfig/confdata.c busybox.1/scripts/kconfig/confdata.c --- kernel.0/scripts/kconfig/confdata.c 2006-08-07 06:18:54.000000000 +0200 +++ busybox.1/scripts/kconfig/confdata.c 2006-10-06 15:41:10.000000000 +0200 @@ -22,7 +22,7 @@ static int conf_lineno, conf_warnings, c const char conf_def_filename[] = ".config"; -const char conf_defname[] = "arch/$ARCH/defconfig"; +const char conf_defname[] = "scripts/defconfig"; const char *conf_confnames[] = { ".config", @@ -391,17 +391,22 @@ int conf_write(const char *name) sym_get_string_value(sym), use_timestamp ? "# " : "", use_timestamp ? ctime(&now) : ""); - if (out_h) + if (out_h) { + char buf[sizeof("#define AUTOCONF_TIMESTAMP " + "\"YYYY-MM-DD HH:MM:SS some_timezone\"\n")]; + buf[0] = '\0'; + if (use_timestamp) + strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP " + "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now)); fprintf(out_h, "/*\n" " * Automatically generated C config: don't edit\n" " * Linux kernel version: %s\n" - "%s%s" " */\n" + "%s" "#define AUTOCONF_INCLUDED\n", sym_get_string_value(sym), - use_timestamp ? " * " : "", - use_timestamp ? ctime(&now) : ""); - + buf); + } if (!sym_change_count) sym_clear_all_valid(); @@ -438,8 +443,13 @@ int conf_write(const char *name) switch (sym_get_tristate_value(sym)) { case no: fprintf(out, "# CONFIG_%s is not set\n", sym->name); - if (out_h) + if (out_h) { fprintf(out_h, "#undef CONFIG_%s\n", sym->name); + /* bbox */ + fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); + fprintf(out_h, "#define USE_%s(...)\n", sym->name); + fprintf(out_h, "#define SKIP_%s(...) __VA_ARGS__\n", sym->name); + } break; case mod: fprintf(out, "CONFIG_%s=m\n", sym->name); @@ -448,8 +458,13 @@ int conf_write(const char *name) break; case yes: fprintf(out, "CONFIG_%s=y\n", sym->name); - if (out_h) + if (out_h) { fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); + /* bbox */ + fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); + fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); + fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); + } break; } break; @@ -475,22 +490,37 @@ int conf_write(const char *name) } } while (*str); fputs("\"\n", out); - if (out_h) + if (out_h) { fputs("\"\n", out_h); + /* bbox */ + fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); + fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); + fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); + } break; case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - if (out_h) + if (out_h) { fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); + /* bbox */ + fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); + fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); + fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); + } break; } case S_INT: str = sym_get_string_value(sym); fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - if (out_h) + if (out_h) { fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); + /* bbox */ + fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); + fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); + fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); + } break; } } @@ -512,7 +542,7 @@ int conf_write(const char *name) fclose(out); if (out_h) { fclose(out_h); - rename(".tmpconfig.h", "include/linux/autoconf.h"); + rename(".tmpconfig.h", "include/autoconf.h"); } if (!name || basename != conf_def_filename) { if (!name) diff -urp kernel.0/scripts/kconfig/util.c busybox.1/scripts/kconfig/util.c --- kernel.0/scripts/kconfig/util.c 2006-08-07 06:18:54.000000000 +0200 +++ busybox.1/scripts/kconfig/util.c 2006-10-05 12:10:57.000000000 +0200 @@ -44,7 +44,7 @@ int file_write_dep(const char *name) else fprintf(out, "\t%s\n", file->name); } - fprintf(out, "\n.config include/linux/autoconf.h: $(deps_config)\n\n$(deps_config):\n"); + fprintf(out, "\n.config include/autoconf.h: $(deps_config)\n\n$(deps_config):\n"); fclose(out); rename("..config.tmp", name); return 0; diff -urp kernel.0/scripts/Makefile busybox.1/scripts/Makefile --- kernel.0/scripts/Makefile 2006-08-18 18:26:24.000000000 +0200 +++ busybox.1/scripts/Makefile 2006-10-05 12:10:57.000000000 +0200 @@ -2,21 +2,10 @@ # scripts contains sources for various helper programs used throughout # the kernel for the build process. # --------------------------------------------------------------------------- -# kallsyms: Find all symbols in vmlinux -# pnmttologo: Convert pnm files to logo files -# conmakehash: Create chartable -# conmakehash: Create arrays for initializing the kernel console tables -hostprogs-$(CONFIG_KALLSYMS) += kallsyms -hostprogs-$(CONFIG_LOGO) += pnmtologo -hostprogs-$(CONFIG_VT) += conmakehash -hostprogs-$(CONFIG_PROM_CONSOLE) += conmakehash -hostprogs-$(CONFIG_IKCONFIG) += bin2c +hostprogs-y += usage -always := $(hostprogs-y) - -subdir-$(CONFIG_MODVERSIONS) += genksyms -subdir-$(CONFIG_MODULES) += mod +always := $(hostprogs-y) # Let clean descend into subdirs -subdir- += basic kconfig package +subdir- += basic kconfig