mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[build] Enable linker identical code folding.
Change-Id: I04ab9ef71c41f96abd2d9e23ee107937617fb99d Reviewed-on: https://dart-review.googlesource.com/62707 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
d44e7e9b61
commit
ef95f2ded6
|
@ -315,12 +315,6 @@ config("compiler") {
|
|||
"-Wl,--exclude-libs=libgcc.a",
|
||||
"-Wl,--exclude-libs=libc++_static.a",
|
||||
]
|
||||
if (current_cpu == "arm") {
|
||||
ldflags += [
|
||||
# Enable identical code folding to reduce size.
|
||||
"-Wl,--icf=safe",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_clang) {
|
||||
if (current_cpu == "arm") {
|
||||
|
@ -662,7 +656,10 @@ if (is_win) {
|
|||
"/Gw",
|
||||
]
|
||||
}
|
||||
common_optimize_on_ldflags = [ "/OPT:REF" ]
|
||||
common_optimize_on_ldflags = [
|
||||
"/OPT:REF",
|
||||
"/OPT:ICF",
|
||||
]
|
||||
} else {
|
||||
common_optimize_on_cflags = [
|
||||
# Don't emit the GCC version ident directives, they just end up in the
|
||||
|
@ -693,6 +690,10 @@ if (is_win) {
|
|||
# See http://lwn.net/Articles/192624/ .
|
||||
"-Wl,-O1",
|
||||
"-Wl,--gc-sections",
|
||||
|
||||
# Identical code folding to reduce size.
|
||||
# Warning: This changes C/C++ semantics of function pointer comparison.
|
||||
"-Wl,--icf=all",
|
||||
]
|
||||
|
||||
if (!using_sanitizer) {
|
||||
|
|
Loading…
Reference in a new issue