build: fix GN build on macOS

use_gold is not defined on macOS.

PR-URL: https://github.com/nodejs/node/pull/56141
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Joyee Cheung 2024-12-09 11:01:55 +01:00 committed by GitHub
parent dbfcbe371c
commit 3837c8d71e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,7 +263,7 @@ template("node_gn_build") {
ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe.
} else if (is_apple && !use_lld) {
ldflags = [ "-Wl,-no_deduplicate" ] # ld64.
} else if (use_gold || use_lld) {
} else if ((!is_apple && use_gold) || use_lld) {
ldflags = [ "-Wl,--icf=none" ]
}
}