package/libpam-tacplus: fix build on uclibc
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 22 Jan 2020 19:59:31 +0000 (20:59 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 2 Feb 2020 08:07:14 +0000 (09:07 +0100)
Fixes:
 - http://autobuild.buildroot.org/results/05c67484136f3bb433ce7fc47b2ce01167048cc2

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Tested-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/libpam-tacplus/0001-libtac-lib-magic.c-fix-build-on-uclibc.patch [new file with mode: 0644]

diff --git a/package/libpam-tacplus/0001-libtac-lib-magic.c-fix-build-on-uclibc.patch b/package/libpam-tacplus/0001-libtac-lib-magic.c-fix-build-on-uclibc.patch
new file mode 100644 (file)
index 0000000..8cdbba4
--- /dev/null
@@ -0,0 +1,52 @@
+From b2af0aca53d696e6dad17d8a0351d233d1dd1200 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 22 Jan 2020 20:51:59 +0100
+Subject: [PATCH] libtac/lib/magic.c: fix build on uclibc
+
+Commit 7e990f9db6d8805d369876f45964df87efad9e08 replaced _GNU_SOURCE by
+AC_SYSTEM_EXTENSIONS. This is fine but then config.h must be included
+before system includes otherwise build fails with uclibc on:
+
+libtac/lib/magic.c: In function 'magic':
+libtac/lib/magic.c:70:11: error: implicit declaration of function 'getrandom' [-Werror=implicit-function-declaration]
+     ret = getrandom(&num, sizeof(num), GRND_NONBLOCK);
+           ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/05c67484136f3bb433ce7fc47b2ce01167048cc2
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/kravietz/pam_tacplus/pull/137]
+---
+ libtac/lib/magic.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libtac/lib/magic.c b/libtac/lib/magic.c
+index 9df5e3f..e13a483 100644
+--- a/libtac/lib/magic.c
++++ b/libtac/lib/magic.c
+@@ -18,6 +18,10 @@
+  * See `CHANGES' file for revision history.
+  */
++#ifdef HAVE_CONFIG_H
++  #include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+@@ -27,10 +31,6 @@
+ #include <fcntl.h>
+ #include <errno.h>
+-#ifdef HAVE_CONFIG_H
+-  #include "config.h"
+-#endif
+-
+ #include "magic.h"
+ #ifdef _MSC_VER
+-- 
+2.24.1
+