Skip to content

Commit df0d5fd

Browse files
committed
merge fix
1 parent 7b33ee7 commit df0d5fd

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/SPC/builder/Extension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use SPC\store\Config;
1212
use SPC\store\FileSystem;
1313
use SPC\util\SPCConfigUtil;
14-
use SPC\util\SPCTarget;
1514

1615
class Extension
1716
{

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,16 @@ protected function sanityCheck(int $build_target): void
206206
if (SPCTarget::isStatic()) {
207207
$lens .= ' -static';
208208
}
209+
// if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
210+
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
211+
$ext_path = 'LD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$LD_LIBRARY_PATH ';
212+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '/libphp.a');
213+
} else {
214+
$ext_path = '';
215+
foreach (glob(BUILD_LIB_PATH . '/libphp*.so') as $file) {
216+
unlink($file);
217+
}
218+
}
209219
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens);
210220
if ($ret !== 0) {
211221
throw new RuntimeException('embed failed sanity check: build failed. Error message: ' . implode("\n", $out));
@@ -320,6 +330,7 @@ protected function buildFrankenphp(): void
320330
$debugFlags = $this->getOption('no-strip') ? "'-w -s' " : '';
321331
$extLdFlags = "-extldflags '-pie'";
322332
$muslTags = '';
333+
$staticFlags = '';
323334
if (SPCTarget::isStatic()) {
324335
$extLdFlags = "-extldflags '-static-pie -Wl,-z,stack-size=0x80000'";
325336
$muslTags = 'static_build,';

src/SPC/util/GlobalEnvManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use SPC\exception\RuntimeException;
88
use SPC\exception\WrongUsageException;
9-
use SPC\store\pkg\Zig;
109
use SPC\toolchain\ToolchainManager;
1110

1211
/**

0 commit comments

Comments
 (0)