build: don't strip global symbols of macOS binaries

Bug: vercel/pkg#1155
This commit is contained in:
Jesse Chan 2021-05-10 23:34:44 +08:00
parent a062bb42f5
commit 5d2bc3bb24

View File

@ -201,9 +201,14 @@ async function compileOnUnix(
const output = path.join(nodePath, 'out/Release/node');
await spawn(process.env.STRIP || 'strip', [output], {
stdio: 'inherit',
});
await spawn(
process.env.STRIP || 'strip',
// global symbols are required for native bindings on macOS
[...(targetPlatform === 'macos' ? ['-x'] : []), output],
{
stdio: 'inherit',
}
);
if (targetPlatform === 'macos') {
// Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.