Thursday, July 04, 2019

Re: [wip] devel/llvm 8.0.0

On Tue, Jul 02 2019, Charlene Wendling <julianaito@posteo.jp> wrote:
> Hi!
>
>> On Sun, Jun 30 2019, Sebastien Marie <semarie@online.fr> wrote:
>> > On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas
>> > wrote:
>> >>
>> >> Here's the diff I'm testing right now. I have merged the llvm
>> >> patches this morning and I did not double check them so far, but
>> >> this lets llvm, include-what-you-use, rust and ripgrep build on
>> >> amd64. mozillas are building on amd64, llvm still compiling on
>> >> sparc64.
>> >>
>> >> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
>> >> rust-1.36 and llvm-7 / llvm-8.
>> >
>> > I think you have more work than me to push a tested llvm-8. so you
>> > should go first, and I will redo a part of my work for upgrading rust
>> > to 1.36, using llvm-8.
>>
>> I guess it's going to be easier for me this way, I'm not completely
>> sure. After all, rust doesn't build on the slower archs that need to be
>> tested with llvm-8. Anyway, the current rust version seems to cope fine
>> with llvm-8 so upgrading llvm first sound appealing.
>>
>> > I will use the diff to prepare llvm-8 packages on my buildhosts and
>> > test rust-1.36 with that.
>>
>> Please use this updated diff which adds py-recommonmark[0] as a build
>> dep. Sorry for the obvious oversight!
>>
>> [0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2
>
> On macppc it fails while packaging [1] because some .a aren't built,
> as such i've modified a bit the PLISTs.

Thanks (again) for this.

> I guess it's because on macppc only the powerpc target is built.

Yep.

> devel/include-what-you-use still doesn't build with the same error
> llvm-7 has [2], probably for the same reason.

I had missed that one. iwyu.cc:

--8<--
int main(int argc, char **argv) {
// Must initialize X86 target to be able to parse Microsoft inline
// assembly. We do this unconditionally, because it allows an IWYU
// built for non-X86 targets to parse MS inline asm without choking.
LLVMInitializeX86TargetInfo();
LLVMInitializeX86TargetMC();
LLVMInitializeX86AsmParser();
-->8--

For the ports tree I guess an #ifndef __powerpc__ would be enough.

> I'm sending the diff with only the PLIST changes done. sysutils/free
> builds and runs fine with forced COMPILER. I'll report any arising issues.

As discussed privately PLIST/PFRAG were still not right but that was easy
to fix. On top of this I had missed some bits when doing the merge of
OpenBSD.cpp, which resulted in -lcompiler_rt being incorrectly used
instead of libgcc on sparc64 (rather, where libestdc++ is used).
I spotted this thanks to a failure in devel/cbmc.

Here's the latest diff. It still doesn't merge all the changes from
base but the differences don't seem to matter for the correctness of the
compiled code, so I might address this later. Hopefully this version
can go in soonish so that semarie@ can proceed to updating lang/rust.

Feedback, reviews, tests, oks etc welcome, as usual.


Index: devel/include-what-you-use/Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- devel/include-what-you-use/Makefile 17 Jun 2019 21:33:45 -0000 1.16
+++ devel/include-what-you-use/Makefile 4 Jul 2019 15:26:11 -0000
@@ -2,9 +2,8 @@

COMMENT= tool to analyse \#includes in C and C++ source files
CATEGORIES= devel
-DISTNAME= include-what-you-use-0.11.src
+DISTNAME= include-what-you-use-0.12.src
PKGNAME= ${DISTNAME:.src=}
-REVISION= 1

HOMEPAGE= https://include-what-you-use.org
MASTER_SITES= ${HOMEPAGE}/downloads/
@@ -16,7 +15,7 @@ MAINTAINER= Jonathan Gray <jsg@openbsd.o
PERMIT_PACKAGE= Yes

WANTLIB= ${COMPILER_LIBCXX} c m pthread
-LLVM_V= 7.0.1
+LLVM_V= 8.0.0
BUILD_DEPENDS= devel/llvm>=${LLVM_V}
RUN_DEPENDS= devel/llvm>=${LLVM_V}

Index: devel/include-what-you-use/distinfo
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- devel/include-what-you-use/distinfo 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/include-what-you-use/distinfo 4 Jul 2019 15:26:11 -0000
@@ -1,2 +1,2 @@
-SHA256 (include-what-you-use-0.11.src.tar.gz) = LSh3cmxK7ZUYy7N2c/+8K32pwjm/j+KUMto1wcDsNno=
-SIZE (include-what-you-use-0.11.src.tar.gz) = 541763
+SHA256 (include-what-you-use-0.12.src.tar.gz) = pYkvsKvMuCDDlOTiRcAO8w/JTkrligSLI/lAR8CBYCU=
+SIZE (include-what-you-use-0.12.src.tar.gz) = 545673
Index: devel/include-what-you-use/patches/patch-iwyu_include_picker_cc
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/patches/patch-iwyu_include_picker_cc,v
retrieving revision 1.5
diff -u -p -r1.5 patch-iwyu_include_picker_cc
--- devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 4 Jul 2019 15:26:11 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-iwyu_include_picker_cc,v
Index: iwyu_include_picker.cc
--- iwyu_include_picker.cc.orig
+++ iwyu_include_picker.cc
-@@ -116,8 +116,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -118,8 +118,6 @@ const IncludeMapEntry libc_symbol_map[] = {
{ "gid_t", kPrivate, "<unistd.h>", kPublic },
{ "id_t", kPrivate, "<sys/types.h>", kPublic },
{ "id_t", kPrivate, "<sys/resource.h>", kPublic },
@@ -12,7 +12,7 @@ Index: iwyu_include_picker.cc
{ "ino_t", kPrivate, "<sys/types.h>", kPublic },
{ "ino_t", kPrivate, "<dirent.h>", kPublic },
{ "ino_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -133,8 +131,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -143,8 +141,6 @@ const IncludeMapEntry libc_symbol_map[] = {
{ "mode_t", kPrivate, "<sys/mman.h>", kPublic },
{ "nlink_t", kPrivate, "<sys/types.h>", kPublic },
{ "nlink_t", kPrivate, "<sys/stat.h>", kPublic },
@@ -21,7 +21,7 @@ Index: iwyu_include_picker.cc
{ "off_t", kPrivate, "<sys/types.h>", kPublic },
{ "off_t", kPrivate, "<unistd.h>", kPublic },
{ "off_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -148,11 +144,8 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -158,11 +154,8 @@ const IncludeMapEntry libc_symbol_map[] = {
{ "pid_t", kPrivate, "<time.h>", kPublic },
{ "pid_t", kPrivate, "<utmpx.h>", kPublic },
{ "sigset_t", kPrivate, "<signal.h>", kPublic },
@@ -34,7 +34,7 @@ Index: iwyu_include_picker.cc
{ "ssize_t", kPrivate, "<sys/types.h>", kPublic },
{ "ssize_t", kPrivate, "<unistd.h>", kPublic },
{ "ssize_t", kPrivate, "<monetary.h>", kPublic },
-@@ -181,6 +174,7 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -195,6 +188,7 @@ const IncludeMapEntry libc_symbol_map[] = {
{ "size_t", kPrivate, "<time.h>", kPublic },
{ "size_t", kPrivate, "<uchar.h>", kPublic },
{ "size_t", kPrivate, "<wchar.h>", kPublic },
@@ -42,7 +42,7 @@ Index: iwyu_include_picker.cc
// Macros that can be defined in more than one file, don't have the
// same __foo_defined guard that other types do, so the grep above
// doesn't discover them. Until I figure out a better way, I just
-@@ -195,6 +189,10 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -209,6 +203,10 @@ const IncludeMapEntry libc_symbol_map[] = {
{ "calloc", kPrivate, "<stdlib.h>", kPublic },
{ "realloc", kPrivate, "<stdlib.h>", kPublic },
{ "free", kPrivate, "<stdlib.h>", kPublic },
@@ -53,7 +53,7 @@ Index: iwyu_include_picker.cc
// Entries for NULL
{ "NULL", kPrivate, "<stddef.h>", kPublic }, // 'canonical' location for NULL
{ "NULL", kPrivate, "<clocale>", kPublic },
-@@ -240,7 +238,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
+@@ -254,7 +252,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
};

// Private -> public include mappings for GNU libc
@@ -62,7 +62,7 @@ Index: iwyu_include_picker.cc
// ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { "<$2>", kPrivate, "<$1>", kPublic },@' | grep bits/ | sort )
// When I saw more than one mapping for these, I typically picked
// what I thought was the "best" one.
-@@ -443,6 +441,42 @@ const IncludeMapEntry libc_include_map[] = {
+@@ -457,6 +455,42 @@ const IncludeMapEntry libc_include_map[] = {
{ "<linux/limits.h>", kPrivate, "<limits.h>", kPublic }, // PATH_MAX
{ "<linux/prctl.h>", kPrivate, "<sys/prctl.h>", kPublic },
{ "<sys/ucontext.h>", kPrivate, "<ucontext.h>", kPublic },
Index: devel/include-what-you-use/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- devel/include-what-you-use/pkg/PLIST 17 Jun 2019 21:33:45 -0000 1.3
+++ devel/include-what-you-use/pkg/PLIST 4 Jul 2019 15:26:11 -0000
@@ -24,4 +24,3 @@ share/include-what-you-use/libcxx.imp
share/include-what-you-use/qt4.imp
share/include-what-you-use/qt5_4.imp
share/include-what-you-use/stl.c.headers.imp
-share/include-what-you-use/third_party.imp
Index: devel/llvm/Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.227
diff -u -p -r1.227 Makefile
--- devel/llvm/Makefile 22 Jun 2019 22:44:06 -0000 1.227
+++ devel/llvm/Makefile 4 Jul 2019 15:26:11 -0000
@@ -11,15 +11,13 @@ COMMENT-python = Python bindings for Cla

# XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when
# updating this port.
-LLVM_V = 7.0.1
+LLVM_V = 8.0.0
DISTNAME = llvm-${LLVM_V}.src
PKGNAME = llvm-${LLVM_V}
PKGSPEC-main = llvm-=${LLVM_V}
PKGNAME-main = llvm-${LLVM_V}
PKGNAME-python = py-llvm-${LLVM_V}
PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 13
-REVISION-lldb = 3

CATEGORIES = devel

@@ -51,7 +49,8 @@ MODULES = devel/cmake \
TEST_DEPENDS = devel/dejagnu \
shells/bash
BUILD_DEPENDS += devel/swig \
- textproc/py-sphinx
+ textproc/py-sphinx \
+ textproc/py-recommonmark
RUN_DEPENDS += devel/gtest

.include <bsd.port.arch.mk>
Index: devel/llvm/distinfo
===================================================================
RCS file: /cvs/ports/devel/llvm/distinfo,v
retrieving revision 1.32
diff -u -p -r1.32 distinfo
--- devel/llvm/distinfo 8 May 2019 22:34:02 -0000 1.32
+++ devel/llvm/distinfo 4 Jul 2019 15:26:11 -0000
@@ -1,8 +1,8 @@
-SHA256 (cfe-7.0.1.src.tar.xz) = pFti3eXX1f3N+odrCvkvFk1DSwbp6JtdCxy8Zd/j9Bg=
-SHA256 (lld-7.0.1.src.tar.xz) = iGmqst0tjgDWmUM1LTFm0VnX6uJhX2amhPSgmZ/HQDE=
-SHA256 (lldb-7.0.1.src.tar.xz) = drRr51tBKj0i8NJieTBq5+J0/k15iKIYTFKcOKanaYI=
-SHA256 (llvm-7.0.1.src.tar.xz) = o438TbRxAux53MKqYek3IsX28G8KlhBzvYS3j7lJQZs=
-SIZE (cfe-7.0.1.src.tar.xz) = 12488668
-SIZE (lld-7.0.1.src.tar.xz) = 912812
-SIZE (lldb-7.0.1.src.tar.xz) = 19384628
-SIZE (llvm-7.0.1.src.tar.xz) = 28311056
+SHA256 (cfe-8.0.0.src.tar.xz) = CEwRWqsAhOY7I+7owjOrtnOcOZ4plm6uzPxuCI4Lc2s=
+SHA256 (lld-8.0.0.src.tar.xz) = nK7I7JIuMv+hMPD7COTFokLX5oznV2MeQl6eui4abjc=
+SHA256 (lldb-8.0.0.src.tar.xz) = SZGLnwmBZVSiCsRMX4WjLcCnoAdZsyWeeAZNZ06sA3M=
+SHA256 (llvm-8.0.0.src.tar.xz) = iHK+GxLGFFDKzIKz0VPqsCviVG7zT6NYDtFBN7smIkw=
+SIZE (cfe-8.0.0.src.tar.xz) = 12868468
+SIZE (lld-8.0.0.src.tar.xz) = 999864
+SIZE (lldb-8.0.0.src.tar.xz) = 19602332
+SIZE (llvm-8.0.0.src.tar.xz) = 30503732
Index: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
===================================================================
RCS file: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
diff -N devel/llvm/patches/patch-include_llvm_ADT_Optional_h
--- devel/llvm/patches/patch-include_llvm_ADT_Optional_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-include_llvm_ADT_Optional_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types
-
-This fixes libLLVM.so ABI mismatches between llvm compiled with clang
-and llvm compiled with gcc (PR39427).
-
-Index: include/llvm/ADT/Optional.h
---- include/llvm/ADT/Optional.h.orig
-+++ include/llvm/ADT/Optional.h
-@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> struct OptionalS
- }
- };
-
--#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
--/// Storage for trivially copyable types only.
--template <typename T> struct OptionalStorage<T, true> {
-- AlignedCharArrayUnion<T> storage;
-- bool hasVal = false;
--
-- OptionalStorage() = default;
--
-- OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
-- OptionalStorage &operator=(const T &y) {
-- *reinterpret_cast<T *>(storage.buffer) = y;
-- hasVal = true;
-- return *this;
-- }
--
-- void reset() { hasVal = false; }
--};
--

No comments:

Post a Comment