diff options
author | Michael Brown | 2021-01-31 01:41:34 +0100 |
---|---|---|
committer | Michael Brown | 2021-01-31 01:41:34 +0100 |
commit | ba20ba42731b8b03a5db2f81f876fccd56257b0f (patch) | |
tree | fb71d810c4ae36e00f573fedefd270273bcae96d /src/Makefile.housekeeping | |
parent | [build] Avoid using sha1sum when calculating build ID (diff) | |
download | ipxe-ba20ba42731b8b03a5db2f81f876fccd56257b0f.tar.gz ipxe-ba20ba42731b8b03a5db2f81f876fccd56257b0f.tar.xz ipxe-ba20ba42731b8b03a5db2f81f876fccd56257b0f.zip |
[build] Avoid using awk to format build ID as hexadecimal
The version of awk used in FreeBSD seems to be incapable of formatting
unsigned 32-bit integers above 0x80000000 and will silently render any
such value as 0x80000000. For example:
echo 3735928559 | awk '{printf "0x%08x", $1}'
will produce 0x80000000 instead of the correct 0xdeadbeef.
This results in an approximately 50% chance of a build ID collision
when building on FreeBSD.
Work around this problem by passing the decimal value directly in the
ld --defsym argument value.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r-- | src/Makefile.housekeeping | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index e9130702..91be542a 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -1176,7 +1176,7 @@ blib : $(BLIB) # different builds (such as builds for multiple ROMs all built from # the same blib.a). # -BUILD_ID_CMD = cat $^ | cksum | awk '{printf "0x%08x", $$1}' +BUILD_ID_CMD = cat $^ | cksum | awk '{print $$1}' # Build timestamp # |