mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 09:55:37 +08:00
dont pass shared extension packages to SPCConfigUtil for building php (bleeds libpq polyfills into php configure, poisoning e.g. have_strlcat results)
This commit is contained in:
@@ -28,7 +28,7 @@ class LlvmCompilerRtCheck
|
|||||||
#[CheckItem('if llvm-compiler-rt is built for current target', level: 799)]
|
#[CheckItem('if llvm-compiler-rt is built for current target', level: 799)]
|
||||||
public function checkLlvmCompilerRt(): CheckResult
|
public function checkLlvmCompilerRt(): CheckResult
|
||||||
{
|
{
|
||||||
$libDir = zig::dir() . '/lib/' . SystemTarget::getCanonicalTriple();
|
$libDir = zig::path() . '/lib/' . SystemTarget::getCanonicalTriple();
|
||||||
if (new llvm_compiler_rt()->isBuilt($libDir)) {
|
if (new llvm_compiler_rt()->isBuilt($libDir)) {
|
||||||
return CheckResult::ok($libDir);
|
return CheckResult::ok($libDir);
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ class LlvmCompilerRtCheck
|
|||||||
$installer->addInstallPackage('llvm-compiler-rt');
|
$installer->addInstallPackage('llvm-compiler-rt');
|
||||||
$installer->run(true);
|
$installer->run(true);
|
||||||
new llvm_compiler_rt()->buildForTriple();
|
new llvm_compiler_rt()->buildForTriple();
|
||||||
$libDir = zig::dir() . '/lib/' . SystemTarget::getCanonicalTriple();
|
$libDir = zig::path() . '/lib/' . SystemTarget::getCanonicalTriple();
|
||||||
return new llvm_compiler_rt()->isBuilt($libDir);
|
return new llvm_compiler_rt()->isBuilt($libDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,11 +304,9 @@ class PackageInstaller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get resolved package names filtered to only packages whose build artifacts are available.
|
* Get resolved package names whose build artifacts contribute to the PHP main link.
|
||||||
* This excludes library packages that haven't been built/installed yet, which naturally
|
* Excludes libraries not yet built (so SPCConfigUtil doesn't probe their .a files) and
|
||||||
* prevents SPCConfigUtil from checking static-lib files of libraries that come after
|
* shared-only extensions (they link separately into their own .so).
|
||||||
* the current target in the build order (e.g. 'watcher' for frankenphp isn't built
|
|
||||||
* when 'php' is being compiled).
|
|
||||||
*
|
*
|
||||||
* @return string[] Available resolved package names
|
* @return string[] Available resolved package names
|
||||||
*/
|
*/
|
||||||
@@ -318,12 +316,12 @@ class PackageInstaller
|
|||||||
array_keys($this->packages),
|
array_keys($this->packages),
|
||||||
function (string $name): bool {
|
function (string $name): bool {
|
||||||
$pkg = $this->packages[$name] ?? null;
|
$pkg = $this->packages[$name] ?? null;
|
||||||
// Exclude library packages whose build artifacts don't exist yet.
|
|
||||||
// Extensions and targets are not filtered — extensions are compiled into PHP
|
|
||||||
// and don't have standalone build artifacts.
|
|
||||||
if ($pkg instanceof LibraryPackage && $pkg->getType() === 'library' && !$pkg->isInstalled()) {
|
if ($pkg instanceof LibraryPackage && $pkg->getType() === 'library' && !$pkg->isInstalled()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($pkg instanceof PhpExtensionPackage && $pkg->isBuildShared() && !$pkg->isBuildStatic()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user