public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix booting some PPC32 machines
@ 2004-05-03 18:09 Tom Rini
  2004-05-04  0:34 ` Paul Mackerras
  2004-05-04  7:06 ` Olaf Hering
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Rini @ 2004-05-03 18:09 UTC (permalink / raw)
  To: Paul Mackerras, olh, Andrew Morton, Kernel Mailing List,
	Linus Torvalds

Hello.  The following patch fixes booting on some PPC32 machines with
OpenFirmware, when booted without the aid of an additional bootloader.
The problem is that the linker script for the 'zImage' type targets was
put into the list of dependancies which objcopy would parse as a list of
files to copy into the resulting image.  The fix is to make the phony
zImage targets depend on the linker script.

===== arch/ppc/boot/openfirmware/Makefile 1.22 vs edited =====
--- 1.22/arch/ppc/boot/openfirmware/Makefile	Thu Apr  1 08:16:57 2004
+++ edited/arch/ppc/boot/openfirmware/Makefile	Mon May  3 10:24:35 2004
@@ -104,10 +104,10 @@
 			$(HACKCOFF) $@ && \
 			ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac
 
-$(images)/vmlinux.coff: $(obj)/coffboot $(boot)/ld.script
+$(images)/vmlinux.coff: $(obj)/coffboot
 	$(call cmd,gen-coff)
 
-$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(boot)/ld.script
+$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
 	$(call cmd,gen-coff)
 
 quiet_cmd_gen-elf-pmac = ELF     $@
@@ -116,19 +116,19 @@
 			$(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
 					 -R .comment $(del-ramdisk-sec)
 
-$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note $(boot)/ld.script
+$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note
 	$(call cmd,gen-elf-pmac)
 $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
-				   $(LIBS) $(obj)/note $(boot)/ld.script
+				   $(LIBS) $(obj)/note
 	$(call cmd,gen-elf-pmac)
 
 quiet_cmd_gen-chrp = CHRP    $@
       cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $^ && \
 			$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
 
-$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script
+$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
 	$(call cmd,gen-chrp)
-$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script
+$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
 	$(call cmd,gen-chrp)
 
 quiet_cmd_addnote = ADDNOTE $@
@@ -153,13 +153,15 @@
 		 $(images)/vmlinux.elf-pmac	\
 		 $(images)/zImage.chrp		\
 		 $(images)/zImage.chrp-rs6k	\
-		 $(images)/miboot.image
+		 $(images)/miboot.image		\
+		 $(boot)/ld.script
 	@echo '  kernel: $@ is ready ($<)'
 zImage.initrd:	 $(images)/vmlinux.initrd.coff 		\
 		 $(images)/vmlinux.initrd.elf-pmac	\
 		 $(images)/zImage.initrd.chrp		\
 		 $(images)/zImage.initrd.chrp-rs6k	\
-		 $(images)/miboot.initrd.image
+		 $(images)/miboot.initrd.image		\
+		 $(boot)/ld.script
 	@echo '  kernel: $@ is ready ($<)'
 
 TFTPIMAGE	:= /tftpboot/zImage

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

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

* Re: [PATCH] Fix booting some PPC32 machines
  2004-05-03 18:09 [PATCH] Fix booting some PPC32 machines Tom Rini
@ 2004-05-04  0:34 ` Paul Mackerras
  2004-05-04  1:52   ` Tom Rini
  2004-05-04  7:06 ` Olaf Hering
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2004-05-04  0:34 UTC (permalink / raw)
  To: Tom Rini; +Cc: olh, Andrew Morton, Kernel Mailing List, Linus Torvalds

Tom Rini writes:

> Hello.  The following patch fixes booting on some PPC32 machines with
> OpenFirmware, when booted without the aid of an additional bootloader.
> The problem is that the linker script for the 'zImage' type targets was
> put into the list of dependancies which objcopy would parse as a list of
> files to copy into the resulting image.  The fix is to make the phony
> zImage targets depend on the linker script.

I don't like this part of the fix:

>  $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
> -				   $(LIBS) $(obj)/note $(boot)/ld.script
> +				   $(LIBS) $(obj)/note
>  	$(call cmd,gen-elf-pmac)

because the linking process (gen-elf-pmac) really does depend on
ld.script.  Since gen-elf-pmac uses $<, not $^, it should be OK with
the ld.script in the dependencies.  Did you verify that there was a
problem with this rule or did you just rip out all of the ld.script
dependencies?

Similarly we need the ld.script dependency in here:

> -$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script
> +$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
>  	$(call cmd,gen-chrp)
> -$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script
> +$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
>  	$(call cmd,gen-chrp)

Here, gen-chrp does have a problem because it uses $^, but it looks to
me that with a minor change it could just use $< and avoid the
problem.

The other places where you have removed ld.script from the
dependencies look OK to me.

Regards,
Paul.

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

* Re: [PATCH] Fix booting some PPC32 machines
  2004-05-04  0:34 ` Paul Mackerras
@ 2004-05-04  1:52   ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2004-05-04  1:52 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: olh, Andrew Morton, Kernel Mailing List, Linus Torvalds

On Tue, May 04, 2004 at 10:34:35AM +1000, Paul Mackerras wrote:

> Tom Rini writes:
> 
> > Hello.  The following patch fixes booting on some PPC32 machines with
> > OpenFirmware, when booted without the aid of an additional bootloader.
> > The problem is that the linker script for the 'zImage' type targets was
> > put into the list of dependancies which objcopy would parse as a list of
> > files to copy into the resulting image.  The fix is to make the phony
> > zImage targets depend on the linker script.
> 
> I don't like this part of the fix:
> 
> >  $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
> > -				   $(LIBS) $(obj)/note $(boot)/ld.script
> > +				   $(LIBS) $(obj)/note
> >  	$(call cmd,gen-elf-pmac)
> 
> because the linking process (gen-elf-pmac) really does depend on
> ld.script.  Since gen-elf-pmac uses $<, not $^, it should be OK with
> the ld.script in the dependencies.  Did you verify that there was a
> problem with this rule or did you just rip out all of the ld.script
> dependencies?

I did just remove all of the previous dependancies and place them on the
zImage target (we don't mention that you can do 'make
arch/ppc/boot/images/foo.image, and I don't know if that would work, so
I don't think that'd be a problem).

> Similarly we need the ld.script dependency in here:
> 
> > -$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script
> > +$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
> >  	$(call cmd,gen-chrp)
> > -$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script
> > +$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
> >  	$(call cmd,gen-chrp)
> 
> Here, gen-chrp does have a problem because it uses $^, but it looks to
> me that with a minor change it could just use $< and avoid the
> problem.

IIRC, changing to $< means we have to compilcate the rules a bit more,
or thinking a bit harder, re-arrange the dependancies s.t.
$(obj)/image*.o is first, and gen-chrp (and gen-pmac) both know to use
$(CHRPOBJS) and $(LIBS).

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

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

* Re: [PATCH] Fix booting some PPC32 machines
  2004-05-03 18:09 [PATCH] Fix booting some PPC32 machines Tom Rini
  2004-05-04  0:34 ` Paul Mackerras
@ 2004-05-04  7:06 ` Olaf Hering
  2004-05-04 20:48   ` Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2004-05-04  7:06 UTC (permalink / raw)
  To: Tom Rini; +Cc: Paul Mackerras, Andrew Morton, Kernel Mailing List,
	Linus Torvalds

 On Mon, May 03, Tom Rini wrote:

> Hello.  The following patch fixes booting on some PPC32 machines with
> OpenFirmware, when booted without the aid of an additional bootloader.
> The problem is that the linker script for the 'zImage' type targets was
> put into the list of dependancies which objcopy would parse as a list of
> files to copy into the resulting image.  The fix is to make the phony
> zImage targets depend on the linker script.

This fixes netbooting on my B50. But it breaks the dependency to ld.script,
which was the whole point of the previous patch.

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

* Re: [PATCH] Fix booting some PPC32 machines
  2004-05-04  7:06 ` Olaf Hering
@ 2004-05-04 20:48   ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2004-05-04 20:48 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Paul Mackerras, Andrew Morton, Kernel Mailing List,
	Linus Torvalds

On Tue, May 04, 2004 at 09:06:06AM +0200, Olaf Hering wrote:
>  On Mon, May 03, Tom Rini wrote:
> 
> > Hello.  The following patch fixes booting on some PPC32 machines with
> > OpenFirmware, when booted without the aid of an additional bootloader.
> > The problem is that the linker script for the 'zImage' type targets was
> > put into the list of dependancies which objcopy would parse as a list of
> > files to copy into the resulting image.  The fix is to make the phony
> > zImage targets depend on the linker script.
> 
> This fixes netbooting on my B50. But it breaks the dependency to ld.script,
> which was the whole point of the previous patch.

As I mentioned on IRC, but don't have time ATM to verify, I don't think
a 'touch' of the ld.script is sufficient a test in this case since it's
a call-if-changed thing so you'd have to modify ld.script.  Can you do
that and see if it's really a change?  Thanks.

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

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

end of thread, other threads:[~2004-05-04 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-03 18:09 [PATCH] Fix booting some PPC32 machines Tom Rini
2004-05-04  0:34 ` Paul Mackerras
2004-05-04  1:52   ` Tom Rini
2004-05-04  7:06 ` Olaf Hering
2004-05-04 20:48   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox