Skip to content
Snippets Groups Projects
Commit e2b60be8 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

rts: Consolidate RtsSymbols from libc

Previously (9ebda74e) `environ` was
added to `RtsSymbols` to ensure that environment was correctly
propagated when statically linking. However, this introduced #20577
since platforms are inconsistent in whether they provide a prototype for
`environ`. I fixed this by providing a prototype but while doing so
dropped symbol-table entry, presumably thinking that it was redundant
due to the entry in the mingw-specific table.

Here I reintroduce the symbol table entry for `environ` and move libc
symbols shared by Windows and Linux into a new macro,
`RTS_LIBC_SYMBOLS`, avoiding this potential confusion.
parent 52a4f5ab
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,6 @@ extern char **environ;
SymI_HasProto(signal_handlers) \
SymI_HasProto(stg_sig_install) \
SymI_HasProto(rtsTimerSignal) \
SymI_HasProto_redirect(atexit, atexit, STRENGTH_STRONG) /* See Note [Strong symbols] */ \
SymI_NeedsDataProto(nocldstop)
#endif
......@@ -166,7 +165,6 @@ extern char **environ;
SymI_HasProto(stg_asyncDoProczh) \
SymI_HasProto(rts_InstallConsoleEvent) \
SymI_HasProto(rts_ConsoleHandlerDone) \
SymI_HasProto(atexit) \
RTS_WIN32_ONLY(SymI_NeedsProto(___chkstk_ms)) \
RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
RTS_WIN32_ONLY(SymI_HasProto(_imp___environ)) \
......@@ -1071,6 +1069,11 @@ extern char **environ;
#define RTS_LIBGCC_SYMBOLS
#endif
// Symbols defined by libc
#define RTS_LIBC_SYMBOLS \
SymI_HasProto_redirect(atexit, atexit, STRENGTH_STRONG) /* See Note [Strong symbols] */ \
SymI_HasProto(environ)
#if !defined(DYNAMIC) && defined(linux_HOST_OS)
// we need these for static musl builds. However when
// linking shared objects (DLLs) this will fail, hence
......@@ -1108,6 +1111,7 @@ RTS_POSIX_ONLY_SYMBOLS
RTS_MINGW_ONLY_SYMBOLS
RTS_DARWIN_ONLY_SYMBOLS
RTS_OPENBSD_ONLY_SYMBOLS
RTS_LIBC_SYMBOLS
RTS_LIBGCC_SYMBOLS
RTS_FINI_ARRAY_SYMBOLS
RTS_LIBFFI_SYMBOLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment