Files
ports/devel/ispc/files/patch-src_util.cpp
T
Dimitry Andric e4b498d8a0 devel/ispc: fix build with libc++ >= 20
With libc++ 20 or higher devel/ispc fails to build, with errors similar
to:

    /wrkdirs/usr/ports/devel/ispc/work/ispc-1.30.0/src/util.cpp:51:11: error: '__libcpp_verbose_abort' is missing exception specification 'noexcept'
       51 | void std::__libcpp_verbose_abort(char const *format, ...)
          |           ^
          |                                                           noexcept
    /usr/include/c++/v1/__verbose_abort:24:28: note: previous declaration is here
       24 |     __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _NOEXCEPT;
          |                            ^

This is because ispc attemps to override __libcpp_verbose_abort(), which
is an internal libc++ function, but it misses a noexcept specification.

However, overriding __libcpp_verbose_abort() is only necessary on older
versions of macOS. Therefore, exclude the whole #if block if the
operating system is not macOS.

PR:		293163
Approved by:	yuri (maintainer)
MFH:		2026Q1
2026-02-16 20:56:51 +01:00

21 lines
727 B
C++

--- src/util.cpp.orig 2026-02-04 04:33:16 UTC
+++ src/util.cpp
@@ -44,7 +44,7 @@
#include <llvm/Support/Path.h>
#if ISPC_LLVM_VERSION < ISPC_LLVM_21_0
-#ifdef _LIBCPP_VERSION
+#if defined(ISPC_HOST_IS_APPLE) && defined(_LIBCPP_VERSION)
// Provide own definition of std::__libcpp_verbose_abort to avoid missing symbols error on macOS with old
// system libc++.1.dylib. The symbol is there for macOS 13 Ventura and later, but not macOS 12 and earlier.
// See #3071 for more details.
@@ -60,7 +60,7 @@ void std::__libcpp_verbose_abort(char const *format, .
abort();
}
-#endif // _LIBCPP_VERSION
+#endif // ISPC_HOST_IS_APPLE && _LIBCPP_VERSION
#endif // ISPC_LLVM_VERSION < ISPC_LLVM_21_0
using namespace ispc;