zig now supports -Wl,-exported_symbols_list

This commit is contained in:
henderkes 2026-01-17 11:26:28 +01:00
parent 0b863cbc70
commit 19f941797e

View File

@ -72,12 +72,8 @@ trait UnixSystemUtilTrait
if (!is_file($symbol_file)) { if (!is_file($symbol_file)) {
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available."); 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 // macOS/zig
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) { if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) {
return '-Wl,--export-dynamic';
}
// macOS
if (SPCTarget::getTargetOS() !== 'Linux') {
return "-Wl,-exported_symbols_list,{$symbol_file}"; return "-Wl,-exported_symbols_list,{$symbol_file}";
} }
return "-Wl,--dynamic-list={$symbol_file}"; return "-Wl,--dynamic-list={$symbol_file}";