swoole has date time conversion error in c++ code, clang needs -lunwind

This commit is contained in:
DubbleClick
2025-06-24 20:43:38 +07:00
parent 2433752273
commit e1028b0348
3 changed files with 12 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ namespace SPC\util;
use SPC\builder\BuilderBase;
use SPC\builder\BuilderProvider;
use SPC\builder\linux\SystemUtil;
use SPC\builder\macos\MacOSBuilder;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
@@ -70,6 +71,9 @@ class SPCConfigUtil
if ($this->builder->hasCpp()) {
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
}
if (SystemUtil::getCCType(getenv('CC')) === 'clang') {
$libs .= ' -lunwind';
}
// mimalloc must come first
if (str_contains($libs, BUILD_LIB_PATH . '/mimalloc.o')) {
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);