Hi hpa & others. Following is a list of issues that I hope to be addressed soon so we are in even better shape for -mm inclusion. 1) rebuild initramfs when content changes. > It is a simple matter of copying in usr/Makefile from the latest > -linus kernel and replace the 10 first lines with the content from > klibc Kbuild file. 2) havesyscalls.h is not deleted after make clean 3) dash, utils and friends are not rebuild when klibc library changes 4) dash builtins.o is rebuild at second make of klibc I expect hpa to deal with 1). And with some luck I have fixed 2), 3) and 4) tonight. The good thing is that they all show up with vanilla klibc so I have something stable to patch against. Sam
Sam Ravnborg <sam@ravnborg.org> wrote:> > Hi hpa & others. > > Following is a list of issues that I hope to be addressed soon so > we are in even better shape for -mm inclusion. > > 1) rebuild initramfs when content changes. > > It is a simple matter of copying in usr/Makefile from the latest > > -linus kernel and replace the 10 first lines with the content from > > klibc Kbuild file. > > 2) havesyscalls.h is not deleted after make clean > > 3) dash, utils and friends are not rebuild when klibc library changes > > 4) dash builtins.o is rebuild at second make of klibc > > I expect hpa to deal with 1). > And with some luck I have fixed 2), 3) and 4) tonight. > The good thing is that they all show up with vanilla klibc so I have > something stable to patch against. >5) `make usr/random-thing.i' tends to fail. Example: linux-tiger:/usr/src/25> mk usr/dash/arith_yylex.i CHK include/linux/version.h scripts/kconfig/conf -s arch/ia64/Kconfig # # using defaults found in .config # SPLIT include/linux/autoconf.h -> include/config/* CPP usr/dash/arith_yylex.i real 0m1.124s user 0m0.916s sys 0m0.256s usr/dash/arith_yylex.c:35:20: stdlib.h: No such file or directory In file included from usr/dash/arith_yylex.c:36: usr/dash/arith.y:36:20: stdlib.h: No such file or directory In file included from usr/dash/arith.y:38, from usr/dash/arith_yylex.c:36: usr/dash/shell.h:52:23: sys/param.h: No such file or directory In file included from usr/dash/arith.y:39, from usr/dash/arith_yylex.c:36: usr/dash/error.h:37:20: setjmp.h: No such file or directory usr/dash/error.h:38:20: signal.h: No such file or directory In file included from usr/dash/arith.y:40, from usr/dash/arith_yylex.c:36: usr/dash/output.h:43:23: sys/types.h: No such file or directory In file included from usr/dash/arith_yylex.c:36: usr/dash/arith.y:57:19: stdio.h: No such file or directory In file included from usr/dash/arith_yylex.c:38: usr/dash/error.h:37:20: setjmp.h: No such file or directory usr/dash/error.h:38:20: signal.h: No such file or directory make[1]: *** [usr/dash/arith_yylex.i] Error 1 make: *** [usr/dash/arith_yylex.i] Error 2
Sam Ravnborg
2006-Apr-11 13:15 UTC
[klibc] [PATCH] klibc: delete havesyscall.h during make clean
In the kernel KLIBCINC expands to a full path, whereas in klibc it expands to a relative path. So specify havesyscalls.h twice to cover both situations. Note: kbuild will prefix relative paths with $(obj) when deleting. Later we may use same type of definition for KLIBCINC but until then we keep this workaround. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- diff --git a/klibc/syscalls/Kbuild b/klibc/syscalls/Kbuild index c13555d..5554f7e 100644 --- a/klibc/syscalls/Kbuild +++ b/klibc/syscalls/Kbuild @@ -23,6 +23,7 @@ targets += $(syscall-objs) # Side effect of running syscalls.pl clean-files += $(objtree)/$(KLIBCINC)/klibc/havesyscall.h +clean-files += $(KLIBCINC)/klibc/havesyscall.h # All the syscall stubs clean-files += *.o *.S *.c
Sam Ravnborg
2006-Apr-11 13:17 UTC
[klibc] [PATCH] klibc: fix build breakage with make O=..
The *.c files in socketcalls/ are generated. For klibc kbuild does on purpose not add this include automagically so do it explicit here. This allows klibc to be build using make O=.. in the kernel. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- diff --git a/klibc/socketcalls/Kbuild b/klibc/socketcalls/Kbuild index c3f1526..7c7190f 100644 --- a/klibc/socketcalls/Kbuild +++ b/klibc/socketcalls/Kbuild @@ -19,6 +19,8 @@ targets += socketcalls.mk targets += $(socketcall-objs) clean-files += *.S *.c *.o +EXTRA_KLIBCCFLAGS := -I$(srctree)/$(src) + # Create reloctable composite object file $(obj)/socketcalls.o: $(call objectify,$(socketcall-objs)) FORCE $(call if_changed,klibcld)
Sam Ravnborg
2006-Apr-11 13:18 UTC
[klibc] [PATCH] klibc: avoid using check helper in dash/Kbuild
The check target seems to be introduced only to create the bltin/ directory needed by mkbuiltins. Do it explicit and drop the check target. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- diff --git a/dash/Kbuild b/dash/Kbuild index 30d7823..0ae06ca 100644 --- a/dash/Kbuild +++ b/dash/Kbuild @@ -57,13 +57,8 @@ hostprogs-y := $(HELPERS) # For cleaning targets := sh sh.g sh.shared sh.shared.g $(CLEANFILES) -$(addprefix $(obj)/, $(OBJS)): $(addprefix $(obj)/, $(BUILT_SOURCES) check) +$(addprefix $(obj)/, $(OBJS)): $(addprefix $(obj)/, $(BUILT_SOURCES)) -quiet_cmd_check = CHECK $(obj) - cmd_check = mkdir -p $(obj)/bltin; touch $(obj)/check -$(obj)/check: - $(call cmd,check) - # Generate token.h quiet_cmd_mktokens = GEN $@ cmd_mktokens = sh $< > $@ @@ -79,7 +74,8 @@ quiet_cmd_mkbuiltins_def = GEN $@ # Generate builtins{.c + .h} quiet_cmd_mkbuiltins = GEN $@ - cmd_mkbuiltins = cd $(obj) && sh $(srctree)/$(src)/mkbuiltins builtins.def + cmd_mkbuiltins = mkdir -p $(obj)/bltin && cd $(obj) && \ + sh $(srctree)/$(src)/mkbuiltins builtins.def $(obj)/builtins.h $(obj)/builtins.c: $(src)/mkbuiltins $(obj)/builtins.def $(call cmd,mkbuiltins)
Sam Ravnborg
2006-Apr-11 13:21 UTC
[klibc] [PATCH] klibc: relink klibc programs when klibc library is changed
Add klibc libraries as prerequisites so we relink klibc programs when klibc changes. We need to avoid rebuilding the libraries when we do not build klibc so added a special rule that are only active when we do not build klibc to avoid klibc libraries to be updated. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- diff --git a/klibc/Kbuild b/klibc/Kbuild index 03e7102..f422d9d 100644 --- a/klibc/Kbuild +++ b/klibc/Kbuild @@ -2,6 +2,9 @@ # # Kbuild file for klibc # +# Tell that we are building klibc +klibc-build := y + libc-y := vsnprintf.o snprintf.o vsprintf.o sprintf.o \ asprintf.o vasprintf.o \ vsscanf.o sscanf.o ctypes.o \ diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index 7ee7324..14aeccc 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -257,7 +257,7 @@ quiet_cmd_ld-static = KLIBCLD $@ $(KLIBCSTRIP) $(KLIBCSTRIPFLAGS) $@ -$(static-y): $(klibc-objs) $(lib-target) FORCE +$(static-y): $(klibc-objs) $(lib-target) $(KLIBCCRT0) $(KLIBCLIBC) FORCE $(call if_changed,ld-static) quiet_cmd_ld-shared = KLIBCLD $@ @@ -270,8 +270,17 @@ quiet_cmd_ld-shared = KLIBCLD $@ $(KLIBCSTRIP) $(KLIBCSTRIPFLAGS) $@ -$(shared-y): $(klibc-objs) $(lib-target) FORCE +$(shared-y): $(klibc-objs) $(lib-target) $(KLIBCCRTSHARED) \ + $(KLIBCLIBCSHARED) FORCE $(call if_changed,ld-shared) + +# Do not try to build KLIBC libaries if we are building klibc +ifeq ($(klibc-build),) +$(KLIBCCRT0) $(KLIBCLIBC): + echo fisk +$(KLIBCCRTSHARED) $(KLIBCLIBCSHARED): + echo fisk +endif targets += $(klibc-real-objs) endif
Sam Ravnborg wrote:> Hi hpa & others. > > Following is a list of issues that I hope to be addressed soon so > we are in even better shape for -mm inclusion. > > 1) rebuild initramfs when content changes. > > It is a simple matter of copying in usr/Makefile from the latest > > -linus kernel and replace the 10 first lines with the content from > > klibc Kbuild file. >Is this in Linus' git tree yet? If so, I'll probably update to top of Linus' tree and merge, probably Thursday (I'm at a conference today and tomorrow.) -hpa
Reasonably Related Threads
- [PATCH 00/16] External building, update for 2.6.33 and multiple root devices.
- kbuild updates to klibc
- [PATCH] use "--just-symbols" for compatibility with LLD
- [patch] Kbuild.klibc don't hardcode gcc version
- [PATCH/RFC] klibc/kbuild: use separate kbuild files for each klibc subdirectory