From 7bdca2ba9802e5c1c334b2cd23e6cc2010a79346 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Fri, 29 Oct 2021 17:06:11 -0400 Subject: 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. --- rts/RtsSymbols.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rts/RtsSymbols.c') 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 /* _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 -- cgit v1.2.1