diff options
author | Toomas Soome <tsoome@FreeBSD.org> | 2020-03-19 21:05:11 +0000 |
---|---|---|
committer | Toomas Soome <tsoome@FreeBSD.org> | 2020-03-19 21:05:11 +0000 |
commit | 27bae6150a9fd352796b5ff775eb464a2cf6dac9 (patch) | |
tree | afc3239908ef86eea352b0194e91c35594473b4b /stand/uboot | |
parent | 6fb7b4fbdbf033fd0a41e805c0726f174f59628c (diff) |
loader: remove libsa/crc32.c and use version from zlib
we have crc32(const void *, size_t) in libsa. Unfortunately zlib has
crc32(long, const unigned char *, unsigned) and we have conflict.
Since we do build libsa with zlib, we can use zlib version instead.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D24068
Notes
Notes:
svn path=/head/; revision=359153
Diffstat (limited to 'stand/uboot')
-rw-r--r-- | stand/uboot/lib/Makefile | 2 | ||||
-rw-r--r-- | stand/uboot/lib/glue.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/stand/uboot/lib/Makefile b/stand/uboot/lib/Makefile index 19644842a8d8..e56cf4f0b370 100644 --- a/stand/uboot/lib/Makefile +++ b/stand/uboot/lib/Makefile @@ -10,6 +10,8 @@ WARNS?= 2 SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c +CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib + .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c .endif diff --git a/stand/uboot/lib/glue.c b/stand/uboot/lib/glue.c index 016d435b345e..83c0e3da41a5 100644 --- a/stand/uboot/lib/glue.c +++ b/stand/uboot/lib/glue.c @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> -#include <crc32.h> +#include <zlib.h> #include <stand.h> #include "api_public.h" #include "glue.h" @@ -57,9 +57,9 @@ valid_sig(struct api_signature *sig) * produced */ s = *sig; - s.checksum = 0; + s.checksum = crc32(0, Z_NULL, 0); - checksum = crc32((void *)&s, sizeof(struct api_signature)); + checksum = crc32(s.checksum, (void *)&s, sizeof(struct api_signature)); if (checksum != sig->checksum) return (0); |