All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
@ 2005-02-13 14:19 Vadim Abrossimov
  2005-02-13 18:12 ` Jeff Dike
  0 siblings, 1 reply; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-13 14:19 UTC (permalink / raw)
  To: linux-kernel

1. To support a separate build tree for the um/i386 architecture
the following changes have been done:
- fix makefiles to generate new files and to create symlinks in the  
'<objtree>' only
- in particular, to solve the issue of 'arch/um/include/sysdep-<subarch>',
the same technique as for 'include/asm' has been used: create a symlink  
from
'<objtree>/arch/um/include2/sysdep' to  
'<srctree>/arch/um/include/sysdep-<subarch>'
- fix '#include's in the header files that the assumption of included  
files located in
the same directory has been broken.

The patch applies (and has been tested) on the i386 sub-architecture only.
Other supported sub-architectures should still work as previously building  
in
the source tree only.

2. In order to support dependencies for 'USER_OBJS' object files use the  
generic Kbuild
infrastructure overwriting 'c_flags' as needed.

These two changes have been combined in one patch because some makefiles  
are impacted by both.

Signed-off-by: <Vadim_Abrossimov@yahoo.com>
---

  arch/um/Makefile                         |   37  
+++++++++++++++++++++++--------
  arch/um/drivers/Makefile                 |    4 +--
  arch/um/include/sysdep-i386/sigcontext.h |    2 -
  arch/um/kernel/Makefile                  |    7 ++---
  arch/um/kernel/skas/Makefile             |    3 --
  arch/um/kernel/tt/Makefile               |    6 +----
  arch/um/kernel/tt/ptproxy/Makefile       |    3 --
  arch/um/os-Linux/Makefile                |    3 --
  arch/um/os-Linux/drivers/Makefile        |    3 --
  arch/um/os-Linux/sys-i386/Makefile       |    4 +--
  arch/um/sys-i386/Makefile                |    5 +---
  include/asm-um/archparam-i386.h          |    2 -
  12 files changed, 45 insertions(+), 34 deletions(-)

===== arch/um/Makefile 1.54 vs edited =====
--- 1.54/arch/um/Makefile	2005-02-11 07:57:42 +01:00
+++ edited/arch/um/Makefile	2005-02-13 11:57:01 +01:00
@@ -43,7 +43,9 @@ ifneq ($(MAKEFILES-INCL),)
    include $(MAKEFILES-INCL)
  endif

-ARCH_INCLUDE	:= -I$(ARCH_DIR)/include
+ARCH_INCLUDE	:= -I$(ARCH_DIR)/include \
+                   $(if $(KBUILD_SRC), -I$(objtree)/$(ARCH_DIR)/include2)
+
  SYS_DIR		:= $(ARCH_DIR)/include/sysdep-$(SUBARCH)

  include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
@@ -60,8 +62,12 @@ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSU
  	$(ARCH_INCLUDE) $(MODE_INCLUDE)

  USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
-USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
-	$(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
+USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS))
+# If building the kernel in a separate tree we need to add this path  
manually.
+# Note, that for CFLAGS it's done in the generic 'scripts/Makefile.lib'
+USER_CFLAGS += $(if $(KBUILD_SRC), -I$(srctree)/$(ARCH_DIR)/include)
+USER_CFLAGS += $(ARCH_INCLUDE) $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
+
  CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
  CFLAGS += $(call cc-option,-fno-unit-at-a-time,)

@@ -94,7 +100,7 @@ define archhelp
    echo '		   find in the kernel root.'
  endef

-$(shell cd $(ARCH_DIR) && ln -sf Kconfig_$(SUBARCH) Kconfig_arch)
+$(shell cd $(ARCH_DIR) && ln -sf $(if $(KBUILD_SRC),  
$(srctree)/$(ARCH_DIR)/)Kconfig_$(SUBARCH) Kconfig_arch)

  prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \
  	$(ARCH_DIR)/kernel/vmlinux.lds.S
@@ -138,6 +144,7 @@ CLEAN_FILES += linux x.i gmon.out $(ARCH

  MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \
  	$(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os \
+	$(ARCH_DIR)/include2/sysdep \
  	$(ARCH_DIR)/Kconfig_arch

  archclean:
@@ -150,26 +157,38 @@ archclean:
  $(ARCH_DIR)/kernel/vmlinux.lds.S: FORCE
  	$(Q)if [ "$(shell readlink $@)" != "$(LD_SCRIPT-y)" ]; then \
  		echo '  SYMLINK $@'; \
-		ln -sf $(LD_SCRIPT-y) $@; \
+		ln -sf $(if $(KBUILD_SRC),  
$(srctree)/$(ARCH_DIR)/kernel/)$(LD_SCRIPT-y) $@; \
  		touch $@; \
  	fi;

  $(SYMLINK_HEADERS):
  	@echo '  SYMLINK $@'
-	$(Q)cd $(TOPDIR)/$(dir $@) ; \
+ifneq ($(KBUILD_SRC),)
+	$(Q)mkdir -p $(dir $@)
+	$(Q)cd $(dir $@) ; \
+	ln -sf $(srctree)/$(basename $@)-$(SUBARCH)$(suffix $@) $(notdir $@)
+else
+	$(Q)cd $(srctree)/$(dir $@) ; \
  	ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
+endif

  include/asm-um/arch:
  	@echo '  SYMLINK $@'
-	$(Q)cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch
+	$(if $(KBUILD_SRC), $(Q)mkdir -p include/asm-um)
+	$(Q)cd include/asm-um && ln -fsn $(if $(KBUILD_SRC), $(srctree)/include,  
..)/asm-$(SUBARCH) arch

  $(ARCH_DIR)/include/sysdep:
  	@echo '  SYMLINK $@'
-	$(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep
+ifneq ($(KBUILD_SRC),)
+	$(Q)mkdir -p $(ARCH_DIR)/include2
+	$(Q)cd $(ARCH_DIR)/include2 && ln -fsn  
$(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) sysdep
+endif
+	$(Q)cd $(ARCH_DIR)/include && ln -fsn sysdep-$(SUBARCH) sysdep

  $(ARCH_DIR)/os:
  	@echo '  SYMLINK $@'
-	$(Q)cd $(ARCH_DIR) && ln -sf os-$(OS) os
+	$(if $(KBUILD_SRC), $(Q)mkdir -p $(ARCH_DIR))
+	$(Q)cd $(ARCH_DIR) && ln -fsn $(if $(KBUILD_SRC),  
$(srctree)/$(ARCH_DIR)/)os-$(OS) os

  # Generated files
  define filechk_umlconfig
===== arch/um/drivers/Makefile 1.15 vs edited =====
--- 1.15/arch/um/drivers/Makefile	2005-01-12 01:42:51 +01:00
+++ edited/arch/um/drivers/Makefile	2005-02-13 11:57:01 +01:00
@@ -49,5 +49,5 @@ USER_OBJS := $(filter %_user.o,$(obj-y)
  	null.o pty.o tty.o xterm.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
+
===== arch/um/include/sysdep-i386/sigcontext.h 1.4 vs edited =====
--- 1.4/arch/um/include/sysdep-i386/sigcontext.h	2004-08-24 11:08:18 +02:00
+++ edited/arch/um/include/sysdep-i386/sigcontext.h	2005-02-13 11:57:01  
+01:00
@@ -6,7 +6,7 @@
  #ifndef __SYS_SIGCONTEXT_I386_H
  #define __SYS_SIGCONTEXT_I386_H

-#include "sc.h"
+#include <sysdep/sc.h>

  #define IP_RESTART_SYSCALL(ip) ((ip) -= 2)

===== arch/um/kernel/Makefile 1.29 vs edited =====
--- 1.29/arch/um/kernel/Makefile	2005-01-04 00:49:33 +01:00
+++ edited/arch/um/kernel/Makefile	2005-02-13 11:57:01 +01:00
@@ -30,14 +30,13 @@ USER_OBJS := $(foreach file,$(USER_OBJS)

  CFLAGS_frame.o := -fno-omit-frame-pointer

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS)  
$(CFLAGS_$(notdir $@))

-QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ;  
$$config =~ s/\n/\\n"\n"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/;  
print $$_ }'
+QUOTE = 'my $$config=`cat $(objtree)/.config`; $$config =~ s/"/\\"/g ;  
$$config =~ s/\n/\\n"\n"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/;  
print $$_ }'

  quiet_cmd_quote = QUOTE   $@
  cmd_quote = $(PERL) -e $(QUOTE) < $< > $@

  targets += config.c
-$(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config FORCE
+$(obj)/config.c : $(src)/config.c.in $(objtree)/.config FORCE
  	$(call if_changed,quote)
===== arch/um/kernel/skas/Makefile 1.14 vs edited =====
--- 1.14/arch/um/kernel/skas/Makefile	2005-02-08 03:25:10 +01:00
+++ edited/arch/um/kernel/skas/Makefile	2005-02-13 11:57:01 +01:00
@@ -9,7 +9,6 @@ obj-y := exec_kern.o mem.o mem_user.o mm
  USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  subdir- := util
===== arch/um/kernel/tt/Makefile 1.17 vs edited =====
--- 1.17/arch/um/kernel/tt/Makefile	2005-01-12 01:42:50 +01:00
+++ edited/arch/um/kernel/tt/Makefile	2005-02-13 11:57:01 +01:00
@@ -18,11 +18,9 @@ USER_OBJS := $(foreach file,$(USER_OBJS)
  UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
  UNMAP_CFLAGS := $(patsubst -fprofile-arcs  
-ftest-coverage,,$(UNMAP_CFLAGS))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

-$(obj)/unmap.o: $(src)/unmap.c
-	$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
+$(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)

  LIBC_DIR ?= /usr/lib

===== arch/um/kernel/tt/ptproxy/Makefile 1.9 vs edited =====
--- 1.9/arch/um/kernel/tt/ptproxy/Makefile	2004-08-24 11:08:18 +02:00
+++ edited/arch/um/kernel/tt/ptproxy/Makefile	2005-02-13 11:57:01 +01:00
@@ -7,5 +7,4 @@ obj-y = proxy.o ptrace.o sysdep.o wait.o

  USER_OBJS := $(foreach file,$(obj-y),$(src)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
===== arch/um/os-Linux/Makefile 1.12 vs edited =====
--- 1.12/arch/um/os-Linux/Makefile	2005-01-12 01:42:53 +01:00
+++ edited/arch/um/os-Linux/Makefile	2005-02-13 11:57:01 +01:00
@@ -9,7 +9,6 @@ obj-y = elf_aux.o file.o process.o signa
  USER_OBJS := elf_aux.o file.o process.o signal.o time.o tty.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
===== arch/um/os-Linux/drivers/Makefile 1.5 vs edited =====
--- 1.5/arch/um/os-Linux/drivers/Makefile	2002-12-17 08:54:52 +01:00
+++ edited/arch/um/os-Linux/drivers/Makefile	2005-02-13 11:57:01 +01:00
@@ -15,5 +15,4 @@ USER_SINGLE_OBJS = $(foreach f,$(patsubs
  USER_OBJS = $(filter %_user.o,$(obj-y) $(USER_SINGLE_OBJS))
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
===== arch/um/os-Linux/sys-i386/Makefile 1.1 vs edited =====
--- 1.1/arch/um/os-Linux/sys-i386/Makefile	2005-01-12 01:42:50 +01:00
+++ edited/arch/um/os-Linux/sys-i386/Makefile	2005-02-13 11:57:01 +01:00
@@ -7,5 +7,5 @@ obj-$(CONFIG_MODE_SKAS) = registers.o

  USER_OBJS := $(foreach file,$(obj-y),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
+
===== arch/um/sys-i386/Makefile 1.21 vs edited =====
--- 1.21/arch/um/sys-i386/Makefile	2005-01-12 01:42:52 +01:00
+++ edited/arch/um/sys-i386/Makefile	2005-02-13 11:57:01 +01:00
@@ -22,11 +22,10 @@ module.c-dir = kernel

  define make_link
  	-rm -f $1
-	ln -sf $(TOPDIR)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
+	ln -sf $(srctree)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
  endef

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  $(SYMLINKS):
  	$(call make_link,$@)
===== include/asm-um/archparam-i386.h 1.9 vs edited =====
--- 1.9/include/asm-um/archparam-i386.h	2005-01-12 01:42:52 +01:00
+++ edited/include/asm-um/archparam-i386.h	2005-02-13 11:57:01 +01:00
@@ -8,7 +8,7 @@

  /********* Bits for asm-um/elf.h ************/

-#include "user.h"
+#include <asm/user.h>

  extern char * elf_aux_platform;
  #define ELF_PLATFORM (elf_aux_platform)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 18:12 ` Jeff Dike
@ 2005-02-13 16:46   ` Al Viro
  2005-02-13 18:58     ` [uml-devel] " Vadim Abrossimov
  2005-02-13 19:35     ` Jeff Dike
  0 siblings, 2 replies; 14+ messages in thread
From: Al Viro @ 2005-02-13 16:46 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Vadim Abrossimov, linux-kernel

On Sun, Feb 13, 2005 at 01:12:54PM -0500, Jeff Dike wrote:
> vadim_abrossimov@yahoo.com said:
> > 1. To support a separate build tree for the um/i386 architecture the
> > following changes have been done: 
> 
> Have a look at 
> 	http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.11-rc3-mm2/patches/cross-build
> 
> That's Al Viro's take on the same problem, plus -j and some other things he
> noted in passing.
> 
> If you could remove the stuff that's common (and flag the overlapping, but 
> different things) from your patch, that would be helpful.

Err...  FWIW, aforementioned patch lacks e.g. vmlinux.lds.S.  The latest
I have on anonftp is ftp.linux.org.uk/pub/people/viro/UML-kbuild; there's
more in my local tree, but that's a separate story.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 14:19 [PATCH] uml: support a separate build tree; support USER_OBJS dependencies Vadim Abrossimov
@ 2005-02-13 18:12 ` Jeff Dike
  2005-02-13 16:46   ` Al Viro
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Dike @ 2005-02-13 18:12 UTC (permalink / raw)
  To: Vadim Abrossimov; +Cc: linux-kernel

vadim_abrossimov@yahoo.com said:
> 1. To support a separate build tree for the um/i386 architecture the
> following changes have been done: 

Have a look at 
	http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.11-rc3-mm2/patches/cross-build

That's Al Viro's take on the same problem, plus -j and some other things he
noted in passing.

If you could remove the stuff that's common (and flag the overlapping, but 
different things) from your patch, that would be helpful.

				Jeff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 16:46   ` Al Viro
@ 2005-02-13 18:58     ` Vadim Abrossimov
  2005-02-13 21:50       ` Jeff Dike
  2005-02-13 19:35     ` Jeff Dike
  1 sibling, 1 reply; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-13 18:58 UTC (permalink / raw)
  To: Al Viro, Jeff Dike; +Cc: User-mode-linux-devel

Following up the dicussion started on the linux-kernel list.

On Sun, 13 Feb 2005 16:46:52 +0000, Al Viro  
<viro@parcelfarce.linux.theplanet.co.uk> wrote:
> Err...  FWIW, aforementioned patch lacks e.g. vmlinux.lds.S.  The latest
> I have on anonftp is ftp.linux.org.uk/pub/people/viro/UML-kbuild; there's
> more in my local tree, but that's a separate story.

Apparently my changes to support 'O=' are quite obsolete: I was not aware  
about
the pending patches on http://user-mode-linux.sourceforge.net/patches.html  
and about
this mailing list dedicated to the uml development to which I have just  
subscribed.
Now I'm aware :->

The second change proposed in my patch concerned USER_OBJS dependences:
I removed specific rules using the generic Kbuild rule just overwriting  
'c_flags':

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
+

I agree that it's not very elegant and robust but it does the job and  
could be useful until
Kbuild will provide a clean way to do it.

If you think useful, I may create a patch with this change only.
Should I do it against 2.6.10 as an add-on to the  
http://user-mode-linux.sourceforge.net/patches.html
tarball?

That lead me to another question: why we don't use directly BitKeeper? We  
could have a repository for uml
development.

Dima




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 16:46   ` Al Viro
  2005-02-13 18:58     ` [uml-devel] " Vadim Abrossimov
@ 2005-02-13 19:35     ` Jeff Dike
  1 sibling, 0 replies; 14+ messages in thread
From: Jeff Dike @ 2005-02-13 19:35 UTC (permalink / raw)
  To: Al Viro; +Cc: Vadim Abrossimov, linux-kernel

viro@parcelfarce.linux.theplanet.co.uk said:
> Err...  FWIW, aforementioned patch lacks e.g. vmlinux.lds.S.

Yeah, I have that fixed locally.  I just haven't pushed out the new stuff yet.

				Jeff



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 18:58     ` [uml-devel] " Vadim Abrossimov
@ 2005-02-13 21:50       ` Jeff Dike
  2005-02-13 23:11         ` Vadim Abrossimov
  2005-02-14  1:13         ` Al Viro
  0 siblings, 2 replies; 14+ messages in thread
From: Jeff Dike @ 2005-02-13 21:50 UTC (permalink / raw)
  To: Vadim Abrossimov; +Cc: Al Viro, User-mode-linux-devel

vadim_abrossimov@yahoo.com said:
> Apparently my changes to support 'O=' are quite obsolete:

Not entirely - it's nice to see the same changes from two different sources,
although the first source was Al, which greatly reduces the chances that they
are wrong...

> The second change proposed in my patch concerned USER_OBJS
> dependences: I removed specific rules using the generic Kbuild rule
> just overwriting   'c_flags':

> I agree that it's not very elegant and robust but it does the job and
>  could be useful until Kbuild will provide a clean way to do it. 

It is still better than what I have now.

> If you think useful, I may create a patch with this change only.
> Should I do it against 2.6.10 as an add-on to the   http://
> user-mode-linux.sourceforge.net/patches.html tarball? 

Yup, that would be useful.

> That lead me to another question: why we don't use directly BitKeeper?
> We   could have a repository for uml development. 

I used BK for a while.  I just found that quilt fits my development style
better.

				Jeff



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 21:50       ` Jeff Dike
@ 2005-02-13 23:11         ` Vadim Abrossimov
  2005-02-16 18:30           ` Blaisorblade
  2005-02-14  1:13         ` Al Viro
  1 sibling, 1 reply; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-13 23:11 UTC (permalink / raw)
  To: Jeff Dike; +Cc: User-mode-linux-devel

On Sun, 13 Feb 2005 16:50:59 -0500, Jeff Dike <jdike@addtoit.com> wrote:

>
> Yup, that would be useful.
>

Quite simple.

BTW, after application of all patches from your tarboll I got an error  
compiling kernel-offsets.c.
I solve it adding the following dependency:

diff -rup 2.6.11-rc3.orig/arch/um/Makefile-i386  
2.6.11-rc3/arch/um/Makefile-i386
--- 2.6.11-rc3.orig/arch/um/Makefile-i386	2005-02-13 23:31:35.116344504  
+0100
+++ 2.6.11-rc3/arch/um/Makefile-i386	2005-02-13 23:11:31.344345664 +0100
@@ -36,6 +36,7 @@ CLEAN_FILES += $(ARCH_DIR)/user-offsets.

  $(ARCH_DIR)/kernel-offsets.s: $(SUBARCH_CORE)/kernel-offsets.c \
  				   $(ARCH_SYMLINKS) \
+				   $(ARCH_DIR)/include/user_constants.h \
  				   $(SYS_DIR)/sc.h \
  				   include/asm include/linux/version.h \
  				   include/config/MARKER

This is the patch for USER_OBJS:

---

diff -rup 2.6.11-rc3.orig/arch/um/drivers/Makefile  
2.6.11-rc3/arch/um/drivers/Makefile
--- 2.6.11-rc3.orig/arch/um/drivers/Makefile	2005-02-13 23:31:34.754399528  
+0100
+++ 2.6.11-rc3/arch/um/drivers/Makefile	2005-02-13 23:21:05.547053584 +0100
@@ -54,5 +54,4 @@ USER_OBJS := $(filter %_user.o,$(obj-y)
  	null.o pty.o tty.o xterm.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
diff -rup 2.6.11-rc3.orig/arch/um/kernel/Makefile  
2.6.11-rc3/arch/um/kernel/Makefile
--- 2.6.11-rc3.orig/arch/um/kernel/Makefile	2005-02-13 23:31:35.118344200  
+0100
+++ 2.6.11-rc3/arch/um/kernel/Makefile	2005-02-13 23:21:43.820235176 +0100
@@ -29,8 +29,7 @@ USER_OBJS := $(foreach file,$(USER_OBJS)

  CFLAGS_frame.o := -fno-omit-frame-pointer

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS)  
$(CFLAGS_$(notdir $@))

  targets += config.c
diff -rup 2.6.11-rc3.orig/arch/um/kernel/skas/Makefile  
2.6.11-rc3/arch/um/kernel/skas/Makefile
--- 2.6.11-rc3.orig/arch/um/kernel/skas/Makefile	2005-02-13  
23:30:36.017328920 +0100
+++ 2.6.11-rc3/arch/um/kernel/skas/Makefile	2005-02-13 23:22:10.380197448  
+0100
@@ -9,7 +9,6 @@ obj-y := exec_kern.o mem.o mem_user.o mm
  USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  subdir- := util
diff -rup 2.6.11-rc3.orig/arch/um/kernel/tt/Makefile  
2.6.11-rc3/arch/um/kernel/tt/Makefile
--- 2.6.11-rc3.orig/arch/um/kernel/tt/Makefile	2005-02-13  
23:31:35.120343896 +0100
+++ 2.6.11-rc3/arch/um/kernel/tt/Makefile	2005-02-13 23:23:21.856331424  
+0100
@@ -18,11 +18,9 @@ USER_OBJS := $(foreach file,$(USER_OBJS)
  UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
  UNMAP_CFLAGS := $(patsubst -fprofile-arcs  
-ftest-coverage,,$(UNMAP_CFLAGS))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

-$(obj)/unmap.o: $(src)/unmap.c
-	$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
+$(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)

  $(obj)/unmap_fin.o : $(obj)/unmap.o
  	$(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a)
diff -rup 2.6.11-rc3.orig/arch/um/kernel/tt/ptproxy/Makefile  
2.6.11-rc3/arch/um/kernel/tt/ptproxy/Makefile
--- 2.6.11-rc3.orig/arch/um/kernel/tt/ptproxy/Makefile	2005-02-03  
02:55:40.000000000 +0100
+++ 2.6.11-rc3/arch/um/kernel/tt/ptproxy/Makefile	2005-02-13  
23:24:03.203045768 +0100
@@ -7,5 +7,4 @@ obj-y = proxy.o ptrace.o sysdep.o wait.o

  USER_OBJS := $(foreach file,$(obj-y),$(src)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
diff -rup 2.6.11-rc3.orig/arch/um/os-Linux/drivers/Makefile  
2.6.11-rc3/arch/um/os-Linux/drivers/Makefile
--- 2.6.11-rc3.orig/arch/um/os-Linux/drivers/Makefile	2005-02-03  
02:55:50.000000000 +0100
+++ 2.6.11-rc3/arch/um/os-Linux/drivers/Makefile	2005-02-13  
23:24:56.239982928 +0100
@@ -15,5 +15,4 @@ USER_SINGLE_OBJS = $(foreach f,$(patsubs
  USER_OBJS = $(filter %_user.o,$(obj-y) $(USER_SINGLE_OBJS))
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)
diff -rup 2.6.11-rc3.orig/arch/um/os-Linux/Makefile  
2.6.11-rc3/arch/um/os-Linux/Makefile
--- 2.6.11-rc3.orig/arch/um/os-Linux/Makefile	2005-02-13  
23:31:33.859535568 +0100
+++ 2.6.11-rc3/arch/um/os-Linux/Makefile	2005-02-13 23:24:35.699105616  
+0100
@@ -10,7 +10,6 @@ USER_OBJS := aio.o elf_aux.o file.o mem.
  	time.o tt.o tty.o
  USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
diff -rup 2.6.11-rc3.orig/arch/um/sys-i386/Makefile  
2.6.11-rc3/arch/um/sys-i386/Makefile
--- 2.6.11-rc3.orig/arch/um/sys-i386/Makefile	2005-02-13  
23:31:35.120343896 +0100
+++ 2.6.11-rc3/arch/um/sys-i386/Makefile	2005-02-13 23:26:06.141356304  
+0100
@@ -26,8 +26,7 @@ define make_link
  	ln -sf $(srctree)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
  endef

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))  
$(USER_CFLAGS)

  $(SYMLINKS):
  	$(call make_link,$@)


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 21:50       ` Jeff Dike
  2005-02-13 23:11         ` Vadim Abrossimov
@ 2005-02-14  1:13         ` Al Viro
  2005-02-14  5:28           ` Vadim Abrossimov
  1 sibling, 1 reply; 14+ messages in thread
From: Al Viro @ 2005-02-14  1:13 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Vadim Abrossimov, User-mode-linux-devel

On Sun, Feb 13, 2005 at 04:50:59PM -0500, Jeff Dike wrote:
> vadim_abrossimov@yahoo.com said:
> > Apparently my changes to support 'O=' are quite obsolete:
> 
> Not entirely - it's nice to see the same changes from two different sources,
> although the first source was Al, which greatly reduces the chances that they
> are wrong...

Not particulary, seeing that I've done almost no work on kbuild-related
stuff...
 
> > The second change proposed in my patch concerned USER_OBJS
> > dependences: I removed specific rules using the generic Kbuild rule
> > just overwriting   'c_flags':
> 
> > I agree that it's not very elegant and robust but it does the job and
> >  could be useful until Kbuild will provide a clean way to do it. 
> 
> It is still better than what I have now.

ACK.  AFAICS, other parts of patch are already covered, except for adding
arch/um/include/sysdep to search path.  Why do we need that?  Files in
there get included as <sysdep/blah.h>, not <blah.h>, so...


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-14  1:13         ` Al Viro
@ 2005-02-14  5:28           ` Vadim Abrossimov
  0 siblings, 0 replies; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-14  5:28 UTC (permalink / raw)
  To: Al Viro, Jeff Dike; +Cc: User-mode-linux-devel


>
> ACK.  AFAICS, other parts of patch are already covered, except for adding
> arch/um/include/sysdep to search path.  Why do we need that?  Files in
> there get included as <sysdep/blah.h>, not <blah.h>, so...
>
>

I didn't add arch/um/include/sysdep to search path. I agree that it  
useless.
The only difference in include pass betwenn Al's patch and the mine (Dima)  
is the fpllowing:

Al>  ARCH_INCLUDE	:= -I$(ARCH_DIR)/include
Al> +ifneq ($(KBUILD_SRC),)
Al> +ARCH_INCLUDE	+= -I$(ARCH_DIR)/include2
Al> +ARCH_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include
Al> +MRPROPER_DIRS	+= $(ARCH_DIR)/include2
Al> +endif

Dima>    include $(MAKEFILES-INCL)
Dima>  endif

Dima> -ARCH_INCLUDE	:= -I$(ARCH_DIR)/include
Dima> +ARCH_INCLUDE	:= -I$(ARCH_DIR)/include \
Dima> +                   $(if $(KBUILD_SRC),  
-I$(objtree)/$(ARCH_DIR)/include2)
Dima> +
Dima>  SYS_DIR		:= $(ARCH_DIR)/include/sysdep-$(SUBARCH)

Actually:
- It's preferable to give an absolute path to include2: it exist only in  
the build tree.
Adding it as a relative path you ask Kbuild to add an absolute path to  
srctree as well.
- we don't need an explicit path to -I$(srctree)/$(ARCH_DIR)/include:  
Kbuild will
do it for us from '-I$(ARCH_DIR)/include'.
You certainly added it because of USER_OBJS. To deal with this issue I  
added
-I$(srctree)/$(ARCH_DIR)/include specifically to USER_CFLAGS:

Dima>  USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
Dima> -USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS))  
$(ARCH_INCLUDE) \
Dima> -	$(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
Dima> +USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS))
Dima> +# If building the kernel in a separate tree we need to add this  
path manually.
Dima> +# Note, that for CFLAGS it's done in the generic  
'scripts/Makefile.lib'
Dima> +USER_CFLAGS += $(if $(KBUILD_SRC), -I$(srctree)/$(ARCH_DIR)/include)
Dima> +USER_CFLAGS += $(ARCH_INCLUDE) $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
Dima> +

Dima


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-13 23:11         ` Vadim Abrossimov
@ 2005-02-16 18:30           ` Blaisorblade
  2005-02-19 10:55             ` Vadim Abrossimov
  2005-02-19 14:04             ` Vadim Abrossimov
  0 siblings, 2 replies; 14+ messages in thread
From: Blaisorblade @ 2005-02-16 18:30 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Vadim Abrossimov, Jeff Dike

On Monday 14 February 2005 00:11, Vadim Abrossimov wrote:
> On Sun, 13 Feb 2005 16:50:59 -0500, Jeff Dike <jdike@addtoit.com> wrote:

> This is the patch for USER_OBJS:
Ok, I have two more requests, if possible:
1) add something like arch/um/Rules.make which is included everywhere needed 
and contains boilerplate, repeated code. Ideally that would also contain also 
these two lines:

USER_OBJS += $(filter %_user.o,$(obj-y))
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

which are common to everything. So, most changes to this stuff could be 
insulated.

2) There is an error in the patch (even in Al's idea): you must swap, in the 
below code, CFLAGS_$(notdir $@) and $(USER_CFLAGS), since the former must be 
able to override the latter.

At least arch/um/kernel/frame.o will miscompile with the current patch; from 
arch/um/kernel/Makefile

#This must override the default -fomit-frame-pointer
CFLAGS_frame.o := -fno-omit-frame-pointer

#Notice that this declaration is correct.
$(USER_OBJS) : %.o: %.c
        $(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $<

And yes, this is a reason to use a common include instead of duplicating 
everything.
> +$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))
> $(USER_CFLAGS)

-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-16 18:30           ` Blaisorblade
@ 2005-02-19 10:55             ` Vadim Abrossimov
  2005-02-24 16:31               ` Blaisorblade
  2005-02-19 14:04             ` Vadim Abrossimov
  1 sibling, 1 reply; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-19 10:55 UTC (permalink / raw)
  To: Blaisorblade, user-mode-linux-devel; +Cc: Jeff Dike

On Wed, 16 Feb 2005 19:30:54 +0100, Blaisorblade <blaisorblade@yahoo.it>  
wrote:

> Ok, I have two more requests, if possible:
> 1) add something like arch/um/Rules.make which is included everywhere  
> needed
> 2) There is an error in the patch (even in Al's idea): you must swap, in  
> the below code

OK. I will do it.
Against which version you would suggest me to do it:
- as an add-on to 2.6.11-rc3-mm2 + Jeff's tarball (which already includes  
the original USER_OBJ cleanup)
- 2.6 bk
- any other

Also I have more general questions about the usual way the uml community  
works:
- do the patches from Jeff's tarball are intended to be pushed in 2.6 BK?  
if yes when and how?
- if one propose a patch against which version he/she should do it in  
order to (1) be useful for the community (2) get the patch pushed in 2.6  
BK soon? (Presumably (1) and (2) have the same answer :->)

Dima


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-16 18:30           ` Blaisorblade
  2005-02-19 10:55             ` Vadim Abrossimov
@ 2005-02-19 14:04             ` Vadim Abrossimov
  2005-02-24 18:19               ` Blaisorblade
  1 sibling, 1 reply; 14+ messages in thread
From: Vadim Abrossimov @ 2005-02-19 14:04 UTC (permalink / raw)
  To: Blaisorblade, user-mode-linux-devel; +Cc: Jeff Dike

On Wed, 16 Feb 2005 19:30:54 +0100, Blaisorblade <blaisorblade@yahoo.it>  
wrote:

> Ok, I have two more requests, if possible:
> 1) add something like arch/um/Rules.make which is included everywhere  
> needed

Find below the patch which implements Paolo's suggestion with one  
exception:
I put the common definitions in arch/um/scripts/Makefile.rules to be more  
consistent
with my understanding of conventions.

I did the patch against Jeff's tarball  
(http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.11-rc3-mm2/patches.tar)
the way it may be added to the end of the existing quilt 'series'.
Make me know if you think useful to do it also against some other versions.

Also I noticed that including my original patch in his tarball Jeff  
excluded changes
in some Makefiles (e.g. arch/um/kernel/Makefile).
Jeff, had you a problem with those Makefiles?

Dima


Signed-off-by: Vadim Abrossimov <Vadim_Abrossimov@yahoo.com>

---

#
# Move similar definitions from Makefiles to the newly created
# arch/um/scripts/Makefile.rules and include it everywhere needed
#
Index: 2.6.11-rc3-mm2-jd/arch/um/drivers/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/drivers/Makefile	2005-02-19  
12:22:20.502114912 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/drivers/Makefile	2005-02-19  
13:34:08.258236440 +0100
@@ -50,9 +50,7 @@

  USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y)  
$(obj-m)),$($(f)-objs))

-USER_OBJS := $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS))  
fd.o \
+USER_OBJS := $(filter %_user.o, $(USER_SINGLE_OBJS)) fd.o \
  	null.o pty.o tty.o xterm.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
+include arch/um/scripts/Makefile.rules
Index: 2.6.11-rc3-mm2-jd/arch/um/kernel/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/kernel/Makefile	2005-02-19  
12:22:19.391283784 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/kernel/Makefile	2005-02-19  
13:57:23.414140504 +0100
@@ -23,14 +23,12 @@

  user-objs-$(CONFIG_TTY_LOG) += tty_log.o

-USER_OBJS := $(filter %_user.o,$(obj-y))  $(user-objs-y) config.o  
helper.o \
+USER_OBJS := $(user-objs-y) config.o helper.o \
  	main.o time.o tty_log.o umid.o user_util.o frame.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

  CFLAGS_frame.o := -fno-omit-frame-pointer

-$(USER_OBJS) : %.o: %.c
-	$(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $<
+include arch/um/scripts/Makefile.rules

  targets += config.c

@@ -54,3 +52,4 @@
  		  -e 'a""\;'                   \
  		  -e '}'                       \
  		  $< > $@
+
Index: 2.6.11-rc3-mm2-jd/arch/um/kernel/skas/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/kernel/skas/Makefile	2005-02-19  
12:22:20.502114912 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/kernel/skas/Makefile	2005-02-19  
13:59:08.706133688 +0100
@@ -6,10 +6,8 @@
  obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \
  	syscall_kern.o syscall_user.o time.o tlb.o trap_user.o uaccess.o \

-USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
+USER_OBJS := process.o time.o

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
+include arch/um/scripts/Makefile.rules

  subdir- := util
Index: 2.6.11-rc3-mm2-jd/arch/um/kernel/tt/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/kernel/tt/Makefile	2005-02-19  
12:22:20.502114912 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/kernel/tt/Makefile	2005-02-19  
14:03:37.951202216 +0100
@@ -12,14 +12,12 @@

  obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/

-USER_OBJS := $(filter %_user.o,$(obj-y)) gdb.o time.o tracer.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
+USER_OBJS := gdb.o time.o tracer.o

  UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
  UNMAP_CFLAGS := $(patsubst -fprofile-arcs  
-ftest-coverage,,$(UNMAP_CFLAGS))

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
+include arch/um/scripts/Makefile.rules

  $(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)

Index: 2.6.11-rc3-mm2-jd/arch/um/kernel/tt/ptproxy/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/kernel/tt/ptproxy/Makefile	2005-02-19  
12:22:20.598100320 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/kernel/tt/ptproxy/Makefile	2005-02-19  
14:07:00.607393792 +0100
@@ -5,7 +5,6 @@

  obj-y = proxy.o ptrace.o sysdep.o wait.o

-USER_OBJS := $(foreach file,$(obj-y),$(src)/$(file))
+USER_OBJS := $(obj-y)

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
+include arch/um/scripts/Makefile.rules
Index: 2.6.11-rc3-mm2-jd/arch/um/os-Linux/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/os-Linux/Makefile	2005-02-19  
12:22:20.598100320 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/os-Linux/Makefile	2005-02-19  
14:14:03.290136248 +0100
@@ -8,9 +8,7 @@

  USER_OBJS := aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o \
  	time.o tt.o tty.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
-
-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)

  CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
+
+include arch/um/scripts/Makefile.rules
Index: 2.6.11-rc3-mm2-jd/arch/um/os-Linux/drivers/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/os-Linux/drivers/Makefile	2005-02-19  
12:22:20.599100168 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/os-Linux/drivers/Makefile	2005-02-19  
14:12:22.882400544 +0100
@@ -12,8 +12,7 @@

  USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y)),$($(f)-objs))

-USER_OBJS = $(filter %_user.o,$(obj-y) $(USER_SINGLE_OBJS))
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
+USER_OBJS := $(filter %_user.o, $(USER_SINGLE_OBJS))
+
+include arch/um/scripts/Makefile.rules

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
Index: 2.6.11-rc3-mm2-jd/arch/um/scripts/Makefile.rules
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/scripts/Makefile.rules	2004-02-23  
22:02:56.000000000 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/scripts/Makefile.rules	2005-02-19  
13:37:33.195081304 +0100
@@ -0,0 +1,8 @@
+#  
===========================================================================
+# arch/um: Generic definitions
+#  
===========================================================================
+
+USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m))
+USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
+
+$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS)  
$(CFLAGS_$(notdir $@))
Index: 2.6.11-rc3-mm2-jd/arch/um/sys-i386/Makefile
===================================================================
--- 2.6.11-rc3-mm2-jd.orig/arch/um/sys-i386/Makefile	2005-02-19  
12:22:20.599100168 +0100
+++ 2.6.11-rc3-mm2-jd/arch/um/sys-i386/Makefile	2005-02-19  
14:16:07.505252680 +0100
@@ -6,7 +6,6 @@
  obj-$(CONFIG_MODULES) += module.o

  USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
-USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

  SYMLINKS = bitops.c semaphore.c highmem.c module.c

@@ -26,8 +25,7 @@
  	ln -sf $(srctree)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
  endef

-$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@)) \
-	$(USER_CFLAGS)
+include arch/um/scripts/Makefile.rules

  $(SYMLINKS):
  	$(call make_link,$@)


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-19 10:55             ` Vadim Abrossimov
@ 2005-02-24 16:31               ` Blaisorblade
  0 siblings, 0 replies; 14+ messages in thread
From: Blaisorblade @ 2005-02-24 16:31 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Vadim Abrossimov, Jeff Dike

On Saturday 19 February 2005 11:55, Vadim Abrossimov wrote:
> On Wed, 16 Feb 2005 19:30:54 +0100, Blaisorblade <blaisorblade@yahoo.it>
>
> wrote:
> > Ok, I have two more requests, if possible:
> > 1) add something like arch/um/Rules.make which is included everywhere
> > needed
> > 2) There is an error in the patch (even in Al's idea): you must swap, in
> > the below code
>
> OK. I will do it.
> Against which version you would suggest me to do it:
> - as an add-on to 2.6.11-rc3-mm2 + Jeff's tarball (which already includes
> the original USER_OBJ cleanup)
For now, against this one. The patch is still in development, so this is the 
right choice.
> - 2.6 bk
> - any other
>
> Also I have more general questions about the usual way the uml community
> works:

> - do the patches from Jeff's tarball are intended to be pushed in 2.6 BK?
> if yes when and how?
Yes, "when they are felt as ready". However the process in most cases is  
possibly (author?) -> possibly (someone, including me, forwarding it; I often 
forward patches directly to -mm) -> Jeff's tree -> -mm tree -> BitKeeper 
repository and final release.

However, there are actually some little differences between the trees that 
interact with this patch. The patch also changes some additions to the 
Makefiles done in the Jeff's tree, for instance about "skas0" and "x11-fb".

Those hunks will have to stay in the tree even after the patch is merged, 
while the rest will go with the relevant patches.

I'm finding it not trivial to port these patches from the Jeff's tree 
to the mainline tree... there are some little differences which should move 
inside a "jeff-only" part of the patch 

I'm doing the port to get it merged as soon as 2.6.12.
> - if one propose a patch against which version he/she should do it in
> order to (1) be useful for the community (2) get the patch pushed in 2.6
> BK soon? (Presumably (1) and (2) have the same answer :->)
Well, the Jeff's tree is highly experimental, so the casual user often does 
not apply the full tree, and patches can evolve in it for months, in the case 
of big rewrites (they are merged sooner if they are fixes).

Probably the better way to get the patch immediately useful is to prepare it 
against -bk or -mm... after all, normally you don't get big hunks of Jeff's 
tree merged at once.

When the patch is merged, it will need to get resync'ed against mainline 
anyway.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies
  2005-02-19 14:04             ` Vadim Abrossimov
@ 2005-02-24 18:19               ` Blaisorblade
  0 siblings, 0 replies; 14+ messages in thread
From: Blaisorblade @ 2005-02-24 18:19 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Vadim Abrossimov, Jeff Dike

On Saturday 19 February 2005 15:04, Vadim Abrossimov wrote:
> On Wed, 16 Feb 2005 19:30:54 +0100, Blaisorblade <blaisorblade@yahoo.it>
>
> wrote:
> > Ok, I have two more requests, if possible:
> > 1) add something like arch/um/Rules.make which is included everywhere
> > needed
>
> Find below the patch which implements Paolo's suggestion with one
> exception:
The patch is totally mangled by the mailer, sorry. Could you please reattach 
it? I've tried fixing it by hand but hadn't got the time.

*) Another suggestion (I'll implement it if you are not going to): the 
creation of USER_SINGLE_OBJS should also be moved to Makefile.rules (the 
below form should be the more general one); so even the "$(filter %_user.o, 
$(USER_SINGLE_OBJS))" snippet could move there.

USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),
$($(f)-objs))

*) About  
http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.11-rc3-mm2/patches/user-obj-cleanup
at his end: I've seen that for stub.S you don't succeed to get it working. 
Have you tried setting a_flags for that one only?

*) Someone who has a working tree with this can check whether enabling 
CONFIG_MODVERSIONS works well? Without it it does not work, for what I 
remember, exactly for the kbuild problem.

When time ago I built a similar patch which changed c_flags (it hacked the 
main Makefiles though) it started to work well, since the object 
postprocessing step was also done. So this patch should also achieve this 
goal, I think.

*) (Slightly unrelated) About this change in the "skas0" patch:

Index: linux-2.6.10/arch/um/Makefile-i386
===================================================================
--- linux-2.6.10.orig/arch/um/Makefile-i386     2005-02-12 13:57:48.000000000 
-0500
+++ linux-2.6.10/arch/um/Makefile-i386  2005-02-14 12:36:37.000000000 -0500
@@ -8,7 +8,7 @@
   endif
 endif

-CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
+CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) $(STUB_CFLAGS)
 ARCH_USER_CFLAGS :=

 ifneq ($(CONFIG_GPROF),y)
Index: linux-2.6.10/arch/um/Makefile-x86_64
===================================================================
--- linux-2.6.10.orig/arch/um/Makefile-x86_64   2005-02-12 13:57:48.000000000 
-0500
+++ linux-2.6.10/arch/um/Makefile-x86_64        2005-02-14 12:36:37.000000000 
-0500
@@ -4,7 +4,7 @@
 SUBARCH_LIBS := arch/um/sys-x86_64/
 START := 0x60000000

-CFLAGS += -U__$(SUBARCH)__ -fno-builtin
+CFLAGS += -U__$(SUBARCH)__ -fno-builtin $(STUB_CFLAGS)
 ARCH_USER_CFLAGS := -D__x86_64__

 ELF_ARCH := i386:x86-64

I guess it's actually useless, because STUB_CFLAGS is not defined at that 
point, so it should be undone.
> I put the common definitions in arch/um/scripts/Makefile.rules to be more
> consistent
> with my understanding of conventions.
This form is also ok for me. If when merging they want it further renamed, 
we'll take care of it.

> Also I noticed that including my original patch in his tarball Jeff  
> excluded changes
> in some Makefiles (e.g. arch/um/kernel/Makefile).
> Jeff, had you a problem with those Makefiles?
I don't know what Jeff thought, but do you remember the bug I pointed out 
about USER_CFLAGS and CFLAGS_$@?

Well, that problem would cause a compilation problem on 
arch/um/kernel/frame.o, because this would not work:

CFLAGS_frame.o := -fno-omit-frame-pointer
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-02-25 15:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-13 14:19 [PATCH] uml: support a separate build tree; support USER_OBJS dependencies Vadim Abrossimov
2005-02-13 18:12 ` Jeff Dike
2005-02-13 16:46   ` Al Viro
2005-02-13 18:58     ` [uml-devel] " Vadim Abrossimov
2005-02-13 21:50       ` Jeff Dike
2005-02-13 23:11         ` Vadim Abrossimov
2005-02-16 18:30           ` Blaisorblade
2005-02-19 10:55             ` Vadim Abrossimov
2005-02-24 16:31               ` Blaisorblade
2005-02-19 14:04             ` Vadim Abrossimov
2005-02-24 18:19               ` Blaisorblade
2005-02-14  1:13         ` Al Viro
2005-02-14  5:28           ` Vadim Abrossimov
2005-02-13 19:35     ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.