diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-10-29 17:06:11 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-01 03:09:21 -0500 |
commit | 7bdca2ba9802e5c1c334b2cd23e6cc2010a79346 (patch) | |
tree | 8405213cbbd92694e46dd529eb352032e1fbf398 | |
parent | 7acb945d443e26c7e51850c9c51321b0a5a7978a (diff) | |
download | haskell-7bdca2ba9802e5c1c334b2cd23e6cc2010a79346.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.c | 6 |
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 |