Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-25 Thread Simon Glass
Hi Chris,

On 24 July 2014 06:14, Chris Packham judge.pack...@gmail.com wrote:
 Hi Simon,

 On Wed, Jul 23, 2014 at 10:27 PM, Simon Glass s...@chromium.org wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).

 Signed-off-by: Chris Packham judge.pack...@gmail.com

 Acked-by: Simon Glass s...@chromium.org

 But you might want to look at this.

 http://patchwork.ozlabs.org/patch/371936/


 Thanks. I've re-submitted a version with Jeroen's change included and
 it seems a v2 of his patch is imminent too. Either way I'm not fussed.

 But this has highlighted another issue I'm experiencing related to
 this code. Originally I thought it was because I was doing something a
 bit weird with a custom u-boot.lds but actually the problem is my
 u-boot is setup so that it finishes exactly at the end of a 32bit
 address space so _image_binary_end is just off the end of it which
 screws up the size calculation.

   $ grep _image_binary_end u-boot.map
 0x0001_image_binary_end = .

   $ grep _image_binary_end System.map
    A _image_binary_end

   $ make binary_size_check
   ...
   System.map shows a binary size of -4294180864
 but u-boot.bin shows 786432
   make: *** [binary_size_check] Error 1

 I think it should be possible to change binary_size_check to use
 u-boot.map instead of System.map but would that be OK for all
 architectures?

That's unfortunate - it's just a little check. It does protect again a
breakage but we need to keep it simple. Maybe in this case we can mask
with 0x and get the right answer?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Simon Glass
On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).

 Signed-off-by: Chris Packham judge.pack...@gmail.com

Acked-by: Simon Glass s...@chromium.org

But you might want to look at this.

http://patchwork.ozlabs.org/patch/371936/

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
  file_size was being calculated using back-ticks but map_size uses
  $(shell ...). Update the file_size calculation to use $(shell ...).
 
  Signed-off-by: Chris Packham judge.pack...@gmail.com
 
 Acked-by: Simon Glass s...@chromium.org
 
 But you might want to look at this.
 
 http://patchwork.ozlabs.org/patch/371936/

Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
Thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Jeroen Hofstee

Hi,

On 23-07-14 20:03, Tom Rini wrote:

On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:

On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:

file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

Signed-off-by: Chris Packham judge.pack...@gmail.com

Acked-by: Simon Glass s...@chromium.org

But you might want to look at this.

http://patchwork.ozlabs.org/patch/371936/

Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
Thanks!



no problem. For the record I have not seen any issues with
mentioned gmake version. But using $(shell .. ) seem like a sane
thing to do. v2 is on its way, running MAKEALL for arm (can we keep it?).

Chris: blackfin targets seem to rely on the same construct btw...

Regards,
Jeroen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 09:24:00PM +0200, Jeroen Hofstee wrote:
 Hi,
 
 On 23-07-14 20:03, Tom Rini wrote:
 On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).
 
 Signed-off-by: Chris Packham judge.pack...@gmail.com
 Acked-by: Simon Glass s...@chromium.org
 
 But you might want to look at this.
 
 http://patchwork.ozlabs.org/patch/371936/
 Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
 Thanks!
 
 
 no problem. For the record I have not seen any issues with
 mentioned gmake version. But using $(shell .. ) seem like a sane
 thing to do. v2 is on its way, running MAKEALL for arm (can we keep it?).

MAKEALL isn't going away for v2014.10 but please reply to Simon's RFC
about it.  I do have to admit that switching all of my stuff to buildman
is still on my TODO list.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Chris Packham
Hi Simon,

On Wed, Jul 23, 2014 at 10:27 PM, Simon Glass s...@chromium.org wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).

 Signed-off-by: Chris Packham judge.pack...@gmail.com

 Acked-by: Simon Glass s...@chromium.org

 But you might want to look at this.

 http://patchwork.ozlabs.org/patch/371936/


Thanks. I've re-submitted a version with Jeroen's change included and
it seems a v2 of his patch is imminent too. Either way I'm not fussed.

But this has highlighted another issue I'm experiencing related to
this code. Originally I thought it was because I was doing something a
bit weird with a custom u-boot.lds but actually the problem is my
u-boot is setup so that it finishes exactly at the end of a 32bit
address space so _image_binary_end is just off the end of it which
screws up the size calculation.

  $ grep _image_binary_end u-boot.map
0x0001_image_binary_end = .

  $ grep _image_binary_end System.map
   A _image_binary_end

  $ make binary_size_check
  ...
  System.map shows a binary size of -4294180864
but u-boot.bin shows 786432
  make: *** [binary_size_check] Error 1

I think it should be possible to change binary_size_check to use
u-boot.map instead of System.map but would that be OK for all
architectures?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-22 Thread Chris Packham
file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

Signed-off-by: Chris Packham judge.pack...@gmail.com
---
The back ticks didn't work in my environment (GNU Make 3.81). Updating
to use $(shell ...) makes sense from a consistency view even if the
problem is my environment.

 Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ca212b5..f6a0f68 100644
--- a/Makefile
+++ b/Makefile
@@ -786,7 +786,7 @@ u-boot.hex u-boot.srec: u-boot FORCE
 OBJCOPYFLAGS_u-boot.bin := -O binary
 
 binary_size_check: u-boot.bin System.map FORCE
-   @file_size=`stat -c %s u-boot.bin` ; \
+   file_size=$(shell stat -c %s u-boot.bin) ; \
map_size=$(shell cat System.map | \
awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end 
= $$1} END {if (start !=   end != ) print ibase=16;  toupper(end)  -  
toupper(start)}' \
| bc); \
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot