aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm5/dynamiclibrary-fix-build-musl.patch
diff options
context:
space:
mode:
authorxentec <xentec@aix0.eu>2017-11-04 09:59:05 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-11-14 18:42:44 +0100
commitb4767fa4037857bb3393650e351e69d16a5d7e56 (patch)
treec8dfa1e01aa13f45a2ca341f19f5aae3f8b7f988 /main/llvm5/dynamiclibrary-fix-build-musl.patch
parentd637a56c7be3643382f9f2657e98b59cee262ec3 (diff)
downloadaports-b4767fa4037857bb3393650e351e69d16a5d7e56.tar.bz2
aports-b4767fa4037857bb3393650e351e69d16a5d7e56.tar.xz
main/llvm5: backport DynamicLibrary fix
[https://reviews.llvm.org/D39297] as per @martell's suggestion in https://github.com/alpinelinux/aports/pull/2393#issuecomment-341690423
Diffstat (limited to 'main/llvm5/dynamiclibrary-fix-build-musl.patch')
-rw-r--r--main/llvm5/dynamiclibrary-fix-build-musl.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/main/llvm5/dynamiclibrary-fix-build-musl.patch b/main/llvm5/dynamiclibrary-fix-build-musl.patch
new file mode 100644
index 0000000000..a9bbe168e9
--- /dev/null
+++ b/main/llvm5/dynamiclibrary-fix-build-musl.patch
@@ -0,0 +1,40 @@
+From ae8900a8833835309aecb0a3d947c2ae46fd86c3 Mon Sep 17 00:00:00 2001
+From: Keno Fischer <keno@alumni.harvard.edu>
+Date: Thu, 26 Oct 2017 16:44:13 +0000
+Subject: [PATCH] [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
+---
+ lib/Support/Unix/DynamicLibrary.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index f05103ccd1e..029451f347e 100644
+--- a/lib/Support/Unix/DynamicLibrary.inc
++++ b/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