2.5.42: UML build error
PATCH 1/1 2.5.42: UML build error
When building 2.5.42 UML it fails with:
make -C arch/um/sys-i386/util mk_sc
gcc -Wp,-MD,./.mk_sc.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o mk_sc
.o mk_sc.c/bin/sh: scripts/fixdep: No such file or directory
make[1]: *** [mk_sc.o] Error 1
make[1]: Target `mk_sc' not remade because of errors.
make: *** [arch/um/sys-i386/util/mk_sc] Error 2
This patch readds the path to scripts/fixdep in Rules.make. It doesn't break _my_ regular build, but I can't tell for others.
Rules.make +1 -1
@@ -561,7 +561,7 @@ @set -e; \ $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(cmd_$(1)); \ - scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ + $(TOPDIR)/scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
Quoted 17 lines · Olaf Dietsche
When building 2.5.42 UML it fails with:
make -C
arch/um/sys-i386/utilmk_sc
gcc -Wp,-MD,./.mk_sc.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -omk_sc
.omk_sc.c/bin/sh:scripts/fixdep: No such file or directory
make[1]: *** [mk_sc.o] Error 1
make[1]: Target `mk_sc' not remade because of errors.
make: *** [arch/um/sys-i386/util/mk_sc] Error 2This patch readds the path to
scripts/fixdepin Rules.make. It doesn't break _my_ regular build, but I can't tell for others.diff -urN a/Rules.make b/Rules.make
Rules.make line 566
Quoted 7 lines
Rules.make +1
-1@@ -561,7 +561,7 @@ @set -e; \ $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(cmd_$(1)); \ - scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ + $(TOPDIR)/scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
This is actually intentionally broken, since fixdep expects to be called from the top-level dir only now - it doesn't take the previous "$(TOPDIR)" argument anymore which allowed for $(PWD) != $(TOPDIR) before 2.5.41.
Descending into directories needs to be adjusted to use
$(call descend,<dir>,<target>)
now, and the Makefile in <dir> possibly needs adjusting to take into account that $(PWD) == $(TOPDIR).
--Kai
Quoted 3 lines · Olaf Dietsche
This patch readds the path to
scripts/fixdepin Rules.make. It doesn't break _my_ regular build, but I can't tell for others.
The thing is, the correct fix is to make uml (and other architectures) use the direct makefile approach (ie "make -f xxxxx/Makefile" instead of "make -C xxxxx").
All the dependencies are generated with relative paths anyway, so this one-liner makes the tree build, but it means that the dependencies are broken for uml-specific subdirectories anyway.
Linus
Quoted 2 lines · Olaf Dietsche
When building 2.5.42 UML it fails with:
[...]
Okay, so here's a patch which fixes the UML build for me (i386) - generally, UML could use some more kbuild work, but I'll leave that for post-freeze ;)
--Kai
Pull from http://linux-isdn.bkbits.net/linux-2.5.make
(Merging changesets omitted for clarity)
-----------------------------------------------------------------------------
[email protected], 2002-10-12 11:47:37-05:00, [email protected]
kbuild: Fix UML build
Not perfectly clean yet, but uses the standard way to descend into subdirs and gives me working vmlinux and linux targets without spurious rebuilds.
----------------------------------------------------------------------------
Makefile | 33 ++++++++++++++++++++------------- Makefile-i386 | 35 ++++++++++++++++------------------- sys-i386/util/Makefile | 14 ++++++++------ util/Makefile | 18 +++++++++--------- 4 files changed, 53 insertions(+), 47 deletions(-)
=============================================================================
unified diffs follow for reference
=============================================================================
-----------------------------------------------------------------------------
[email protected], 2002-10-12 11:47:37-05:00, [email protected]
kbuild: Fix UML build
Not perfectly clean yet, but uses the standard way to descend into subdirs and gives me working vmlinux and linux targets without spurious rebuilds.
---------------------------------------------------------------------------
arch/um/Makefile +20 -13
@@ -51,14 +51,6 @@ SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) -$(ARCH_DIR)/uml.lds.s : $(ARCH_DIR)/uml.lds.S - $(call if_changed_dep,as_s_S) - -AFLAGS_uml.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \ - -DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\" -P -C -Uum - -LDFLAGS_vmlinux = -r $(ARCH_DIR)/main.o - SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \ include/asm-um/sigcontext.h include/asm-um/processor.h \ include/asm-um/ptrace.h include/asm-um/arch-signal.h
@@ -71,11 +63,25 @@ $(ARCH_DIR)/vmlinux.lds.S : touch $@ -linux: scripts $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \ - arch/um/uml.lds.s $(ARCH_DIR)/main.o vmlinux +prepare: $(ARCH_SYMLINKS) $(GEN_HEADERS) + + +LDFLAGS_vmlinux = -r $(ARCH_DIR)/main.o + +vmlinux: $(ARCH_DIR)/main.o + + +$(ARCH_DIR)/uml.lds.s : $(ARCH_DIR)/uml.lds.S + $(call if_changed_dep,as_s_S) + +AFLAGS_uml.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \ + -DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\" -P -C -Uum + +linux: arch/um/uml.lds.s vmlinux $(CC) -Wl,-T,arch/um/uml.lds.s -o $@ $(LINK_PROFILE) \ $(LINK_WRAPS) -static vmlinux -L/usr/lib -lutil + USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) -I$(ARCH_INCLUDE)
@@ -125,8 +131,9 @@ $(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task $< > $@ -$(ARCH_DIR)/util/mk_task : $(ARCH_DIR)/util/mk_task_user.c \ - $(ARCH_DIR)/util/mk_task_kern.c - $(MAKE) $(MFLAGS) -C $(ARCH_DIR)/util all +$(ARCH_DIR)/util/mk_task : $(ARCH_DIR)/util FORCE ; + +$(ARCH_DIR)/util: FORCE + @$(call descend,$@,) export SUBARCH USER_CFLAGS OS
arch/um/Makefile-i386 +16 -19
@@ -8,27 +8,24 @@ ELF_ARCH = $(SUBARCH) ELF_FORMAT = elf32-$(SUBARCH) +SYS_DIR := $(ARCH_DIR)/include/sysdep-i386 +SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util -SYS_HEADERS = $(ARCH_DIR)/include/sysdep-i386/sc.h \ - $(ARCH_DIR)/include/sysdep-i386/thread.h +SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h -$(ARCH_DIR)/include/sysdep-i386/sc.h : $(ARCH_DIR)/sys-i386/util/mk_sc \ - include/asm - $(ARCH_DIR)/sys-i386/util/mk_sc > $@ - -$(ARCH_DIR)/include/sysdep-i386/thread.h : $(ARCH_DIR)/sys-i386/util/mk_thread\ - include/asm - $(ARCH_DIR)/sys-i386/util/mk_thread > $@ - -$(ARCH_DIR)/sys-i386/util/mk_sc : $(ARCH_DIR)/sys-i386/util/mk_sc.c \ - include/asm - $(MAKE) -C $(ARCH_DIR)/sys-i386/util mk_sc - -$(ARCH_DIR)/sys-i386/util/mk_thread : \ - $(ARCH_DIR)/sys-i386/util/mk_thread_user.c \ - $(ARCH_DIR)/sys-i386/util/mk_thread_kern.c - $(MAKE) -C $(ARCH_DIR)/sys-i386/util mk_thread +prepare: $(SYS_HEADERS) + +$(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc + $< > $@ + +$(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread + $< > $@ + +$(SYS_UTIL_DIR)/mk_sc $(SYS_UTIL_DIR)/mk_thread: $(SYS_UTIL_DIR) FORCE ; + +$(SYS_UTIL_DIR): include/asm FORCE + @$(call descend,$@,) sysclean : rm -f $(SYS_HEADERS) - make -C $(ARCH_DIR)/sys-i386/util clean + @$(call descend,$(SYS_DIR),clean)
arch/um/sys-i386/util/Makefile +8 -6
@@ -1,16 +1,18 @@ -host-progs = mk_sc +EXTRA_TARGETS := mk_sc mk_thread mk_thread_kern.o -mk_sc-objs = mk_sc.o +host-progs := mk_sc + +mk_sc-objs := mk_sc.o include $(TOPDIR)/Rules.make -mk_thread : mk_thread_kern.o mk_thread_user.o - $(CC) $(CFLAGS) -o $@ mk_thread_user.o mk_thread_kern.o +$(obj)/mk_thread : $(obj)/mk_thread_kern.o $(obj)/mk_thread_user.o + $(CC) $(CFLAGS) -o $@ $^ -mk_thread_user.o : mk_thread_user.c +$(obj)/mk_thread_user.o : $(src)/mk_thread_user.c $(CC) $(USER_CFLAGS) -c -o $@ $< clean : - $(RM) $(host-progs) mk_thread + $(RM) -f $(EXTRA_TARGETS) archmrproper : clean
arch/um/util/Makefile +9 -9
@@ -1,14 +1,14 @@ -include $(TOPDIR)/Rules.make +EXTRA_TARGETS := mk_task mk_task_kern.o -all : mk_task +include $(TOPDIR)/Rules.make -mk_task : mk_task_user.o mk_task_kern.o - $(CC) -o mk_task mk_task_user.o mk_task_kern.o +$(obj)/mk_task: $(obj)/mk_task_user.o $(obj)/mk_task_kern.o + $(CC) -o $@ $^ -mk_task_user.o : mk_task_user.c - $(CC) -c $< +$(obj)/mk_task_user.o: $(src)/mk_task_user.c + $(CC) -o $@ -c $< -clean : - $(RM) mk_task *.o *~ +clean: + $(RM) $(EXTRA_TARGETS) -archmrproper : clean +archmrproper:
Quoted 30 lines · Kai Germaschewski
Quoted 2 lines · Olaf Dietsche
When building 2.5.42 UML it fails with:
[...]Okay, so here's a patch which fixes the UML build for me (i386) - generally, UML could use some more kbuild work, but I'll leave that for post-freeze ;)
--Kai
Pull from http://linux-isdn.bkbits.net/linux-2.5.make
(Merging changesets omitted for clarity)
-----------------------------------------------------------------------------
[email protected], 2002-10-12 11:47:37-05:00, [email protected]
kbuild: Fix UML buildNot perfectly clean yet, but uses the standard way to descend into subdirs and gives me working vmlinux and linux targets without spurious rebuilds.
----------------------------------------------------------------------------
Makefile | 33 ++++++++++++++++++++------------- Makefile-i386 | 35 ++++++++++++++++------------------- sys-i386/util/Makefile | 14 ++++++++------ util/Makefile | 18 +++++++++--------- 4 files changed, 53 insertions(+), 47 deletions(-)
Quoted 3 lines
=============================================================================
unified diffs follow for reference
=============================================================================
[...]
Thanks! I was still trying to figure out, how all this is supposed to work :-).
Though, it still gives one error right at the beginning:
gcc -E -Wp,-MD,arch/um/.uml.lds.s.d_ -D__ASSEMBLY__ -D__KERNEL__ -Iinclude -nostdinc -iwithprefix include -Ui386 -DSTART=$((0xc0000000 - ((0 + 1) * 0x20000000))) -DELF_ARCH=i386 -DELF_FORMAT=\"elf32-i386\" -P -C -Uum -o arch/um/uml.lds.s arch/um/uml.lds.S/bin/sh: scripts/fixdep: No such file or directory
make: *** [arch/um/uml.lds.s] Error 1
Regards, Olaf.
Quoted 5 lines · Olaf Dietsche
Though, it still gives one error right at the beginning:
gcc -E -Wp,-MD,arch/um/.uml.lds.s.d_ -D__ASSEMBLY__ -D__KERNEL__ -Iinclude -nostdinc -iwithprefix include -Ui386 -DSTART=$((0xc0000000 - ((0 + 1) *
0x20000000))) -DELF_ARCH=i386 -DELF_FORMAT=\"elf32-i386\" -P -C -Uum -oarch/um/uml.lds.sarch/um/uml.lds.S/bin/sh:scripts/fixdep: No such file or directory
make: *** [arch/um/uml.lds.s] Error 1
Try a "make scripts" first, that should work around it. I'll fix it properly.
--Kai
Quoted 10 lines · Kai Germaschewski
Quoted 5 lines · Olaf Dietsche
Though, it still gives one error right at the beginning:
gcc -E -Wp,-MD,arch/um/.uml.lds.s.d_ -D__ASSEMBLY__ -D__KERNEL__ -Iinclude -nostdinc -iwithprefix include -Ui386 -DSTART=$((0xc0000000 - ((0 + 1) *
0x20000000))) -DELF_ARCH=i386 -DELF_FORMAT=\"elf32-i386\" -P -C -Uum -oarch/um/uml.lds.sarch/um/uml.lds.S/bin/sh:scripts/fixdep: No such file or directory
make: *** [arch/um/uml.lds.s] Error 1Try a "make scripts" first, that should work around it. I'll fix it properly.
Works now, thanks.
Regards, Olaf.
Hello!
Quoted 5 lines · Kai Germaschewski
Quoted 2 lines
When building 2.5.42 UML it fails with:
[...]Okay, so here's a patch which fixes the UML build for me (i386) - generally, UML could use some more kbuild work, but I'll leave that for post-freeze ;)
Actually this patch does not work for make ARCH=um distclean (at least it does not work for me) because there is no Makefile in arch/um/include/sysdep/ (something like a fix attached).
Also after "distclean", you cannot build UML anymore.
It fails to execute "prepare" target and therefore include/asm/arch symlink (and others ) is not made and build fails.
gcc -Wp,-MD,arch/um/sys-i386/util/.mk_thread_kern.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -g -U__i386__ -Ui386 -D__arch_um__ -DSUBARCH=\"i386\" -D_LARGEFILE64_SOURCE -I/home/green/bk/linux-2.5/arch/um/include -Derrno=kernel_errno -nostdinc -iwithprefix include -DKBUILD_BASENAME=mk_thread_kern -c -o arch/um/sys-i386/util/mk_thread_kern.o arch/um/sys-i386/util/mk_thread_kern.c
In file included from include/linux/posix_types.h:46,
from include/linux/types.h:11,
from include/linux/capability.h:16,
from include/linux/sched.h:9,
from arch/um/sys-i386/util/mk_thread_kern.c:2:include/asm/posix_types.h:4: asm/arch/posix_types.h: No such file or directory
===== arch/um/Makefile-i386 1.2 vs edited =====
arch/um/Makefile-i386 +1 -1
@@ -28,4 +28,4 @@ sysclean : rm -f $(SYS_HEADERS) - @$(call descend,$(SYS_DIR),clean) + @$(call descend,$(SYS_UTIL_DIR),clean)
Bye,
Oleg