tiny patch for examples/Makefile (objcopy related)
Hello u-boot-users,
Here is a short patch for the examples/Makefile. This improves reliability in the case of a deficient toolchain.
For example the MontaVista (pro 3.0) ppc_82xx objcopy does not accept srec input, and produces an empty output file which can confuse make.
This patch ensures that the binary image is produced from the elf file and not the srec file, which allows a clean build.
-Cam
PS. MontaVista have 'no general interest in supporting srec input' because of 'how little information srec files contain'.
Signature · 5 lines
camilo at mesias.co.uk <-- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: examples-Makefile.diff Url: http://lists.denx.de/pipermail/u-boot/attachments/20031203/4f349cbe/attachment.txt
Quoted 7 lines · Cam
Hello u-boot-users,
Here is a short patch for the examples/Makefile. This improves reliability in the case of a deficient toolchain.
For example the MontaVista (pro 3.0)
ppc_82xxobjcopy does not accept srec input, and produces an empty output file which can confuse make.
Yep, I had noticed this long ago too. Why not just add "-I srec" as in the attached?
--
Regards,
George
Quoted 16 lines
This patch ensures that the binary image is produced from the elf file and not the srec file, which allows a clean build.
-Cam
PS. MontaVista have 'no general interest in supporting srec input' because of 'how little information srec files contain'.
------------------------------------------------------------------------
diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
examples/Makefile line 110
Quoted 8 lines
examples/Makefile +1
-1@@ -104,7 +104,7 @@ $(OBJCOPY) -O srec $(<:.o=) $@ %.bin: %.srec - $(OBJCOPY) -O binary $< $@ 2>/dev/null + $(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null #########################################################################
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20031203/390504b3/attachment.txt
Dear Cam,
Quoted 3 lines · in message <[email protected]> you wrote:
Here is a short patch for the examples/Makefile. This improves reliability in the case of a deficient toolchain.
Thanks, added.
Quoted 2 lines
For example the MontaVista (pro 3.0)
ppc_82xxobjcopy does not accept srec input, and produces an empty output file which can confuse make.
...
Quoted 2 lines
PS. MontaVista have 'no general interest in supporting srec input' because of 'how little information srec files contain'.
Well, but this is a standard feature in the binutils, and it seems ignorant to me to (intentionally) disable it. Anyway - thanks for the fix.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de How many Unix hacks does it take to change a light bulb? Let's see, can you use a shell script for that or does it need a C program?
Hi Wolfgang & Cam,
Quoted 13 lines
Dear Cam,
Quoted 10 lines · in message <[email protected]> you wrote:
Here is a short patch for the examples/Makefile. This improves reliability in the case of a deficient toolchain.
diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
examples/Makefile +0
-0@@ -104,7 +104,7 @@ $(OBJCOPY) -O srec $(<:.o=) $@
Quoted 7 lines
examples/Makefile line 109
Quoted 5 lines
examples/Makefile +1
-1%.bin: %.srec - $(OBJCOPY) -O binary $< $@ 2>/dev/null + $(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null #########################################################################Thanks, added.
Are you aware, that you effectively have a misleading rule now? The rule says how to generate ".bin" from ".srec" files, while in the command pattern you explicitely use none of the prerequisites but the hand-derived ELF file. This might potentially mess up make's rule algorithm.
As I am on holiday right now, I am too lazy to come up with a cleaner fix, I just wanted to phrase my concern.
Cheers
Detlev
Signature · 1 line
<ESC>:!emacs %
Quoted 23 lines · Detlev Zundel
Hi Wolfgang & Cam,
Quoted 13 lines
Dear Cam,
Quoted 10 lines · in message <[email protected]> you wrote:
Here is a short patch for the examples/Makefile. This improves reliability in the case of a deficient toolchain.
diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
examples/Makefile +0
-0@@ -104,7 +104,7 @@ $(OBJCOPY) -O srec $(<:.o=) $@Quoted 7 lines
examples/Makefile line 109
Quoted 5 lines
examples/Makefile +1
-1%.bin: %.srec - $(OBJCOPY) -O binary $< $@ 2>/dev/null + $(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null #########################################################################Thanks, added.
Quoted 8 lines
Are you aware, that you effectively have a misleading rule now? The rule says how to generate ".bin" from ".srec" files, while in the command pattern you explicitely use none of the prerequisites but the hand-derived ELF file. This might potentially mess up make's rule algorithm.
As I am on holiday right now, I am too lazy to come up with a cleaner fix, I just wanted to phrase my concern.
This works without the side-effects too: ; P
Index: examples/Makefile
===================================================================
RCS file: /cvsroot/u-boot/u-boot/examples/Makefile,v retrieving revision 1.14
Makefile +1 -1
@@ -104,7 +104,7 @@ $(OBJCOPY) -O srec $(<:.o=) $@ %.bin: %.srec - $(OBJCOPY) -O binary $< $@ 2>/dev/null + $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null #########################################################################
--
Regards,
George
George
I have a preference for generating the srec and binary outputs from a common input, it seems simpler, and less prone to things going wrong. I realise that the current Makefile achieves this in an obscure way (the bin is made dependent on the srec, however it really depends on a file produced as a side-effect of the srec target).
Quoted 1 line
This works without the side-effects too: ; P
[...]
Makefile line 107
Quoted 1 line
Makefile +1
-0+ $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
I really like that, because it is simple. However it does not work for me, as the MontaVista ppc_82xx-objcopy does not support srec input.
If I get some time I will try to do more with the Makefiles, as I would like them to work for Rational ClearCase make (clearmake). Mostly they do right now with the exception of recursive make invocations. However there are greater priorities within the project and I expect I might not get the time to tweak the Makefiles beyond getting it working.
Thanks for the feedback, it's a joy to find such an active and interested community.
-Cam