the following diff add a patch file used only when using clang, so it links to c++abi correctly.
Thanks to naddy@ for his explanations about the work required for fixing it. I found the PATCH_LIST idea from games/xkobo Index: Makefile =================================================================== RCS file: /data/cvs/ports/games/tome4/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- Makefile 4 Sep 2018 12:46:13 -0000 1.18 +++ Makefile 29 Oct 2018 11:54:13 -0000 @@ -52,6 +52,7 @@ COMPILER_LANGS = c .include <bsd.port.arch.mk> .if ${PROPERTIES:Mclang} WANTLIB-main += c++abi +PATCH_LIST = patch-* clang-linking .endif NO_TEST = Yes Index: patches/clang-linking =================================================================== RCS file: patches/clang-linking diff -N patches/clang-linking --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/clang-linking 29 Oct 2018 12:06:16 -0000 @@ -0,0 +1,15 @@ +$OpenBSD: patch-build_te4core_lua,v 1.2 2018/04/29 10:21:35 solene Exp $ + +add c++abi to the linker + +Index: build/te4core.lua +--- build/te4core.lua.orig ++++ build/te4core.lua +@@ -50,6 +50,7 @@ project "TEngine" + if _OPTIONS.relpath == "64" then defines{"TE4_RELPATH64"} end + + links { "m" } ++ links { "c++abi" } + + if _OPTIONS.no_rwops_size then defines{"NO_RWOPS_SIZE"} end +