summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorKeno Fischer <keno@alumni.harvard.edu>2017-10-26 16:44:13 +0000
committerKeno Fischer <keno@alumni.harvard.edu>2017-10-26 16:44:13 +0000
commit1c43ad09650adcb66525f8e074e708691b3c841b (patch)
tree75404c86279b17e9fbf37f4507c18ea1652263d3 /llvm/lib/Support/Unix
parent049ed12df7f2a575355365dcedbd0dfe0737adfa (diff)
downloadbcm5719-llvm-1c43ad09650adcb66525f8e074e708691b3c841b.tar.gz
bcm5719-llvm-1c43ad09650adcb66525f8e074e708691b3c841b.zip
[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 llvm-svn: 316672
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/DynamicLibrary.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/DynamicLibrary.inc b/llvm/lib/Support/Unix/DynamicLibrary.inc
index f05103ccd1e..029451f347e 100644
--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
+++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
@@ -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
OpenPOWER on IntegriCloud