This commit is contained in:
DubbleClick 2025-08-29 14:12:00 +07:00
parent 2972ab31d7
commit 190be6c7b9

View File

@ -203,7 +203,7 @@ abstract class UnixBuilderBase extends BuilderBase
unlink($file);
}
$symbolList = $this->getDynamicExportSymbolsFile();
$dynamic_exports = $symbolList ? (' -Wl,--dynamic-list=' . $symbolList) : '';
$dynamic_exports = $symbolList ? (' -Wl,--dynamic-list' . (SPCTarget::getTargetOS() === 'Darwin' ? '-file' : '') . '=' . $symbolList) : '';
}
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens . ' ' . $dynamic_exports);
if ($ret !== 0) {
@ -327,7 +327,7 @@ abstract class UnixBuilderBase extends BuilderBase
$dynamic_exports = '';
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
$symbolList = $this->getDynamicExportSymbolsFile();
$dynamic_exports = $symbolList ? (' -Wl,--dynamic-list=' . $symbolList) : '';
$dynamic_exports = $symbolList ? (' -Wl,--dynamic-list' . (SPCTarget::getTargetOS() === 'Darwin' ? '-file' : '') . '=' . $symbolList) : '';
}
$extLdFlags = "-extldflags '-pie{$dynamic_exports}'";
$muslTags = '';