diff options
author | thakis <thakis@chromium.org> | 2015-05-26 16:19:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-26 23:20:13 +0000 |
commit | 45ab39af3cc293e150158bf06515a47319db9f79 (patch) | |
tree | 3f91fca34ba161e8067d37f0271a5f1e07bcd794 | |
parent | 500c73447f279b2afcd79b00c1060e0bde1ee849 (diff) | |
download | chromium_src-45ab39af3cc293e150158bf06515a47319db9f79.zip chromium_src-45ab39af3cc293e150158bf06515a47319db9f79.tar.gz chromium_src-45ab39af3cc293e150158bf06515a47319db9f79.tar.bz2 |
Use --icf=all instead of --icf=safe
With --icf=safe, functions whose address is taken aren't folded.
Folding could change the results of function pointer comparisons.
However, on x86_64 with pie, --icf=safe disables almost all folding,
for technical reasons. Since using --icf=all will save 7 MB on x86_64
and all tests seem to pass with it, switch to --icf=all. If we end up
having a function where we absolutely need equality, we can pass
--keep-unique,<symbol-name> for that symbol.
And if this turns out to be some maintenance burden, we can switch
back to --icf=safe.
Change the flag on all platforms where we use gold, not just x86_64, for
consistency so that if we end up having problems with this, we notice
it faster.
BUG=76280,492177
Review URL: https://codereview.chromium.org/1153143004
Cr-Commit-Position: refs/heads/master@{#331474}
-rw-r--r-- | build/common.gypi | 2 | ||||
-rw-r--r-- | build/config/compiler/BUILD.gn | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/build/common.gypi b/build/common.gypi index 9c30c4e..227e82f 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -665,7 +665,7 @@ 'use_lto_o2%': 0, # Allowed level of identical code folding in the gold linker. - 'gold_icf_level%': 'safe', + 'gold_icf_level%': 'all', # Libxkbcommon usage. 'use_xkbcommon%': 0, diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index ff20eb6..23515a9 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -423,7 +423,7 @@ config("compiler") { "-fuse-ld=gold", # TODO(brettw) common.gypi has this only for target toolset. - "-Wl,--icf=safe", + "-Wl,--icf=all", # Experimentation found that using four linking threads # saved ~20% of link time. @@ -520,7 +520,7 @@ config("compiler") { if (current_cpu == "arm") { ldflags += [ # Enable identical code folding to reduce size. - "-Wl,--icf=safe", + "-Wl,--icf=all", ] } |