pkgsrc-WIP-changes archive

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

llvm-netbsd: Update to SVN r. 308219



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Jul 17 22:49:16 2017 +0200
Changeset:	bd90ee8205109279ab9201d2425c8f2740a84dbe

Modified Files:
	llvm-netbsd/Makefile.common
	llvm-netbsd/distinfo
Added Files:
	llvm-netbsd/patches/patch-unittests_Support_MemoryTest.cpp

Log Message:
llvm-netbsd: Update to SVN r. 308219

Catch up after upstream.

Two patches merged for sanitizers:
 - Add NetBSD support in platform_interceptors.h
   https://reviews.llvm.org/D35468
 - Introduce SANITIZER_NETBSD in sanitizer_platform.h
   https://reviews.llvm.org/D35467

Add temporarily a new patch for Memory test (MemoryTest.cpp).
It's work in progress on researching how to make it compatible with
NetBSD MPROTECT.

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=bd90ee8205109279ab9201d2425c8f2740a84dbe

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

diffstat:
 llvm-netbsd/Makefile.common                        |  2 +-
 llvm-netbsd/distinfo                               |  1 +
 .../patches/patch-unittests_Support_MemoryTest.cpp | 49 ++++++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletion(-)

diffs:
diff --git a/llvm-netbsd/Makefile.common b/llvm-netbsd/Makefile.common
index 2636cfa2d2..d8fe53c35a 100644
--- a/llvm-netbsd/Makefile.common
+++ b/llvm-netbsd/Makefile.common
@@ -19,7 +19,7 @@ CATEGORIES=	lang devel
 
 SVN_REPOSITORIES=	llvm
 SVN_REPO.llvm=		http://llvm.org/svn/llvm-project/llvm/trunk
-SVN_REVISION.llvm=	308147
+SVN_REVISION.llvm=	308219
 
 WRKSRC=			${WRKDIR}/llvm
 
diff --git a/llvm-netbsd/distinfo b/llvm-netbsd/distinfo
index e176119211..3dad377929 100644
--- a/llvm-netbsd/distinfo
+++ b/llvm-netbsd/distinfo
@@ -20,3 +20,4 @@ SHA1 (patch-lib_Support_Unix_Signals.inc) = 7e3fa55c7e32171454a065c6e38d8189ffdf
 SHA1 (patch-lib_Transforms_Instrumentation_AddressSanitizer.cpp) = 67eee29c4d8525b603e6b7c0a52278bdf3353687
 SHA1 (patch-lib_Transforms_Instrumentation_InstrProfiling.cpp) = 871b474f415d9dc468cc07477101f88d7a20868b
 SHA1 (patch-lib_Transforms_Instrumentation_MemorySanitizer.cpp) = 64fdbb55c77d5f5f73152d2f8daa28adfc428e40
+SHA1 (patch-unittests_Support_MemoryTest.cpp) = dc33f032b0e949fd7d4c4017ee1ac4937e65da84
diff --git a/llvm-netbsd/patches/patch-unittests_Support_MemoryTest.cpp b/llvm-netbsd/patches/patch-unittests_Support_MemoryTest.cpp
new file mode 100644
index 0000000000..fb45d5a666
--- /dev/null
+++ b/llvm-netbsd/patches/patch-unittests_Support_MemoryTest.cpp
@@ -0,0 +1,49 @@
+$NetBSD$
+
+--- unittests/Support/MemoryTest.cpp.orig	2017-07-17 18:00:15.718300975 +0000
++++ unittests/Support/MemoryTest.cpp
+@@ -13,7 +13,14 @@
+ #include <cstdlib>
+ 
+ #if defined(__NetBSD__)
+-#include <sys/mmap.h>
++#  include <sys/mman.h>
++#  if defined(PROT_MPROTECT)
++#    define NETBSD_WITH_MPROTECT 1
++#  else
++#    define NETBSD_WITH_MPROTECT 0
++#  endif
++#else
++#  define NETBSD_WITH_MPROTECT 0
+ #endif
+ 
+ using namespace llvm;
+@@ -36,7 +43,7 @@ protected:
+     case Memory::MF_WRITE:
+     case Memory::MF_READ|Memory::MF_WRITE:
+       return Memory::MF_READ|Memory::MF_WRITE;
+-#if !(defined(__NetBSD__) && defined(PROT_MPROTECT))
++#if !NETBSD_WITH_MPROTECT
+     case Memory::MF_READ|Memory::MF_EXEC:
+     case Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC:
+     case Memory::MF_EXEC:
+@@ -204,6 +211,7 @@ TEST_P(MappedMemoryTest, EnabledWrite) {
+   EXPECT_NE((void*)nullptr, M3.base());
+   EXPECT_LE(4U * sizeof(int), M3.size());
+ 
++  {FILE *fp = fopen("/tmp/log.txt", "a");fprintf(fp, "%s() %s:%d Flags=%x getTestableEquivalent(Flags)=%x protectMappedMemory()=%s\n", __func__, __FILE__, __LINE__, Flags, getTestableEquivalent(Flags), Memory::protectMappedMemory(M1, getTestableEquivalent(Flags)) ? "TRUE" : "FALSE");fflush(fp);fclose(fp);}
+   EXPECT_FALSE(Memory::protectMappedMemory(M1, getTestableEquivalent(Flags)));
+   EXPECT_FALSE(Memory::protectMappedMemory(M2, getTestableEquivalent(Flags)));
+   EXPECT_FALSE(Memory::protectMappedMemory(M3, getTestableEquivalent(Flags)));
+@@ -359,9 +367,11 @@ unsigned MemoryFlags[] = {
+ 			   Memory::MF_READ,
+ 			   Memory::MF_WRITE,
+ 			   Memory::MF_READ|Memory::MF_WRITE,
++#if !NETBSD_WITH_MPROTECT
+ 			   Memory::MF_EXEC,
+ 			   Memory::MF_READ|Memory::MF_EXEC,
+ 			   Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC
++#endif
+ 			 };
+ 
+ INSTANTIATE_TEST_CASE_P(AllocationTests,


Home | Main Index | Thread Index | Old Index