linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc: fix build with O=$(output_dir)
@ 2004-10-19  6:48 Roland Dreier
  2004-10-19 16:44 ` Tom Rini
  0 siblings, 1 reply; 8+ messages in thread
From: Roland Dreier @ 2004-10-19  6:48 UTC (permalink / raw)
  To: sam, akpm; +Cc: linux-kernel

Recent changes to arch/ppc/boot/lib/Makefile cause

      CC      arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o
    Assembler messages:
    FATAL: can't create arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o: No such file or directory

when building a ppc kernel using O=$(output_dir) with CONFIG_ZLIB_INFLATE=n,
because the $(output_dir)/lib/zlib_inflate directory doesn't get created.

This patch, which makes arch/ppc/boot/lib/Makefile create the
directory if needed, is one fix for the problem.

Signed-off-by: Roland Dreier <roland@topspin.com>

Index: linux-2.6.9/arch/ppc/boot/lib/Makefile
===================================================================
--- linux-2.6.9.orig/arch/ppc/boot/lib/Makefile	2004-10-18 14:54:55.000000000 -0700
+++ linux-2.6.9/arch/ppc/boot/lib/Makefile	2004-10-18 23:41:28.000000000 -0700
@@ -4,7 +4,13 @@
 
 CFLAGS_kbd.o	+= -Idrivers/char
 
-lib-y := $(addprefix ../../../../lib/zlib_inflate/, \
+ZLIB_DIR := ../../../../lib/zlib_inflate/
+
+lib-y := $(addprefix $(ZLIB_DIR), \
            infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o)
 lib-y += div64.o
 lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+
+ifneq ($(KBUILD_SRC),)
+_make_zlib_dir := $(shell [ -d $(obj)/$(ZLIB_DIR) ] || mkdir -p $(obj)/$(ZLIB_DIR) )
+endif

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

* Re: [PATCH] ppc: fix build with O=$(output_dir)
  2004-10-19  6:48 [PATCH] ppc: fix build with O=$(output_dir) Roland Dreier
@ 2004-10-19 16:44 ` Tom Rini
  2004-10-19 18:14   ` [PATCH/take 2] " Roland Dreier
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2004-10-19 16:44 UTC (permalink / raw)
  To: Roland Dreier; +Cc: sam, akpm, linux-kernel

On Mon, Oct 18, 2004 at 11:48:22PM -0700, Roland Dreier wrote:

> Recent changes to arch/ppc/boot/lib/Makefile cause
> 
>       CC      arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o
>     Assembler messages:
>     FATAL: can't create arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o: No such file or directory
> 
> when building a ppc kernel using O=$(output_dir) with CONFIG_ZLIB_INFLATE=n,
> because the $(output_dir)/lib/zlib_inflate directory doesn't get created.
> 
> This patch, which makes arch/ppc/boot/lib/Makefile create the
> directory if needed, is one fix for the problem.

IMHO, this is the uglier of the two fixes for the problem, as this means
you'll still be clobbering lib/zlib_inflate/*.o when ZLIB_INFLATE!=n.
The other is to go back to putting the object in $(O)/arch/ppc/boot/lib/
and copying the guts of the .c.o rule to arch/ppc/boot/lib/Makefile

Sam, any chance you've had time to think up a good fix to this?  Thanks.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-19 16:44 ` Tom Rini
@ 2004-10-19 18:14   ` Roland Dreier
  2004-10-19 18:29     ` Tom Rini
  0 siblings, 1 reply; 8+ messages in thread
From: Roland Dreier @ 2004-10-19 18:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: sam, akpm, linux-kernel

Subject: [PATCH/take 2] ppc: fix build with O=$(output_dir)

OK, here's a patch that builds a separate copy for arch/ppc/boot/lib.

Recent changes to arch/ppc/boot/lib/Makefile cause

      CC      arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o
    Assembler messages:
    FATAL: can't create arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o: No such file or directory

when building a ppc kernel using O=$(output_dir) with CONFIG_ZLIB_INFLATE=n,
because the $(output_dir)/lib/zlib_inflate directory doesn't get created.

This patch, which uses the lib/zlib_inflate sources to build objects
in the arch/ppc/boot/lib/directory, is one fix for the problem.

Signed-off-by: Roland Dreier <roland@topspin.com>

Index: linux-2.6.9/arch/ppc/boot/lib/Makefile
===================================================================
--- linux-2.6.9.orig/arch/ppc/boot/lib/Makefile	2004-10-18 14:54:55.000000000 -0700
+++ linux-2.6.9/arch/ppc/boot/lib/Makefile	2004-10-19 11:10:07.000000000 -0700
@@ -4,7 +4,10 @@
 
 CFLAGS_kbd.o	+= -Idrivers/char
 
-lib-y := $(addprefix ../../../../lib/zlib_inflate/, \
-           infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o)
-lib-y += div64.o
+ZLIB_OBJS := infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o
+
+lib-y := $(ZLIB_OBJS) div64.o
 lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+
+$(addprefix $(obj)/, $(ZLIB_OBJS)): $(obj)/%.o: lib/zlib_inflate/%.c
+	$(call if_changed,cc_o_c)

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

* Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-19 18:14   ` [PATCH/take 2] " Roland Dreier
@ 2004-10-19 18:29     ` Tom Rini
  2004-10-19 18:58       ` Roland Dreier
  2004-10-31 22:39       ` Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Tom Rini @ 2004-10-19 18:29 UTC (permalink / raw)
  To: Roland Dreier; +Cc: sam, akpm, linux-kernel

On Tue, Oct 19, 2004 at 11:14:38AM -0700, Roland Dreier wrote:

> Subject: [PATCH/take 2] ppc: fix build with O=$(output_dir)
> 
> OK, here's a patch that builds a separate copy for arch/ppc/boot/lib.
> 
> Recent changes to arch/ppc/boot/lib/Makefile cause
> 
>       CC      arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o
>     Assembler messages:
>     FATAL: can't create arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o: No such file or directory
> 
> when building a ppc kernel using O=$(output_dir) with CONFIG_ZLIB_INFLATE=n,
> because the $(output_dir)/lib/zlib_inflate directory doesn't get created.
> 
> This patch, which uses the lib/zlib_inflate sources to build objects
> in the arch/ppc/boot/lib/directory, is one fix for the problem.

This misses the bit to invoke the checker as well (when I first thought
this up I poked Al Viro about the general question of checker on boot
code, and he wanted it, so...).  And having 2 'magic' rules not just 1
is why I don't like this too much and was hoping Sam would have some
idea of a good fix.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-19 18:29     ` Tom Rini
@ 2004-10-19 18:58       ` Roland Dreier
  2004-10-26 22:33         ` Sam Ravnborg
  2004-10-31 22:39       ` Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Roland Dreier @ 2004-10-19 18:58 UTC (permalink / raw)
  To: Tom Rini; +Cc: sam, akpm, linux-kernel

    Tom> This misses the bit to invoke the checker as well (when I
    Tom> first thought this up I poked Al Viro about the general
    Tom> question of checker on boot code, and he wanted it, so...).
    Tom> And having 2 'magic' rules not just 1 is why I don't like
    Tom> this too much and was hoping Sam would have some idea of a
    Tom> good fix.

Hmm, good point, forgot about the checker.  I tried various magic ways
of fixing this with vpath etc. but I couldn't mke it work.  Sam,
you're our last hope I guess.

Thanks,
  Roland

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

* Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-19 18:58       ` Roland Dreier
@ 2004-10-26 22:33         ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2004-10-26 22:33 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Tom Rini, sam, akpm, linux-kernel

On Tue, Oct 19, 2004 at 11:58:03AM -0700, Roland Dreier wrote:
>     Tom> This misses the bit to invoke the checker as well (when I
>     Tom> first thought this up I poked Al Viro about the general
>     Tom> question of checker on boot code, and he wanted it, so...).
>     Tom> And having 2 'magic' rules not just 1 is why I don't like
>     Tom> this too much and was hoping Sam would have some idea of a
>     Tom> good fix.
> 
> Hmm, good point, forgot about the checker.  I tried various magic ways
> of fixing this with vpath etc. but I couldn't mke it work.  Sam,
> you're our last hope I guess.

ppc seems to come pretty low in my todo list these days - sorry.
Will take a deep look one day.

[um, m232r needs a great deal of attention also..]

	Sam

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

* Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-31 22:39       ` Sam Ravnborg
@ 2004-10-31 21:53         ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2004-10-31 21:53 UTC (permalink / raw)
  To: Roland Dreier, sam, akpm, linux-kernel

On Sun, Oct 31, 2004 at 11:39:50PM +0100, Sam Ravnborg wrote:
> On Tue, Oct 19, 2004 at 11:29:28AM -0700, Tom Rini wrote:
>  
> > This misses the bit to invoke the checker as well (when I first thought
> > this up I poked Al Viro about the general question of checker on boot
> > code, and he wanted it, so...).  And having 2 'magic' rules not just 1
> > is why I don't like this too much and was hoping Sam would have some
> > idea of a good fix.
> 
> Hi Tom.
> 
> Finally took a look.
> The best approach is to grab a copy of the .c file and compile
> that in this dir.
> In this way we avoid unessesary recompile etc. but waste a bit disk space.
> I do not like symlinks in general and made a copy. (note: uses cat to give
> appropriate permission)
> 
> If you are OK with this let me know if you want me to push it to linus
> or you go via the ppc tree.

Works for me, and please push it via your tree.  Thanks &
Acked-by: Tom Rini <trini@kernel.crashing.org>

if wanted.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)
  2004-10-19 18:29     ` Tom Rini
  2004-10-19 18:58       ` Roland Dreier
@ 2004-10-31 22:39       ` Sam Ravnborg
  2004-10-31 21:53         ` Tom Rini
  1 sibling, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2004-10-31 22:39 UTC (permalink / raw)
  To: Tom Rini; +Cc: Roland Dreier, sam, akpm, linux-kernel

On Tue, Oct 19, 2004 at 11:29:28AM -0700, Tom Rini wrote:
 
> This misses the bit to invoke the checker as well (when I first thought
> this up I poked Al Viro about the general question of checker on boot
> code, and he wanted it, so...).  And having 2 'magic' rules not just 1
> is why I don't like this too much and was hoping Sam would have some
> idea of a good fix.

Hi Tom.

Finally took a look.
The best approach is to grab a copy of the .c file and compile
that in this dir.
In this way we avoid unessesary recompile etc. but waste a bit disk space.
I do not like symlinks in general and made a copy. (note: uses cat to give
appropriate permission)

If you are OK with this let me know if you want me to push it to linus
or you go via the ppc tree.

PS: Had troubles with kbd so commented out.

	Sam

===== Makefile 1.11 vs edited =====
--- 1.11/arch/ppc/boot/lib/Makefile	2004-10-25 21:47:48 +02:00
+++ edited/Makefile	2004-10-31 23:37:23 +01:00
@@ -2,9 +2,22 @@
 # Makefile for some libs needed by zImage.
 #
 
-CFLAGS_kbd.o	+= -Idrivers/char
+CFLAGS_kbd.o	:= -Idrivers/char
+CFLAGS_vreset.o := -I$(srctree)/arch/ppc/boot/include
 
-lib-y := $(addprefix ../../../../lib/zlib_inflate/, \
-           infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o)
-lib-y += div64.o
-lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+zlib  := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
+	 
+lib-y += $(zlib:.c=.o) div64.o
+lib-$(CONFIG_VGA_CONSOLE) += vreset.o #kbd.o
+
+
+# zlib files needs header from their original place
+EXTRA_CFLAGS += -Ilib/zlib_inflate
+
+quiet_cmd_copy_zlib = COPY    $@
+      cmd_copy_zlib = cat $< > $@
+
+$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
+	$(call cmd,copy_zlib)
+
+clean-files := $(zlib)

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

end of thread, other threads:[~2004-10-31 21:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19  6:48 [PATCH] ppc: fix build with O=$(output_dir) Roland Dreier
2004-10-19 16:44 ` Tom Rini
2004-10-19 18:14   ` [PATCH/take 2] " Roland Dreier
2004-10-19 18:29     ` Tom Rini
2004-10-19 18:58       ` Roland Dreier
2004-10-26 22:33         ` Sam Ravnborg
2004-10-31 22:39       ` Sam Ravnborg
2004-10-31 21:53         ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).