aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm5
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-05-07 18:37:17 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-05-07 18:37:40 +0200
commit6e34e3ebd65921fcc0ccb3135e81c4271b070f95 (patch)
tree20d28ed901eeb5d4232e8b1769e6949109e0e231 /main/llvm5
parent5023860f6e6a1c64f867956bc1c04c33069da113 (diff)
downloadaports-6e34e3ebd65921fcc0ccb3135e81c4271b070f95.tar.bz2
aports-6e34e3ebd65921fcc0ccb3135e81c4271b070f95.tar.xz
main/llvm5: fix build failure on aarch64
Diffstat (limited to 'main/llvm5')
-rw-r--r--main/llvm5/APKBUILD4
-rw-r--r--main/llvm5/fix-memory-mf_exec-on-aarch64.patch33
2 files changed, 36 insertions, 1 deletions
diff --git a/main/llvm5/APKBUILD b/main/llvm5/APKBUILD
index 784ec5f8ac..a9f5950076 100644
--- a/main/llvm5/APKBUILD
+++ b/main/llvm5/APKBUILD
@@ -20,6 +20,7 @@ source="https://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
0001-Disable-dynamic-lib-tests-for-musl-s-dlclose-is-noop.patch
fix-CheckAtomic.cmake.patch
dynamiclibrary-fix-build-musl.patch
+ fix-memory-mf_exec-on-aarch64.patch
"
builddir="$srcdir/$_pkgname-$pkgver.src"
options="!checkroot"
@@ -258,4 +259,5 @@ sha512sums="bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b
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
-5e61bbeafa64dd858cde2e85d3001f3abc0379f7ca057e9f49684eeabc8b4663f79136d688aff8a83a480b3e7cde76823d381e9dd6933187a36ff59da85532b2 dynamiclibrary-fix-build-musl.patch"
+5e61bbeafa64dd858cde2e85d3001f3abc0379f7ca057e9f49684eeabc8b4663f79136d688aff8a83a480b3e7cde76823d381e9dd6933187a36ff59da85532b2 dynamiclibrary-fix-build-musl.patch
+e6d925ddc71f9f2ce8a859ac519dad51cba99c07129e378a5388bb1dd2f7d5b9d5ed392e85267fd20043789c7460a7d705eb8f970b2d130edbf5a934e9505ac4 fix-memory-mf_exec-on-aarch64.patch"
diff --git a/main/llvm5/fix-memory-mf_exec-on-aarch64.patch b/main/llvm5/fix-memory-mf_exec-on-aarch64.patch
new file mode 100644
index 0000000000..644c77790a
--- /dev/null
+++ b/main/llvm5/fix-memory-mf_exec-on-aarch64.patch
@@ -0,0 +1,33 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+ Failing Tests (8):
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+ LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/lib/Support/Unix/Memory.inc
++++ b/lib/Support/Unix/Memory.inc
+@@ -54,7 +54,7 @@
+ llvm::sys::Memory::MF_EXEC:
+ return PROT_READ | PROT_WRITE | PROT_EXEC;
+ case llvm::sys::Memory::MF_EXEC:
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || (defined(__linux__) && defined(__aarch64__))
+ // On PowerPC, having an executable page that has no read permission
+ // can have unintended consequences. The function InvalidateInstruction-
+ // Cache uses instructions dcbf and icbi, both of which are treated by
+@@ -62,6 +62,7 @@
+ // executing these instructions will result in a segmentation fault.
+ // Somehow, this problem is not present on Linux, but it does happen
+ // on FreeBSD.
++ // The same problem is present even on aarch64 Linux (at least on musl).
+ return PROT_READ | PROT_EXEC;
+ #else
+ return PROT_EXEC;