From 1a395a2b0fc04f161e04f00dca45f4d8c8691a51 Mon Sep 17 00:00:00 2001 From: henderkes Date: Fri, 17 Apr 2026 01:51:01 +0700 Subject: [PATCH] fix zig 0.16.0 --- src/SPC/builder/Extension.php | 5 ++++- src/SPC/store/pkg/Zig.php | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 9077269e..8517f1e5 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -11,6 +11,8 @@ use SPC\exception\ValidationException; use SPC\exception\WrongUsageException; use SPC\store\Config; use SPC\store\FileSystem; +use SPC\toolchain\ToolchainManager; +use SPC\toolchain\ZigToolchain; use SPC\util\SPCConfigUtil; use SPC\util\SPCTarget; @@ -231,7 +233,8 @@ class Extension if (preg_match('/^(.*_SHARED_LIBADD\s*=\s*)(.*)$/m', $makefileContent, $matches)) { $prefix = $matches[1]; $currentLibs = trim($matches[2]); - $newLibs = trim("{$currentLibs} {$staticLibs} {$lstdcpp}"); + $lzig = ToolchainManager::getToolchainClass() === ZigToolchain::class ? '-lcompiler_rt -lunwind' : ''; + $newLibs = clean_spaces("{$currentLibs} {$staticLibs} {$lstdcpp} {$lzig}"); $deduplicatedLibs = deduplicate_flags($newLibs); FileSystem::replaceFileRegex( diff --git a/src/SPC/store/pkg/Zig.php b/src/SPC/store/pkg/Zig.php index 259368bf..c2a81c0d 100644 --- a/src/SPC/store/pkg/Zig.php +++ b/src/SPC/store/pkg/Zig.php @@ -82,7 +82,6 @@ class Zig extends CustomPackage if (!$latest_version) { throw new DownloaderException('Could not determine latest Zig version'); } - $latest_version = '0.15.2'; logger()->info("Installing Zig version {$latest_version}");