From 1a55dbf7e98044040df106e335fdd1eba9212ce5 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 25 Nov 2021 09:53:28 +0100 Subject: [PATCH] util/ifdtool/Makefile: Fix building as standalone tool Commit f1e401c6cb70 (util/cbfstool/flashmap/fmap.c: fix fmaptool endianness bugs on BE) makes use of endianness conversion macros in cbfstool's FMAP code, which is also used by ifdtool. At least on Linux, the header provides these helpers, but only when `__USE_MISC` is defined, which is defined in the header when `_DEFAULT_SOURCE` is defined. This was accounted for in `Makefile.inc`, but not in `Makefile`. As a result, trying to build ifdtool as a standalone tool (i.e. not as part of building a coreboot image) results in build errors because the endianness conversion macros are not defined. Define `_DEFAULT_SOURCE` in `Makefile` to fix the build errors. Change-Id: I8c2bbc07ddd87d885e2d6f5c7f2bd501e5c4e3b0 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/59663 Reviewed-by: Patrick Georgi Reviewed-by: Felix Held Reviewed-by: Paul Menzel Reviewed-by: Krystian Hebel Tested-by: build bot (Jenkins) --- util/ifdtool/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/ifdtool/Makefile b/util/ifdtool/Makefile index e8d818c021..473dc08348 100644 --- a/util/ifdtool/Makefile +++ b/util/ifdtool/Makefile @@ -11,6 +11,7 @@ CFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -Werror CFLAGS += -I../../src/commonlib/include -I../../src/commonlib/bsd/include CFLAGS += -I../cbfstool/flashmap CFLAGS += -include ../../src/commonlib/bsd/include/commonlib/bsd/compiler.h +CFLAGS += -D_DEFAULT_SOURCE # for endianness converting functions LDFLAGS = OBJS = ifdtool.o