From: Fabrice Fontaine Date: Thu, 15 Oct 2020 16:46:04 +0000 (+0200) Subject: package/libapparmor: fix build on uclibc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b22a190333d32d47458dd045e74ac16c3d57de33;p=buildroot.git package/libapparmor: fix build on uclibc Fix build of version 3.0.0 with uclibc. While the patch is added in package/libapparmor, it in fact fixes a build issue that only occurs when building package/apparmor, but as both packages share the same source, they also share the same patches. Fixes: - http://autobuild.buildroot.org/results/aea20bd5539fad35385565ffeb7e6ac566507017 Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- diff --git a/package/libapparmor/3.0.0/0002-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch b/package/libapparmor/3.0.0/0002-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch new file mode 100644 index 0000000000..0510489d55 --- /dev/null +++ b/package/libapparmor/3.0.0/0002-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch @@ -0,0 +1,37 @@ +From 0dbcbee70097ecde66708064ec1dedfa64e581e8 Mon Sep 17 00:00:00 2001 +From: Armin Kuster +Date: Wed, 7 Oct 2020 20:50:38 -0700 +Subject: [PATCH] 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 +[Retrieved from: +https://gitlab.com/ffontaine/apparmor/-/commit/0dbcbee70097ecde66708064ec1dedfa64e581e8] +Signed-off-by: Fabrice Fontaine +--- + 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} +-- +GitLab +