Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 882443003: Disable -Wl,--as-needed in sanitizer mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change comment to the gypi one. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 if (cpu_arch == "arm") { 6 if (cpu_arch == "arm") {
7 import("//build/config/arm.gni") 7 import("//build/config/arm.gni")
8 } 8 }
9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { 9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") {
10 import("//build/config/mips.gni") 10 import("//build/config/mips.gni")
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 if (symbol_level == 2) { 941 if (symbol_level == 2) {
942 # Mac dead code stripping requires symbols. 942 # Mac dead code stripping requires symbols.
943 common_optimize_on_ldflags += [ "-Wl,-dead_strip" ] 943 common_optimize_on_ldflags += [ "-Wl,-dead_strip" ]
944 } 944 }
945 } else { 945 } else {
946 # Non-Mac Posix linker flags. 946 # Non-Mac Posix linker flags.
947 common_optimize_on_ldflags += [ 947 common_optimize_on_ldflags += [
948 # Specifically tell the linker to perform optimizations. 948 # Specifically tell the linker to perform optimizations.
949 # See http://lwn.net/Articles/192624/ . 949 # See http://lwn.net/Articles/192624/ .
950 "-Wl,-O1", 950 "-Wl,-O1",
951 "-Wl,--as-needed",
952 "-Wl,--gc-sections", 951 "-Wl,--gc-sections",
953 ] 952 ]
953
954 if (!using_sanitizer) {
955 # Functions interposed by the sanitizers can make ld think
956 # that some libraries aren't needed when they actually are,
957 # http://crbug.com/234010. As workaround, disable --as-needed.
958 common_optimize_on_ldflags += [ "-Wl,--as-needed" ]
959 }
954 } 960 }
955 } 961 }
956 962
957 # Default "optimization on" config. On Windows, this favors size over speed. 963 # Default "optimization on" config. On Windows, this favors size over speed.
958 config("optimize") { 964 config("optimize") {
959 cflags = common_optimize_on_cflags 965 cflags = common_optimize_on_cflags
960 ldflags = common_optimize_on_ldflags 966 ldflags = common_optimize_on_ldflags
961 if (is_win) { 967 if (is_win) {
962 cflags += [ "/Os" ] # favor size over speed. 968 cflags += [ "/Os" ] # favor size over speed.
963 } else if (is_android || is_ios) { 969 } else if (is_android || is_ios) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 cflags += [ "-gsplit-dwarf" ] 1056 cflags += [ "-gsplit-dwarf" ]
1051 } 1057 }
1052 } 1058 }
1053 } 1059 }
1054 1060
1055 config("no_symbols") { 1061 config("no_symbols") {
1056 if (!is_win) { 1062 if (!is_win) {
1057 cflags = [ "-g0" ] 1063 cflags = [ "-g0" ]
1058 } 1064 }
1059 } 1065 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698