* [Buildroot] [PATCH 1/1] package/apparmor: fix build on uclibc
@ 2020-10-15 16:46 Fabrice Fontaine
2020-10-15 20:56 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2020-10-15 16:46 UTC (permalink / raw)
To: buildroot
Fix build of version 3.0.0 with uclibc
Fixes:
- http://autobuild.buildroot.org/results/aea20bd5539fad35385565ffeb7e6ac566507017
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...orce-host-cpp-to-detect-reallocarray.patch | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 package/apparmor/0001-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch
diff --git a/package/apparmor/0001-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch b/package/apparmor/0001-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch
new file mode 100644
index 0000000000..0510489d55
--- /dev/null
+++ b/package/apparmor/0001-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 <akuster@mvista.com>
+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 <akuster808@gmail.com>
+[Retrieved from:
+https://gitlab.com/ffontaine/apparmor/-/commit/0dbcbee70097ecde66708064ec1dedfa64e581e8]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ 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 <stdlib.h>"
+-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
+
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 1/1] package/apparmor: fix build on uclibc
2020-10-15 16:46 [Buildroot] [PATCH 1/1] package/apparmor: fix build on uclibc Fabrice Fontaine
@ 2020-10-15 20:56 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-10-15 20:56 UTC (permalink / raw)
To: buildroot
On Thu, 15 Oct 2020 18:46:04 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fix build of version 3.0.0 with uclibc
>
> Fixes:
> - http://autobuild.buildroot.org/results/aea20bd5539fad35385565ffeb7e6ac566507017
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...orce-host-cpp-to-detect-reallocarray.patch | 37 +++++++++++++++++++
> 1 file changed, 37 insertions(+)
> create mode 100644 package/apparmor/0001-parser-Makefile-dont-force-host-cpp-to-detect-reallocarray.patch
Applied to master, but after moving the patch to package/libapparmor/,
renumbering it 0002. It also gets applied to apparmor due to the
symlink package/apparmor/3.0.0 -> package/libapparmor/3.0.0 that I
created.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-15 20:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15 16:46 [Buildroot] [PATCH 1/1] package/apparmor: fix build on uclibc Fabrice Fontaine
2020-10-15 20:56 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox