summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-10-29 17:06:11 -0400
committerBen Gamari <ben@smart-cactus.org>2021-11-03 20:14:59 -0400
commit1a6402861c6e655f35e1b048a5ac5a3df1f460cb (patch)
treecdc287d6f03ed0e012fac3a42eff4702a77a1c63
parent9f42a6dcebf12a8c3e7c18d8291c0fa95e3c4d86 (diff)
downloadhaskell-1a6402861c6e655f35e1b048a5ac5a3df1f460cb.tar.gz
rts/RtsSymbols: Provide a proper prototype for environ
Previously we relied on Sym_NeedsProto, but this gave the symbol a type which conflicts with the definition that may be provided by unistd.h. Fixes #20577.
-rw-r--r--rts/RtsSymbols.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index fce399a075..7d7b8422c2 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -34,6 +34,11 @@
#include <elf.h> /* _DYNAMIC */
#endif
+/* We must provide a prototype for environ since depending upon the libc
+ * version it may or may not be provided by unistd.h. See #20577.
+ */
+extern char **environ;
+
/* -----------------------------------------------------------------------------
* Symbols to be inserted into the RTS symbol table.
*/
@@ -61,7 +66,6 @@
SymI_HasProto(stg_sig_install) \
SymI_HasProto(rtsTimerSignal) \
SymI_HasProto_redirect(atexit, atexit, STRENGTH_STRONG) /* See Note [Strong symbols] */ \
- SymI_NeedsDataProto(environ) \
SymI_NeedsDataProto(nocldstop)
#endif