diff options
author | Dimitry Andric <dimitry@andric.com> | 2017-06-05 11:22:18 +0000 |
---|---|---|
committer | Dimitry Andric <dimitry@andric.com> | 2017-06-05 11:22:18 +0000 |
commit | f5d486f43d861f938f381d440a9a21383b3bb36f (patch) | |
tree | 8b1a8379c923493c47c56ac00a3904dc991cc315 /llvm/lib/Support/Unix | |
parent | ba94c7bde1a0d1f85e3020cb84d6c52b8609168a (diff) | |
download | bcm5719-llvm-f5d486f43d861f938f381d440a9a21383b3bb36f.tar.gz bcm5719-llvm-f5d486f43d861f938f381d440a9a21383b3bb36f.zip |
Fix building DynamicLibrary.cpp with musl libc
Summary:
The workaround added in rL301240 for stderr/out/in symbols being both
macros and globals is only necessary for glibc, and it does not compile
with musl libc. Alpine Linux has had the following fix for it:
https://git.alpinelinux.org/cgit/aports/plain/main/llvm4/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch
Adapt the fix in our DynamicLibrary.inc for Unix.
Reviewers: marsupial, chandlerc, krytarowski
Reviewed By: krytarowski
Subscribers: srhines, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D33883
llvm-svn: 304707
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/DynamicLibrary.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/DynamicLibrary.inc b/llvm/lib/Support/Unix/DynamicLibrary.inc index a0526fa2c1b..30972ffd0ef 100644 --- a/llvm/lib/Support/Unix/DynamicLibrary.inc +++ b/llvm/lib/Support/Unix/DynamicLibrary.inc @@ -101,10 +101,10 @@ static void *DoSearch(const char* SymbolName) { #define EXPLICIT_SYMBOL(SYM) \ if (!strcmp(SymbolName, #SYM)) return &SYM -// On linux we have a weird situation. The stderr/out/in symbols are both +// Under glibc we have a weird situation. The stderr/out/in symbols are both // macros and global variables because of standards requirements. So, we // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first. -#if defined(__linux__) and !defined(__ANDROID__) +#if defined(__GLIBC__) { EXPLICIT_SYMBOL(stderr); EXPLICIT_SYMBOL(stdout); |