aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm5
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
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')
-rw-r--r--main/llvm5/APKBUILD4
-rw-r--r--main/llvm5/dynamiclibrary-fix-build-musl.patch40
-rw-r--r--main/llvm5/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch33
-rw-r--r--main/llvm5/silent-amdgpu-test-failing.patch40
4 files changed, 43 insertions, 74 deletions
diff --git a/main/llvm5/APKBUILD b/main/llvm5/APKBUILD
index f900f9b7df..d51f99ab04 100644
--- a/main/llvm5/APKBUILD
+++ b/main/llvm5/APKBUILD
@@ -19,6 +19,7 @@ source="https://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
disable-FileSystemTest.CreateDir-perms-assert.patch
0001-Disable-dynamic-lib-tests-for-musl-s-dlclose-is-noop.patch
fix-CheckAtomic.cmake.patch
+ dynamiclibrary-fix-build-musl.patch
"
builddir="$srcdir/$_pkgname-$pkgver.src"
options="!checkroot"
@@ -247,4 +248,5 @@ sha512sums="e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87
6d1a716e5aa24e6b9a3acf4cc11e2504b1b01abf574074e9e5617b991de87d5e4e687eb18e85e73d5e632568afe2fc357771c4c96f9e136502071991496fb78c cmake-fix-libLLVM-name.patch
49c47f125014b60d0ea7870f981a2c1708ad705793f89287ed846ee881a837a4dc0170bf467e03f2ef56177473128945287749ac80dc2d13cfabcf8b929ba58a disable-FileSystemTest.CreateDir-perms-assert.patch
695502bd3b5454c2f5630c59a8cf5f8aeb0deac16a76a8a4df34849e1e35c12ed4234572a320fe4c7e96f974f572f429eb816c5aa3dcfb17057f550eac596495 0001-Disable-dynamic-lib-tests-for-musl-s-dlclose-is-noop.patch
-3bcfeccc1f14567f99029a131b1289290226d48855857f2eb6a251e041981a8b8b2d7965099df16ebf0a406e48130679f97235ef3f3524577413bb51cf40e613 fix-CheckAtomic.cmake.patch"
+3bcfeccc1f14567f99029a131b1289290226d48855857f2eb6a251e041981a8b8b2d7965099df16ebf0a406e48130679f97235ef3f3524577413bb51cf40e613 fix-CheckAtomic.cmake.patch
+5e61bbeafa64dd858cde2e85d3001f3abc0379f7ca057e9f49684eeabc8b4663f79136d688aff8a83a480b3e7cde76823d381e9dd6933187a36ff59da85532b2 dynamiclibrary-fix-build-musl.patch"
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
diff --git a/main/llvm5/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch b/main/llvm5/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch
deleted file mode 100644
index d5d7f07b5e..0000000000
--- a/main/llvm5/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From d12ecb83d01dcb580dd94f4d57828f33d3eb4c35 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Thu, 18 Feb 2016 15:33:21 +0100
-Subject: [PATCH 3/3] Fix DynamicLibrary to build with musl libc
-
-stdin/out/err is part of the libc and not the kernel so we check for the
-specific libc that does the unexpected instead of linux.
-
-This is needed for making it build with musl libc.
----
- lib/Support/DynamicLibrary.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
-index 9a7aeb5..0c1c8f8 100644
---- a/lib/Support/DynamicLibrary.cpp
-+++ b/lib/Support/DynamicLibrary.cpp
-@@ -140,10 +140,10 @@ void* DynamicLibrary::SearchForAddressOfSymbol(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
-+// On GNU libc 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);
---
-2.7.3
-
diff --git a/main/llvm5/silent-amdgpu-test-failing.patch b/main/llvm5/silent-amdgpu-test-failing.patch
deleted file mode 100644
index e20cee595e..0000000000
--- a/main/llvm5/silent-amdgpu-test-failing.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-See https://bugs.llvm.org//show_bug.cgi?id=31610
-
---- a/test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll
-+++ b/test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll
-@@ -2,5 +2,6 @@
- ; check llc does not crash for invalid opencl version metadata
-
- ; CHECK: { amd.MDVersion: [ 2, 0 ] }
-+; XFAIL: *
-
- !opencl.ocl.version = !{}
---- a/test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll
-+++ b/test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll
-@@ -2,6 +2,7 @@
- ; check llc does not crash for invalid opencl version metadata
-
- ; CHECK: { amd.MDVersion: [ 2, 0 ] }
-+; XFAIL: *
-
- !opencl.ocl.version = !{!0}
- !0 = !{}
---- a/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
-+++ b/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
-@@ -2,6 +2,7 @@
- ; check llc does not crash for invalid opencl version metadata
-
- ; CHECK: { amd.MDVersion: [ 2, 0 ] }
-+; XFAIL: *
-
- !opencl.ocl.version = !{!0}
- !0 = !{i32 1}
---- a/test/CodeGen/AMDGPU/runtime-metadata.ll
-+++ b/test/CodeGen/AMDGPU/runtime-metadata.ll
-@@ -1,5 +1,6 @@
- ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s
- ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -amdgpu-dump-rtmd -amdgpu-check-rtmd-parser %s -o - 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=PARSER %s
-+; XFAIL: *
-
- %struct.A = type { i8, float }
- %opencl.image1d_t = type opaque