From 223dd10ac6bbe97934e0e4fa7648b655d6b71ca9 Mon Sep 17 00:00:00 2001 From: henderkes Date: Sat, 24 Jan 2026 20:26:16 +0100 Subject: [PATCH 1/3] fix spx shared libadd --- src/SPC/builder/Extension.php | 2 +- src/SPC/builder/extension/excimer.php | 19 ------------------- src/SPC/builder/extension/spx.php | 7 +++++++ 3 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 src/SPC/builder/extension/excimer.php diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 925a4c8ef..f5a5d9561 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -542,7 +542,7 @@ public function getLibraryDependencies(bool $recursive = false): array */ protected function getSharedExtensionEnv(): array { - $config = (new SPCConfigUtil($this->builder))->getExtensionConfig($this); + $config = (new SPCConfigUtil($this->builder, ['no_php' => true]))->getExtensionConfig($this); [$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']); $preStatic = PHP_OS_FAMILY === 'Darwin' ? '' : '-Wl,--start-group '; $postStatic = PHP_OS_FAMILY === 'Darwin' ? '' : ' -Wl,--end-group '; diff --git a/src/SPC/builder/extension/excimer.php b/src/SPC/builder/extension/excimer.php deleted file mode 100644 index 03dd8f228..000000000 --- a/src/SPC/builder/extension/excimer.php +++ /dev/null @@ -1,19 +0,0 @@ -source_dir . '/src/php_spx.h', $this->source_dir . '/php_spx.h'); return true; } + + public function getSharedExtensionEnv(): array + { + $env = parent::getSharedExtensionEnv(); + $env['SPX_SHARED_LIBADD'] = $env['LIBS']; + return $env; + } } From 4531c9fe57d54062c499c007687c412df13e8451 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 27 Jan 2026 00:57:58 +0100 Subject: [PATCH 2/3] add option to allow linking musl dynamically on alpine --- config/env.ini | 4 +++- src/SPC/util/SPCTarget.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/env.ini b/config/env.ini index c1d4dbc4a..a16bc160f 100644 --- a/config/env.ini +++ b/config/env.ini @@ -75,8 +75,10 @@ SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime ; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target. ; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only. -; LEGACY option to specify the target +; option to specify the target, superceded by SPC_TARGET if set SPC_LIBC=musl +; uncomment to link libc dynamically on musl +; SPC_MUSL_DYNAMIC=true ; Recommended: specify your target here. Zig toolchain will be used. ; examples: diff --git a/src/SPC/util/SPCTarget.php b/src/SPC/util/SPCTarget.php index b8f5367ae..037c6d8c3 100644 --- a/src/SPC/util/SPCTarget.php +++ b/src/SPC/util/SPCTarget.php @@ -27,10 +27,10 @@ public static function isStatic(): bool return true; } if (ToolchainManager::getToolchainClass() === GccNativeToolchain::class) { - return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist(); + return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist() && !getenv('SPC_MUSL_DYNAMIC'); } if (ToolchainManager::getToolchainClass() === ClangNativeToolchain::class) { - return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist(); + return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist() && !getenv('SPC_MUSL_DYNAMIC'); } // if SPC_LIBC is set, it means the target is static, remove it when 3.0 is released if ($target = getenv('SPC_TARGET')) { From c5882c1f8e2d95643c50e29740209c1ea9e8dae8 Mon Sep 17 00:00:00 2001 From: henderkes Date: Fri, 30 Jan 2026 19:41:39 +0100 Subject: [PATCH 3/3] fix gettext v1.0 release --- src/SPC/builder/unix/library/gettext.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/library/gettext.php b/src/SPC/builder/unix/library/gettext.php index 332e25c96..d383faf77 100644 --- a/src/SPC/builder/unix/library/gettext.php +++ b/src/SPC/builder/unix/library/gettext.php @@ -16,7 +16,11 @@ protected function build(): void ->addConfigureArgs( '--disable-java', '--disable-c++', - '--with-included-gettext', + '--disable-d', + '--disable-rpath', + '--disable-modula2', + '--disable-libasprintf', + '--with-included-libintl', "--with-iconv-prefix={$this->getBuildRootPath()}", );