From a2a0d14b9c5046b76124c828a53b0e9cbc1bc5c8 Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Wed, 7 Oct 2020 08:27:11 -0700 Subject: [PATCH 1/2] aa_status: Fix build issue with musl add limits.h aa_status.c:269:22: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'AF_MAX'? | 269 | real_exe = calloc(PATH_MAX + 1, sizeof(char)); Signed-off-by: Armin Kuster --- binutils/aa_status.c | 1 + 1 file changed, 1 insertion(+) diff --git a/binutils/aa_status.c b/binutils/aa_status.c index 78b034090..41f1954e9 100644 --- a/binutils/aa_status.c +++ b/binutils/aa_status.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include From 0dbcbee70097ecde66708064ec1dedfa64e581e8 Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Wed, 7 Oct 2020 20:50:38 -0700 Subject: [PATCH 2/2] parser/Makefile: dont force host cpp to detect reallocarray In cross build environments, using the hosts cpp gives incorrect detection of reallocarray. Change cpp to a variable. fixes: parser_misc.c: In function 'int capable_add_cap(const char*, int, unsigned int, capability_flags)': | parser_misc.c:297:37: error: 'reallocarray' was not declared in this scope | 297 | tmp = (struct capability_table *) reallocarray(cap_table, sizeof(struct capability_table), cap_table_size+1); Signed-off-by: Armin Kuster --- parser/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/Makefile b/parser/Makefile index acef3d77a..8250ac451 100644 --- a/parser/Makefile +++ b/parser/Makefile @@ -54,7 +54,7 @@ endif CPPFLAGS += -D_GNU_SOURCE STDLIB_INCLUDE:="\#include " -HAVE_REALLOCARRAY:=$(shell echo $(STDLIB_INCLUDE) | cpp ${CPPFLAGS} | grep -q reallocarray && echo true) +HAVE_REALLOCARRAY:=$(shell echo $(STDLIB_INCLUDE) | ${CPP} ${CPPFLAGS} | grep -q reallocarray && echo true) WARNINGS = -Wall CXX_WARNINGS = ${WARNINGS} ${EXTRA_WARNINGS}