mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 08:29:43 +00:00
[DynamicLibrary] Fix build on musl libc
Summary: On musl libc, stdin/out/err are defined as `FILE* const` globals, and their address is not implicitly convertible to void *, or at least gcc 6 doesn't allow it, giving errors like: ``` error: cannot initialize return object of type 'void *' with an rvalue of type 'FILE *const *' (aka '_IO_FILE *const *') EXPLICIT_SYMBOL(stderr); ^~~~~~~~~~~~~~~~~~~~~~~ ``` Add an explicit cast to fix that problem. Reviewers: marsupial, krytarowski, dim Reviewed By: dim Differential Revision: https://reviews.llvm.org/D39297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
228f43d82f
commit
ae8900a883
@ -71,7 +71,7 @@ void *DynamicLibrary::HandleSet::DLSym(void *Handle, const char *Symbol) {
|
||||
// Must declare the symbols in the global namespace.
|
||||
static void *DoSearch(const char* SymbolName) {
|
||||
#define EXPLICIT_SYMBOL(SYM) \
|
||||
extern void *SYM; if (!strcmp(SymbolName, #SYM)) return &SYM
|
||||
extern void *SYM; if (!strcmp(SymbolName, #SYM)) return (void*)&SYM
|
||||
|
||||
// If this is darwin, it has some funky issues, try to solve them here. Some
|
||||
// important symbols are marked 'private external' which doesn't allow
|
||||
|
Loading…
Reference in New Issue
Block a user