This diff backports a 10.0.1 fix for an llvm crash while compiling net/libtorrent-rasterbar web_connection-base.cpp and bt_peer_connection.cpp.
I compiled an earlier version of jca@'s update to devel/llvm 10 with debug symbols to get this backtrace: https://namtsui.com/public/libtorrent-rasterbar-bt.txt - added -DCMAKE_BUILD_TYPE=Debug - make DEBUG=-g CFLAGS=-g CXXFLAGS=-g clean configure The debug version of llvm was extremely slow at compiling libtorrent-rasterbar, so I had to use a release build. I searched for EmitEndEHSpec and found an existing bug report from 2019. Arvid Norberg responded to the thread and is upstream for libtorrent-rasterbar. https://bugs.llvm.org/show_bug.cgi?id=43814 https://github.com/llvm/llvm-project/commit/68cd4f72beae67a9bdbc11c85fd745dec8fc0999 I propose adding this inline diff for devel/llvm now. I propose waiting until rsadowski@'s devel/boost 1.67 before unbreaking libtorrent-rasterbar. I can look into updating libtorrent-rasterbar to 1.2.8 until then. There is discussion regarding a mechanism for boost python numbering. To test: 1. update to boost 1.67 https://marc.info/?l=openbsd-ports&m=159566156026888&w=2 2. use attached net/libtorrent-rasterbar diff moving to ports-clang, based on rsadowski@'s diff 3. use inline devel/llvm In my testing net/libtorrent-rasterbar builds and net/deluge and net/qbittorrent work in downloading a torrent. Feedback and tests are welcome. Index: Makefile =================================================================== RCS file: /cvs/ports/devel/llvm/Makefile,v retrieving revision 1.256 diff -u -p -r1.256 Makefile --- Makefile 5 Aug 2020 06:49:48 -0000 1.256 +++ Makefile 6 Aug 2020 05:19:04 -0000 @@ -18,6 +18,7 @@ PKGSPEC-main = llvm-=${LLVM_V} PKGNAME-main = llvm-${LLVM_V} PKGNAME-python = py3-llvm-${LLVM_V} PKGNAME-lldb = lldb-${LLVM_V} +REVISION-main = 0 CATEGORIES = devel Index: patches/patch-tools_clang_lib_CodeGen_CGVTables_cpp =================================================================== RCS file: patches/patch-tools_clang_lib_CodeGen_CGVTables_cpp diff -N patches/patch-tools_clang_lib_CodeGen_CGVTables_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-tools_clang_lib_CodeGen_CGVTables_cpp 6 Aug 2020 05:19:04 -0000 @@ -0,0 +1,49 @@ +$OpenBSD$ + +backport llvm 10.0.1 fix for net/libtorrent-rasterbar. see: +https://bugs.llvm.org/show_bug.cgi?id=43814 + +commit 68cd4f72beae67a9bdbc11c85fd745dec8fc0999 +from: Reid Kleckner <[email protected]> +date: Mon Apr 13 17:34:45 2020 UTC +via: tstellar <[email protected]> + +Use FinishThunk to finish musttail thunks + +FinishThunk, and the invariant of setting and then unsetting +CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't +exist when I added this musttail codepath in ab2090d10765 (2014). +Recently in 28328c3771, I started using this codepath on non-Windows +platforms, and users reported problems during release testing (PR44987). + +The issue was already present for users of EH on i686-windows-msvc, so I +added a test for that case as well. + +Reviewed By: hans + +Differential Revision: https://reviews.llvm.org/D76444 + +(cherry picked from commit ce5173c0e174870934d1b3a026f631d996136191) + +Index: tools/clang/lib/CodeGen/CGVTables.cpp +--- tools/clang/lib/CodeGen/CGVTables.cpp.orig ++++ tools/clang/lib/CodeGen/CGVTables.cpp +@@ -437,7 +437,8 @@ void CodeGenFunction::EmitMustTailThunk(GlobalDecl GD, + // Finish the function to maintain CodeGenFunction invariants. + // FIXME: Don't emit unreachable code. + EmitBlock(createBasicBlock()); +- FinishFunction(); ++ ++ FinishThunk(); + } + + void CodeGenFunction::generateThunk(llvm::Function *Fn, +@@ -564,7 +565,7 @@ llvm::Constant *CodeGenVTables::maybeEmitThunk(GlobalD + CGM.SetLLVMFunctionAttributesForDefinition(GD.getDecl(), ThunkFn); + + // Thunks for variadic methods are special because in general variadic +- // arguments cannot be perferctly forwarded. In the general case, clang ++ // arguments cannot be perfectly forwarded. In the general case, clang + // implements such thunks by cloning the original function body. However, for + // thunks with no return adjustment on targets that support musttail, we can + // use musttail to perfectly forward the variadic arguments.
libtorrent-rasterbar.diff
Description: libtorrent-rasterbar.diff
