Check for definition of AT_SECURE before using it
authorStephane Glondu <steph@glondu.net>
Wed, 24 Jul 2019 07:09:33 +0000 (09:09 +0200)
committerStephane Glondu <steph@glondu.net>
Wed, 24 Jul 2019 07:30:31 +0000 (09:30 +0200)
debian/patches/0005-Check-for-definition-of-AT_SECURE-before-using-it.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0005-Check-for-definition-of-AT_SECURE-before-using-it.patch b/debian/patches/0005-Check-for-definition-of-AT_SECURE-before-using-it.patch
new file mode 100644 (file)
index 0000000..b71cb48
--- /dev/null
@@ -0,0 +1,22 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Wed, 24 Jul 2019 09:08:39 +0200
+Subject: Check for definition of AT_SECURE before using it
+
+This fixes compilation on kfreebsd-*.
+---
+ otherlibs/unix/envir.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/otherlibs/unix/envir.c b/otherlibs/unix/envir.c
+index 3ad4b9c..bdc4193 100644
+--- a/otherlibs/unix/envir.c
++++ b/otherlibs/unix/envir.c
+@@ -39,7 +39,7 @@ CAMLprim value unix_environment_unsafe(value unit)
+ static char **secure_environ(void)
+ {
+-#ifdef HAS_GETAUXVAL
++#if defined(HAS_GETAUXVAL) && defined(AT_SECURE)
+   if (!getauxval(AT_SECURE))
+     return environ;
+   else
index 7a628c63650abe62b93bf02a800f3ec44e814904..45629306e1ef3fb140807289e5c109c126e90264 100644 (file)
@@ -2,3 +2,4 @@
 0004-Put-manpages-in-section-3o-instead-of-3.patch
 0003-Fix-in-configure.am.patch
 0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch
+0005-Check-for-definition-of-AT_SECURE-before-using-it.patch