Thanks, I installed the attached slightly-different patch in the interest of
namespace cleanliness.
From 7ad7e72142e3227717a3eb58bcfd3bb17d425491 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 6 Nov 2014 20:33:02 -0800
Subject: [PATCH] unistd: port to iOS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by André Klitzing in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00013.html
* lib/unistd.in.h (environ): Do not include crt_externs.h on iOS.
---
ChangeLog | 7 +++++++
lib/unistd.in.h | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 7e03d07..28dcc5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-06 Paul Eggert <egg...@cs.ucla.edu>
+
+ unistd: port to iOS
+ Problem reported by André Klitzing in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00013.html
+ * lib/unistd.in.h (environ): Do not include crt_externs.h on iOS.
+
2014-11-05 Paul Eggert <egg...@cs.ucla.edu>
obstack: do not reject malloc-style obstack_chunkfun, obstack_freefun
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index bfa9578..b4a3f5b 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -401,6 +401,12 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
/* Set of environment variables and values. An array of strings of the form
"VARIABLE=VALUE", terminated with a NULL. */
# if defined __APPLE__ && defined __MACH__
+# include <TargetConditionals.h>
+# if !defined TARGET_OS_IPHONE && !defined TARGET_IPHONE_SIMULATOR
+# define _GL_USE_CRT_EXTERNS
+# endif
+# endif
+# ifdef _GL_USE_CRT_EXTERNS
# include <crt_externs.h>
# define environ (*_NSGetEnviron ())
# else
--
1.9.3