Fri May 5 18:12:24 2017 UTC ()
Don't explicit disable tests. Merge two upstream patches for fixing
build and runtime errors in the test suite on NetBSD.


(joerg)
diff -r1.19 -r1.20 pkgsrc/lang/llvm/Makefile
diff -r1.7 -r1.8 pkgsrc/lang/llvm/distinfo
diff -r0 -r1.1 pkgsrc/lang/llvm/patches/patch-lib_Support_Unix_Path.inc
diff -r0 -r1.1 pkgsrc/lang/llvm/patches/patch-utils_unittest_googletest_include_gtest_internal_gtest-port-arch.h
diff -r0 -r1.1 pkgsrc/lang/llvm/patches/patch-utils_unittest_googletest_include_gtest_internal_gtest-port.h

cvs diff -r1.19 -r1.20 pkgsrc/lang/llvm/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/llvm/Makefile 2017/05/03 08:38:43 1.19
+++ pkgsrc/lang/llvm/Makefile 2017/05/05 18:12:24 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.19 2017/05/03 08:38:43 jperkin Exp $ 1# $NetBSD: Makefile,v 1.20 2017/05/05 18:12:24 joerg Exp $
2# 2#
3# when updating this, please also update: 3# when updating this, please also update:
4# devel/include-what-you-use 4# devel/include-what-you-use
5# devel/lldb 5# devel/lldb
6# devel/polly 6# devel/polly
7# lang/clang 7# lang/clang
8# lang/clang-static-analyzer 8# lang/clang-static-analyzer
9# lang/libLLVM 9# lang/libLLVM
10# lang/libunwind 10# lang/libunwind
11 11
12DISTNAME= llvm-4.0.0.src 12DISTNAME= llvm-4.0.0.src
13PKGNAME= ${DISTNAME:S/.src//} 13PKGNAME= ${DISTNAME:S/.src//}
14PKGREVISION= 1 14PKGREVISION= 1
@@ -24,27 +24,26 @@ LICENSE= modified-bsd @@ -24,27 +24,26 @@ LICENSE= modified-bsd
24USE_LANGUAGES= c c++11 24USE_LANGUAGES= c c++11
25USE_CMAKE= yes 25USE_CMAKE= yes
26GCC_REQD+= 4.8 26GCC_REQD+= 4.8
27PYTHON_FOR_BUILD_ONLY= yes 27PYTHON_FOR_BUILD_ONLY= yes
28 28
29CONFIGURE_DIRS= ${WRKDIR}/build 29CONFIGURE_DIRS= ${WRKDIR}/build
30CMAKE_ARG_PATH= ${WRKSRC} 30CMAKE_ARG_PATH= ${WRKSRC}
31 31
32CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release 32CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
33CMAKE_ARGS+= -DCMAKE_C_COMPILER=gcc 33CMAKE_ARGS+= -DCMAKE_C_COMPILER=gcc
34CMAKE_ARGS+= -DCMAKE_CXX_COMPILER=g++ 34CMAKE_ARGS+= -DCMAKE_CXX_COMPILER=g++
35CMAKE_ARGS+= -DCMAKE_CXX_LINK_FLAGS=${LDFLAGS:Q} 35CMAKE_ARGS+= -DCMAKE_CXX_LINK_FLAGS=${LDFLAGS:Q}
36CMAKE_ARGS+= -DLLVM_BUILD_LLVM_DYLIB=ON 36CMAKE_ARGS+= -DLLVM_BUILD_LLVM_DYLIB=ON
37CMAKE_ARGS+= -DLLVM_INCLUDE_TESTS=OFF 
38CMAKE_ARGS+= -DLLVM_INSTALL_UTILS=ON 37CMAKE_ARGS+= -DLLVM_INSTALL_UTILS=ON
39CMAKE_ARGS+= -DLLVM_LINK_LLVM_DYLIB=ON 38CMAKE_ARGS+= -DLLVM_LINK_LLVM_DYLIB=ON
40 39
41CMAKE_ARGS.Darwin+= -DCMAKE_LIBTOOL=/usr/bin/libtool 40CMAKE_ARGS.Darwin+= -DCMAKE_LIBTOOL=/usr/bin/libtool
42 41
43CHECK_PORTABILITY_SKIP= utils/buildit/build_llvm 42CHECK_PORTABILITY_SKIP= utils/buildit/build_llvm
44 43
45# XXX perl is not added as a tool as it does not seem to be required 44# XXX perl is not added as a tool as it does not seem to be required
46REPLACE_PERL+= utils/GenLibDeps.pl 45REPLACE_PERL+= utils/GenLibDeps.pl
47REPLACE_PERL+= utils/UpdateCMakeLists.pl 46REPLACE_PERL+= utils/UpdateCMakeLists.pl
48REPLACE_PERL+= utils/codegen-diff 47REPLACE_PERL+= utils/codegen-diff
49REPLACE_PERL+= utils/findsym.pl 48REPLACE_PERL+= utils/findsym.pl
50REPLACE_PERL+= utils/llvm-native-gxx 49REPLACE_PERL+= utils/llvm-native-gxx

cvs diff -r1.7 -r1.8 pkgsrc/lang/llvm/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/llvm/distinfo 2017/03/19 19:01:48 1.7
+++ pkgsrc/lang/llvm/distinfo 2017/05/05 18:12:24 1.8
@@ -1,10 +1,13 @@ @@ -1,10 +1,13 @@
1$NetBSD: distinfo,v 1.7 2017/03/19 19:01:48 adam Exp $ 1$NetBSD: distinfo,v 1.8 2017/05/05 18:12:24 joerg Exp $
2 2
3SHA1 (llvm-4.0.0.src.tar.xz) = aee4524e2407f9fe5afc6f70c753180b907011d0 3SHA1 (llvm-4.0.0.src.tar.xz) = aee4524e2407f9fe5afc6f70c753180b907011d0
4RMD160 (llvm-4.0.0.src.tar.xz) = 468ae2502ba523b35c5e8340724ddaa50b31ccb5 4RMD160 (llvm-4.0.0.src.tar.xz) = 468ae2502ba523b35c5e8340724ddaa50b31ccb5
5SHA512 (llvm-4.0.0.src.tar.xz) = cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704 5SHA512 (llvm-4.0.0.src.tar.xz) = cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704
6Size (llvm-4.0.0.src.tar.xz) = 21016340 bytes 6Size (llvm-4.0.0.src.tar.xz) = 21016340 bytes
7SHA1 (patch-cmake_modules_AddLLVM.cmake) = 4bfb98c5d99797155d0fb13a43352d31f6cfe783 7SHA1 (patch-cmake_modules_AddLLVM.cmake) = 4bfb98c5d99797155d0fb13a43352d31f6cfe783
8SHA1 (patch-cmake_modules_HandleLLVMOptions.cmake) = 271e6f5a8cebf8162c4e3b758e96f451b434269b 8SHA1 (patch-cmake_modules_HandleLLVMOptions.cmake) = 271e6f5a8cebf8162c4e3b758e96f451b434269b
9SHA1 (patch-include_llvm_Support_Host.h) = a4e19a72714084b211b0182c04ccc51bd606e150 9SHA1 (patch-include_llvm_Support_Host.h) = a4e19a72714084b211b0182c04ccc51bd606e150
 10SHA1 (patch-lib_Support_Unix_Path.inc) = 08db2e5a098e6450652ca4b239c677716ba9f69f
10SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 18e6ec7b8895e55ecdf93c9d4781e92052a6fcb1 11SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 18e6ec7b8895e55ecdf93c9d4781e92052a6fcb1
 12SHA1 (patch-utils_unittest_googletest_include_gtest_internal_gtest-port-arch.h) = 973941b2180dde3b0c6362bba3a472951b7a5a49
 13SHA1 (patch-utils_unittest_googletest_include_gtest_internal_gtest-port.h) = 8a39fa48a44cb1f7e6bd555670089a44b4bee9a1

File Added: pkgsrc/lang/llvm/patches/Attic/patch-lib_Support_Unix_Path.inc
$NetBSD: patch-lib_Support_Unix_Path.inc,v 1.1 2017/05/05 18:12:24 joerg Exp $

SVN r302263

--- lib/Support/Unix/Path.inc.orig	2017-05-04 16:08:02.765430627 +0000
+++ lib/Support/Unix/Path.inc
@@ -342,14 +342,15 @@ std::error_code resize_file(int FD, uint
 #if defined(HAVE_POSIX_FALLOCATE)
   // If we have posix_fallocate use it. Unlike ftruncate it always allocates
   // space, so we get an error if the disk is full.
-  if (int Err = ::posix_fallocate(FD, 0, Size))
-    return std::error_code(Err, std::generic_category());
-#else
+  if (int Err = ::posix_fallocate(FD, 0, Size)) {
+    if (Err != EOPNOTSUPP)
+      return std::error_code(Err, std::generic_category());
+  }
+#endif
   // Use ftruncate as a fallback. It may or may not allocate space. At least on
   // OS X with HFS+ it does.
   if (::ftruncate(FD, Size) == -1)
     return std::error_code(errno, std::generic_category());
-#endif
 
   return std::error_code();
 }

File Added: pkgsrc/lang/llvm/patches/Attic/patch-utils_unittest_googletest_include_gtest_internal_gtest-port-arch.h
$NetBSD: patch-utils_unittest_googletest_include_gtest_internal_gtest-port-arch.h,v 1.1 2017/05/05 18:12:24 joerg Exp $

SVN r302264

--- utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h.orig	2017-05-04 15:28:58.046689762 +0000
+++ utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h
@@ -84,6 +84,8 @@
 # define GTEST_OS_HPUX 1
 #elif defined __native_client__
 # define GTEST_OS_NACL 1
+#elif defined __NetBSD__
+# define GTEST_OS_NETBSD 1
 #elif defined __OpenBSD__
 # define GTEST_OS_OPENBSD 1
 #elif defined __QNX__

File Added: pkgsrc/lang/llvm/patches/Attic/patch-utils_unittest_googletest_include_gtest_internal_gtest-port.h
$NetBSD: patch-utils_unittest_googletest_include_gtest_internal_gtest-port.h,v 1.1 2017/05/05 18:12:24 joerg Exp $

SVN r302264

--- utils/unittest/googletest/include/gtest/internal/gtest-port.h.orig	2017-05-04 15:26:03.505703113 +0000
+++ utils/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -793,7 +793,7 @@ using ::std::tuple_size;
      (GTEST_OS_MAC && !GTEST_OS_IOS) || \
      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
-     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
+     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NETBSD)
 # define GTEST_HAS_DEATH_TEST 1
 #endif