Forward-port #1056 on v3

This commit is contained in:
crazywhalecc
2026-03-10 16:41:01 +08:00
parent b89a29d5f3
commit 465549f97d
4 changed files with 11 additions and 13 deletions

View File

@@ -74,7 +74,11 @@ abstract class UnixUtil
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available.");
}
// https://github.com/ziglang/zig/issues/24662
if (SystemTarget::getTargetOS() !== 'Linux' || ApplicationContext::get(ToolchainInterface::class) instanceof ZigToolchain) {
$toolchain = ApplicationContext::get(ToolchainInterface::class);
if ($toolchain instanceof ZigToolchain) {
return '-Wl,--export-dynamic'; // needs release 0.16, can be removed then
}
if (SystemTarget::getTargetOS() !== 'Linux') {
return "-Wl,-exported_symbols_list,{$symbol_file}";
}
return "-Wl,--dynamic-list={$symbol_file}";