pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

llvm-all-in-one: Upgrade to SVN r. 318584



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Nov 18 05:05:39 2017 +0100
Changeset:	5681bdbbd9751b3e36b93457d4ce93a0a1b6eb24

Modified Files:
	llvm-all-in-one/Makefile
	llvm-all-in-one/distinfo
Removed Files:
	llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_IndirectionUtils.h
	llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h
	llvm-all-in-one/patches/patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp
	llvm-all-in-one/patches/patch-lib_ExecutionEngine_SectionMemoryManager.cpp
	llvm-all-in-one/patches/patch-lib_Support_Unix_Memory.inc
	llvm-all-in-one/patches/patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp
	llvm-all-in-one/patches/patch-unittests_Support_MemoryTest.cpp

Log Message:
llvm-all-in-one: Upgrade to SVN r. 318584

This version has fixed JIT upstream to work on NetBSD.

The Memory API still can be used in unportable way and so it can generate failures
during the execution of tests under PaX MPROTECT.

Temporarily drop MSan local patch that has to be redone.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5681bdbbd9751b3e36b93457d4ce93a0a1b6eb24

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 llvm-all-in-one/Makefile                           |  2 +-
 llvm-all-in-one/distinfo                           |  7 ---
 ...ude_llvm_ExecutionEngine_Orc_IndirectionUtils.h | 45 ---------------
 ...lvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h | 65 ----------------------
 ...patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp | 61 --------------------
 ...ch-lib_ExecutionEngine_SectionMemoryManager.cpp | 26 ---------
 .../patches/patch-lib_Support_Unix_Memory.inc      | 16 ------
 ..._Transforms_Instrumentation_MemorySanitizer.cpp | 47 ----------------
 .../patches/patch-unittests_Support_MemoryTest.cpp | 41 --------------
 9 files changed, 1 insertion(+), 309 deletions(-)

diffs:
diff --git a/llvm-all-in-one/Makefile b/llvm-all-in-one/Makefile
index 29522c6440..e71d553ab3 100644
--- a/llvm-all-in-one/Makefile
+++ b/llvm-all-in-one/Makefile
@@ -4,7 +4,7 @@ LLVM_VERSION=	6.0.0
 
 CATEGORIES=	lang devel
 
-LLVM_SVN_REV=		315927
+LLVM_SVN_REV=		318584
 
 SVN_REPOSITORIES=		llvm
 SVN_REPO.llvm=			http://llvm.org/svn/llvm-project/llvm/trunk
diff --git a/llvm-all-in-one/distinfo b/llvm-all-in-one/distinfo
index ad6e2d13d6..239096cbfd 100644
--- a/llvm-all-in-one/distinfo
+++ b/llvm-all-in-one/distinfo
@@ -1,10 +1,3 @@
 $NetBSD$
 
-SHA1 (patch-include_llvm_ExecutionEngine_Orc_IndirectionUtils.h) = 22060ef02e83a7ea9cada158866910d0bb782fcf
-SHA1 (patch-include_llvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h) = e2f96f49e1d5afa1e1cbc3cfc98a81b19f0ce230
-SHA1 (patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp) = b24a57af1c6fea12f0dd252ccfd23ce6945f307d
-SHA1 (patch-lib_ExecutionEngine_SectionMemoryManager.cpp) = f3498378be67171ad4d1a211f6172d5f2f8248f7
-SHA1 (patch-lib_Support_Unix_Memory.inc) = 8b9b220178e94f17d1a66637277e07f887db9f79
 SHA1 (patch-lib_Transforms_Instrumentation_InstrProfiling.cpp) = 871b474f415d9dc468cc07477101f88d7a20868b
-SHA1 (patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp) = 64fdbb55c77d5f5f73152d2f8daa28adfc428e40
-SHA1 (patch-unittests_Support_MemoryTest.cpp) = 2b70513d36138d37eda5636c07b195e1ff0c9097
diff --git a/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_IndirectionUtils.h b/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_IndirectionUtils.h
deleted file mode 100644
index 81e625588e..0000000000
--- a/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_IndirectionUtils.h
+++ /dev/null
@@ -1,45 +0,0 @@
-$NetBSD$
-
---- include/llvm/ExecutionEngine/Orc/IndirectionUtils.h.orig	2017-10-02 15:23:26.164151727 +0000
-+++ include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
-@@ -168,15 +168,16 @@ public:
-   LocalJITCompileCallbackManager(JITTargetAddress ErrorHandlerAddress)
-       : JITCompileCallbackManager(ErrorHandlerAddress) {
-     /// Set up the resolver block.
--    std::error_code EC;
--    ResolverBlock = sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--        TargetT::ResolverCodeSize, nullptr,
--        sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--    assert(!EC && "Failed to allocate resolver block");
-+    std::string Err;
-+    ResolverBlock = sys::OwningMemoryBlock(
-+        sys::Memory::AllocateRWX(TargetT::ResolverCodeSize, nullptr, &Err));
-+    if (!ResolverBlock.base())
-+      report_fatal_error("Can't allocate enough memory: " + Err);
- 
-     TargetT::writeResolverCode(static_cast<uint8_t *>(ResolverBlock.base()),
-                                &reenter, this);
- 
-+    std::error_code EC;
-     EC = sys::Memory::protectMappedMemory(ResolverBlock.getMemoryBlock(),
-                                           sys::Memory::MF_READ |
-                                               sys::Memory::MF_EXEC);
-@@ -195,13 +196,11 @@ private:
-   Error grow() override {
-     assert(this->AvailableTrampolines.empty() && "Growing prematurely?");
- 
--    std::error_code EC;
--    auto TrampolineBlock =
--        sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--            sys::Process::getPageSize(), nullptr,
--            sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--    if (EC)
--      return errorCodeToError(EC);
-+    std::string Err;
-+    auto TrampolineBlock = sys::OwningMemoryBlock(
-+        sys::Memory::AllocateRWX(sys::Process::getPageSize(), nullptr, &Err));
-+    if (!TrampolineBlock.base())
-+      report_fatal_error("Can't allocate enough memory: " + Err);
- 
-     unsigned NumTrampolines =
-         (sys::Process::getPageSize() - TargetT::PointerSize) /
diff --git a/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h b/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h
deleted file mode 100644
index e9a6074352..0000000000
--- a/llvm-all-in-one/patches/patch-include_llvm_ExecutionEngine_Orc_OrcRemoteTargetServer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-$NetBSD$
-
---- include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h.orig	2017-07-05 18:41:32.000000000 +0000
-+++ include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
-@@ -115,11 +115,10 @@ private:
-     }
- 
-     Error allocate(void *&Addr, size_t Size, uint32_t Align) {
--      std::error_code EC;
--      sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(
--          Size, nullptr, sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC);
--      if (EC)
--        return errorCodeToError(EC);
-+      std::string Err;
-+      sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, nullptr, &Err);
-+      if (!MB.base())
-+        report_fatal_error("Can't allocate enough memory: " + Err);
- 
-       Addr = MB.base();
-       assert(Allocs.find(MB.base()) == Allocs.end() && "Duplicate alloc");
-@@ -277,12 +276,11 @@ private:
-   }
- 
-   Error handleEmitResolverBlock() {
--    std::error_code EC;
--    ResolverBlock = sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--        TargetT::ResolverCodeSize, nullptr,
--        sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--    if (EC)
--      return errorCodeToError(EC);
-+    std::string Err;
-+    ResolverBlock = sys::OwningMemoryBlock(
-+        sys::Memory::AllocateRWX(TargetT::ResolverCodeSize, nullptr, &Err));
-+    if (!ResolverBlock.base())
-+      report_fatal_error("Can't allocate enough memory: " + Err);
- 
-     TargetT::writeResolverCode(static_cast<uint8_t *>(ResolverBlock.base()),
-                                &reenter, this);
-@@ -293,13 +291,11 @@ private:
-   }
- 
-   Expected<std::tuple<JITTargetAddress, uint32_t>> handleEmitTrampolineBlock() {
--    std::error_code EC;
--    auto TrampolineBlock =
--        sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--            sys::Process::getPageSize(), nullptr,
--            sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--    if (EC)
--      return errorCodeToError(EC);
-+    std::string Err;
-+    auto TrampolineBlock = sys::OwningMemoryBlock(
-+        sys::Memory::AllocateRWX(sys::Process::getPageSize(), nullptr, &Err));
-+    if (!TrampolineBlock.base())
-+      report_fatal_error("Can't allocate enough memory: " + Err);
- 
-     uint32_t NumTrampolines =
-         (sys::Process::getPageSize() - TargetT::PointerSize) /
-@@ -309,6 +305,7 @@ private:
-     TargetT::writeTrampolines(TrampolineMem, ResolverBlock.base(),
-                               NumTrampolines);
- 
-+    std::error_code EC;
-     EC = sys::Memory::protectMappedMemory(TrampolineBlock.getMemoryBlock(),
-                                           sys::Memory::MF_READ |
-                                               sys::Memory::MF_EXEC);
diff --git a/llvm-all-in-one/patches/patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp b/llvm-all-in-one/patches/patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp
deleted file mode 100644
index af53d8481a..0000000000
--- a/llvm-all-in-one/patches/patch-lib_ExecutionEngine_Orc_OrcABISupport.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-$NetBSD$
-
---- lib/ExecutionEngine/Orc/OrcABISupport.cpp.orig	2017-07-05 18:38:00.000000000 +0000
-+++ lib/ExecutionEngine/Orc/OrcABISupport.cpp
-@@ -154,13 +154,11 @@ Error OrcAArch64::emitIndirectStubsBlock
-   unsigned NumStubs = (NumPages * PageSize) / StubSize;
- 
-   // Allocate memory for stubs and pointers in one call.
--  std::error_code EC;
--  auto StubsMem = sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--      2 * NumPages * PageSize, nullptr,
--      sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--
--  if (EC)
--    return errorCodeToError(EC);
-+  std::string Err;
-+  auto StubsMem = sys::OwningMemoryBlock(
-+      sys::Memory::AllocateRWX(2 * NumPages * PageSize, nullptr, &Err));
-+  if (!StubsMem.base())
-+    report_fatal_error("Can't allocate enough memory: " + Err);
- 
-   // Create separate MemoryBlocks representing the stubs and pointers.
-   sys::MemoryBlock StubsBlock(StubsMem.base(), NumPages * PageSize);
-@@ -236,13 +234,11 @@ Error OrcX86_64_Base::emitIndirectStubsB
-   unsigned NumStubs = (NumPages * PageSize) / StubSize;
- 
-   // Allocate memory for stubs and pointers in one call.
--  std::error_code EC;
--  auto StubsMem = sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--      2 * NumPages * PageSize, nullptr,
--      sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--
--  if (EC)
--    return errorCodeToError(EC);
-+  std::string Err;
-+  auto StubsMem = sys::OwningMemoryBlock(
-+      sys::Memory::AllocateRWX(2 * NumPages * PageSize, nullptr, &Err));
-+  if (!StubsMem.base())
-+    report_fatal_error("Can't allocate enough memory: " + Err);
- 
-   // Create separate MemoryBlocks representing the stubs and pointers.
-   sys::MemoryBlock StubsBlock(StubsMem.base(), NumPages * PageSize);
-@@ -504,13 +500,11 @@ Error OrcI386::emitIndirectStubsBlock(In
-   unsigned NumStubs = (NumPages * PageSize) / StubSize;
- 
-   // Allocate memory for stubs and pointers in one call.
--  std::error_code EC;
--  auto StubsMem = sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
--      2 * NumPages * PageSize, nullptr,
--      sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
--
--  if (EC)
--    return errorCodeToError(EC);
-+  std::string Err;
-+  auto StubsMem = sys::OwningMemoryBlock(
-+      sys::Memory::AllocateRWX(2 * NumPages * PageSize, nullptr, &Err));
-+  if (!StubsMem.base())
-+    report_fatal_error("Can't allocate enough memory: " + Err);
- 
-   // Create separate MemoryBlocks representing the stubs and pointers.
-   sys::MemoryBlock StubsBlock(StubsMem.base(), NumPages * PageSize);
diff --git a/llvm-all-in-one/patches/patch-lib_ExecutionEngine_SectionMemoryManager.cpp b/llvm-all-in-one/patches/patch-lib_ExecutionEngine_SectionMemoryManager.cpp
deleted file mode 100644
index e3b70848d8..0000000000
--- a/llvm-all-in-one/patches/patch-lib_ExecutionEngine_SectionMemoryManager.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD$
-
---- lib/ExecutionEngine/SectionMemoryManager.cpp.orig	2017-07-05 18:38:00.000000000 +0000
-+++ lib/ExecutionEngine/SectionMemoryManager.cpp
-@@ -83,16 +83,11 @@ uint8_t *SectionMemoryManager::allocateS
-   //
-   // FIXME: Initialize the Near member for each memory group to avoid
-   // interleaving.
--  std::error_code ec;
--  sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(RequiredSize,
--                                                          &MemGroup.Near,
--                                                          sys::Memory::MF_READ |
--                                                            sys::Memory::MF_WRITE,
--                                                          ec);
--  if (ec) {
--    // FIXME: Add error propagation to the interface.
--    return nullptr;
--  }
-+  std::string Err;
-+  sys::MemoryBlock MB =
-+      sys::Memory::AllocateRWX(RequiredSize, &MemGroup.Near, &Err);
-+  if (!MB.base())
-+    report_fatal_error("Can't allocate enough memory: " + Err);
- 
-   // Save this address as the basis for our next request
-   MemGroup.Near = MB;
diff --git a/llvm-all-in-one/patches/patch-lib_Support_Unix_Memory.inc b/llvm-all-in-one/patches/patch-lib_Support_Unix_Memory.inc
deleted file mode 100644
index 98a84ca889..0000000000
--- a/llvm-all-in-one/patches/patch-lib_Support_Unix_Memory.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
---- lib/Support/Unix/Memory.inc.orig	2017-07-05 18:38:14.000000000 +0000
-+++ lib/Support/Unix/Memory.inc
-@@ -102,6 +102,11 @@ Memory::allocateMappedMemory(size_t NumB
- 
-   int Protect = getPosixProtectionFlags(PFlags);
- 
-+#if defined(__NetBSD__) && defined(PROT_MPROTECT)
-+  // This is required in order to grant additional protection bits
-+  Protect |= PROT_MPROTECT(PROT_READ | PROT_WRITE | PROT_EXEC);
-+#endif
-+
-   // Use any near hint and the page size to set a page-aligned starting address
-   uintptr_t Start = NearBlock ? reinterpret_cast<uintptr_t>(NearBlock->base()) +
-                                       NearBlock->size() : 0;
diff --git a/llvm-all-in-one/patches/patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp b/llvm-all-in-one/patches/patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp
deleted file mode 100644
index 4ef2227185..0000000000
--- a/llvm-all-in-one/patches/patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-$NetBSD$
-
---- lib/Transforms/Instrumentation/MemorySanitizer.cpp.orig	2017-06-12 00:24:36.000000000 +0000
-+++ lib/Transforms/Instrumentation/MemorySanitizer.cpp
-@@ -280,6 +280,14 @@ static const MemoryMapParams FreeBSD_X86
-   0x380000000000,  // OriginBase
- };
- 
-+// x86_64 NetBSD
-+static const MemoryMapParams NetBSD_X86_64_MemoryMapParams = {
-+  0xc00000000000,  // AndMask
-+  0x200000000000,  // XorMask
-+  0x100000000000,  // ShadowBase
-+  0x380000000000,  // OriginBase
-+};
-+
- static const PlatformMemoryMapParams Linux_X86_MemoryMapParams = {
-   &Linux_I386_MemoryMapParams,
-   &Linux_X86_64_MemoryMapParams,
-@@ -305,6 +313,11 @@ static const PlatformMemoryMapParams Fre
-   &FreeBSD_X86_64_MemoryMapParams,
- };
- 
-+static const PlatformMemoryMapParams NetBSD_X86_MemoryMapParams = {
-+  nullptr,
-+  &NetBSD_X86_64_MemoryMapParams,
-+};
-+
- /// \brief An instrumentation pass implementing detection of uninitialized
- /// reads.
- ///
-@@ -515,6 +528,15 @@ bool MemorySanitizer::doInitialization(M
-           report_fatal_error("unsupported architecture");
-       }
-       break;
-+    case Triple::NetBSD:
-+      switch (TargetTriple.getArch()) {
-+        case Triple::x86_64:
-+          MapParams = NetBSD_X86_MemoryMapParams.bits64;
-+          break;
-+        default:
-+          report_fatal_error("unsupported architecture");
-+      }
-+      break;
-     case Triple::Linux:
-       switch (TargetTriple.getArch()) {
-         case Triple::x86_64:
diff --git a/llvm-all-in-one/patches/patch-unittests_Support_MemoryTest.cpp b/llvm-all-in-one/patches/patch-unittests_Support_MemoryTest.cpp
deleted file mode 100644
index b6dfc756c4..0000000000
--- a/llvm-all-in-one/patches/patch-unittests_Support_MemoryTest.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD$
-
---- unittests/Support/MemoryTest.cpp.orig	2017-07-05 18:41:47.000000000 +0000
-+++ unittests/Support/MemoryTest.cpp
-@@ -33,9 +33,8 @@ protected:
-     case Memory::MF_READ|Memory::MF_WRITE:
-       return Memory::MF_READ|Memory::MF_WRITE;
-     case Memory::MF_READ|Memory::MF_EXEC:
--    case Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC:
-     case Memory::MF_EXEC:
--      return Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC;
-+      return Memory::MF_READ|Memory::MF_EXEC;
-     }
-     // Default in case values are added to the enum, as required by some compilers
-     return Memory::MF_READ|Memory::MF_WRITE;
-@@ -180,6 +179,9 @@ TEST_P(MappedMemoryTest, MultipleWrite) 
- }
- 
- TEST_P(MappedMemoryTest, EnabledWrite) {
-+  if (Flags & Memory::MF_EXEC)
-+    return;
-+
-   std::error_code EC;
-   MemoryBlock M1 = Memory::allocateMappedMemory(2 * sizeof(int), nullptr, Flags,
-                                                 EC);
-@@ -349,13 +351,13 @@ TEST_P(MappedMemoryTest, UnalignedNear) 
- 
- // Note that Memory::MF_WRITE is not supported exclusively across
- // operating systems and architectures and can imply MF_READ|MF_WRITE
-+// RWX mapping is not allowed on all operating systems (W^X restrictions)
- unsigned MemoryFlags[] = {
- 			   Memory::MF_READ,
- 			   Memory::MF_WRITE,
- 			   Memory::MF_READ|Memory::MF_WRITE,
- 			   Memory::MF_EXEC,
--			   Memory::MF_READ|Memory::MF_EXEC,
--			   Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC
-+			   Memory::MF_READ|Memory::MF_EXEC
- 			 };
- 
- INSTANTIATE_TEST_CASE_P(AllocationTests,


Home | Main Index | Thread Index | Old Index