Commit e561624e authored by Nico Weber's avatar Nico Weber Committed by Chromium LUCI CQ

mac: Pass -no_deduplicate to mac linker for v8_context_snapshot_generator

We disable ICF for v8_context_snapshot_generator on Linux and Windows.
Now we also do it on macOS.

(I noticed that we weren't doing it because the mac/lld build complained
about ld64.lld not understanding --icf=none.)

Bug: 617892,1149587
Change-Id: Idf40a021ec70dea394ed7b74826ceaed99d853b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591007
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836837}
parent f16e07c6
...@@ -87,8 +87,9 @@ if (use_v8_context_snapshot) { ...@@ -87,8 +87,9 @@ if (use_v8_context_snapshot) {
outputs = [ output_file ] outputs = [ output_file ]
} }
# This config disables a link time optimization "ICF", which may merge different # This config disables a link time optimization "ICF", which may merge
# functions into one if the function signature and body of them are identical. # different functions into one if the function signature and body of them are
# identical.
# #
# ICF breaks 1:1 mappings of the external references for V8 snapshot, so we # ICF breaks 1:1 mappings of the external references for V8 snapshot, so we
# disable it while taking a V8 snapshot. # disable it while taking a V8 snapshot.
...@@ -96,6 +97,8 @@ if (use_v8_context_snapshot) { ...@@ -96,6 +97,8 @@ if (use_v8_context_snapshot) {
visibility = [ ":*" ] # Only targets in this file can depend on this. visibility = [ ":*" ] # Only targets in this file can depend on this.
if (is_win) { if (is_win) {
ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe. ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe.
} else if (is_apple) {
ldflags = [ "-Wl,-no_deduplicate" ] # ld64, and ld64.lld.
} else if (use_gold || use_lld) { } else if (use_gold || use_lld) {
ldflags = [ "-Wl,--icf=none" ] ldflags = [ "-Wl,--icf=none" ]
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment