mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
merge fix
This commit is contained in:
parent
7b33ee79dd
commit
df0d5fdbe8
@ -11,7 +11,6 @@ use SPC\exception\WrongUsageException;
|
|||||||
use SPC\store\Config;
|
use SPC\store\Config;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\SPCConfigUtil;
|
use SPC\util\SPCConfigUtil;
|
||||||
use SPC\util\SPCTarget;
|
|
||||||
|
|
||||||
class Extension
|
class Extension
|
||||||
{
|
{
|
||||||
|
|||||||
@ -206,6 +206,16 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
if (SPCTarget::isStatic()) {
|
if (SPCTarget::isStatic()) {
|
||||||
$lens .= ' -static';
|
$lens .= ' -static';
|
||||||
}
|
}
|
||||||
|
// if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
|
||||||
|
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
||||||
|
$ext_path = 'LD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$LD_LIBRARY_PATH ';
|
||||||
|
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '/libphp.a');
|
||||||
|
} else {
|
||||||
|
$ext_path = '';
|
||||||
|
foreach (glob(BUILD_LIB_PATH . '/libphp*.so') as $file) {
|
||||||
|
unlink($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens);
|
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens);
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new RuntimeException('embed failed sanity check: build failed. Error message: ' . implode("\n", $out));
|
throw new RuntimeException('embed failed sanity check: build failed. Error message: ' . implode("\n", $out));
|
||||||
@ -320,6 +330,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
$debugFlags = $this->getOption('no-strip') ? "'-w -s' " : '';
|
$debugFlags = $this->getOption('no-strip') ? "'-w -s' " : '';
|
||||||
$extLdFlags = "-extldflags '-pie'";
|
$extLdFlags = "-extldflags '-pie'";
|
||||||
$muslTags = '';
|
$muslTags = '';
|
||||||
|
$staticFlags = '';
|
||||||
if (SPCTarget::isStatic()) {
|
if (SPCTarget::isStatic()) {
|
||||||
$extLdFlags = "-extldflags '-static-pie -Wl,-z,stack-size=0x80000'";
|
$extLdFlags = "-extldflags '-static-pie -Wl,-z,stack-size=0x80000'";
|
||||||
$muslTags = 'static_build,';
|
$muslTags = 'static_build,';
|
||||||
|
|||||||
@ -6,7 +6,6 @@ namespace SPC\util;
|
|||||||
|
|
||||||
use SPC\exception\RuntimeException;
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\pkg\Zig;
|
|
||||||
use SPC\toolchain\ToolchainManager;
|
use SPC\toolchain\ToolchainManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user