[coreboot-gerrit] Patch merged into coreboot/master: d2be1f1 AMD hudson & SB800 - Fix issues with mawk
gerrit at coreboot.org
gerrit at coreboot.org
Mon Apr 1 20:52:36 CEST 2013
the following patch was just integrated into master:
commit d2be1f11e11b68d88f9065ae75f32d7982cc3fe6
Author: Martin Roth <martin.roth at se-eng.com>
Date: Mon Mar 11 13:17:27 2013 -0600
AMD hudson & SB800 - Fix issues with mawk
When calculating the offsets of the various binary blobs within the
coreboot.rom file, we noticed that using mawk as the awk tool instead
of using gawk led to build issues. This was finally traced to the
maximum value of the unsigned long variables within mawk - 0x7fff_ffff.
Because we were doing calculations on values up in the 0xffxxxxxx
range, these numbers would either be turned into floating point values
and printed using scientific notation, or truncated at 0x7fff_ffff.
To fix this, we print the values out as floating point, with no decimal
digits. This works in gawk, mawk, and original-awk and as the testing
below show, seems to be the best way to do this.
printf %u 0xFFFFFFFF | awk '{printf("%.0f %u %d", $1 , $1 , $1 )}'
mawk: 4294967295 2147483647 2147483647
original-awk: 4294967295 2147483648 4294967295
gawk: 4294967295 4294967295 4294967295
The issue of %d not matching gawk and original-awk has been reported
to ubuntu.
In the future, I'd recommend that whenever awk is used, a format is
specified. It doesn't seem that we can count on the representation
being the same between the different versions.
Change-Id: I7b6b821c8ab13ad11f72e674ac726a98e8678710
Signed-off-by: Martin Roth <martin.roth at se-eng.com>
Reviewed-on: http://review.coreboot.org/2628
Reviewed-by: Dave Frodin <dave.frodin at se-eng.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Mar 25 19:53:14 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer at coreboot.org> at Mon Apr 1 20:52:31 2013, giving +2
See http://review.coreboot.org/2628 for details.
-gerrit
More information about the coreboot-gerrit
mailing list