Idwer Vollering has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/54022 )
Change subject: util/cbfstool: several fixes to build on OpenBSD ......................................................................
util/cbfstool: several fixes to build on OpenBSD
This was done on OpenBSD 6.8
Signed-off-by: Idwer Vollering vidwer@gmail.com Change-Id: I69ca92175abef8d38c7bad2b2e9ed40f5cdd1d32 --- M util/cbfstool/Makefile.inc M util/cbfstool/swab.h 2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/54022/1
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index 5b49fe8..89f0a06 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -113,6 +113,10 @@ TOOLLDFLAGS ?= HOSTCFLAGS += -fms-extensions
+ifeq ($(shell uname -s 2>/dev/null), OpenBSD) +TOOLLDFLAGS += -Wl,-z,notext +endif + ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32) TOOLCFLAGS += -mno-ms-bitfields endif diff --git a/util/cbfstool/swab.h b/util/cbfstool/swab.h index a45a767..2ab9922 100644 --- a/util/cbfstool/swab.h +++ b/util/cbfstool/swab.h @@ -15,7 +15,7 @@ * */
-#if !defined(__APPLE__) && !defined(__NetBSD__) +#if !defined(__APPLE__) && !defined(__NetBSD__) && !defined(__OpenBSD__) #define ntohl(x) (is_big_endian() ? (uint32_t)(x) : swab32(x)) #define htonl(x) (is_big_endian() ? (uint32_t)(x) : swab32(x)) #else