Andrew Geissler | d1d22e6 | 2020-10-16 10:14:32 -0500 | [diff] [blame] | 1 | From 965bb9c3e464f756b258a7c259a92bce3cde74e7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Armin Kuster <akuster@mvista.com> |
| 3 | Date: Wed, 7 Oct 2020 20:50:38 -0700 |
| 4 | Subject: [PATCH] parser/Makefile: dont force host cpp to detect reallocarray |
| 5 | |
| 6 | In cross build environments, using the hosts cpp gives incorrect |
| 7 | detection of reallocarray. Change cpp to a variable. |
| 8 | |
| 9 | fixes: |
| 10 | parser_misc.c: In function 'int capable_add_cap(const char*, int, unsigned int, capability_flags)': |
| 11 | | parser_misc.c:297:37: error: 'reallocarray' was not declared in this scope |
| 12 | | 297 | tmp = (struct capability_table *) reallocarray(cap_table, sizeof(struct capability_table), cap_table_size+1); |
| 13 | |
| 14 | Signed-off-by: Armin Kuster <akuster808@gmail.com> |
| 15 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | --- |
| 19 | parser/Makefile | 2 +- |
| 20 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 21 | |
| 22 | diff --git a/parser/Makefile b/parser/Makefile |
| 23 | index acef3d77..8250ac45 100644 |
| 24 | --- a/parser/Makefile |
| 25 | +++ b/parser/Makefile |
| 26 | @@ -54,7 +54,7 @@ endif |
| 27 | CPPFLAGS += -D_GNU_SOURCE |
| 28 | |
| 29 | STDLIB_INCLUDE:="\#include <stdlib.h>" |
| 30 | -HAVE_REALLOCARRAY:=$(shell echo $(STDLIB_INCLUDE) | cpp ${CPPFLAGS} | grep -q reallocarray && echo true) |
| 31 | +HAVE_REALLOCARRAY:=$(shell echo $(STDLIB_INCLUDE) | ${CPP} ${CPPFLAGS} | grep -q reallocarray && echo true) |
| 32 | |
| 33 | WARNINGS = -Wall |
| 34 | CXX_WARNINGS = ${WARNINGS} ${EXTRA_WARNINGS} |
| 35 | -- |
| 36 | 2.17.1 |
| 37 | |