[U-Boot-Users] [PATCH v2] tools/envcrc.c: use the target sizeof rather than build

Wolfgang Denk wd at denx.de
Mon Mar 31 12:40:15 CEST 2008


In message <200803302142.18994.vapier at gentoo.org> you wrote:
> The envcrc.c does sizeof(unsigned long) when calculating the crc, but this
> is done with the build toolchain instead of the target toolchain, so if
> the build is a 64bit system but the target is 32bits, the size will
> obviously be wrong.  This introduces a sizeof.sh script to calculate the
> required sizeof() value of any type with any compiler.
> 
> Signed-off-by: Mike Frysinger <vapier at gentoo.org>
> ---
> Changes:
>  - adds copyright/license
>  - increase limit to 512
>  - increment by 4 bytes to find "32bit naturals" faster:
> (old/new # = number of times gcc is called)
> type	| sizeof	| old	| new
> char	| 1	| 1	| 5
> short	| 2	| 2	| 4
> int	| 4	| 4	| 2
> long	| 8	| 8	| 3
> double	| 8	| 8	| 3

Sorry, but I still think this is serious overkill which just slows down
the build process.

We need exactly one single case of  this,  i.  e.  sizeof(long).  And
instead  of  tricking  around all this here, I think we should rather
use somthing like "u32" in the code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Save yourself!  Reboot in 5 seconds!




More information about the U-Boot mailing list