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

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: 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 # As needed has a history of having problems with asan. See 234010 and
Nico 2015/01/27 04:39:38 fwiw,i like the comment in build/common.gypi more
956 # 452105 for examples.
957 common_optimize_on_ldflags += [ "-Wl,--as-needed" ]
958 }
954 } 959 }
955 } 960 }
956 961
957 # Default "optimization on" config. On Windows, this favors size over speed. 962 # Default "optimization on" config. On Windows, this favors size over speed.
958 config("optimize") { 963 config("optimize") {
959 cflags = common_optimize_on_cflags 964 cflags = common_optimize_on_cflags
960 ldflags = common_optimize_on_ldflags 965 ldflags = common_optimize_on_ldflags
961 if (is_win) { 966 if (is_win) {
962 cflags += [ "/Os" ] # favor size over speed. 967 cflags += [ "/Os" ] # favor size over speed.
963 } else if (is_android || is_ios) { 968 } else if (is_android || is_ios) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 cflags += [ "-gsplit-dwarf" ] 1055 cflags += [ "-gsplit-dwarf" ]
1051 } 1056 }
1052 } 1057 }
1053 } 1058 }
1054 1059
1055 config("no_symbols") { 1060 config("no_symbols") {
1056 if (!is_win) { 1061 if (!is_win) {
1057 cflags = [ "-g0" ] 1062 cflags = [ "-g0" ]
1058 } 1063 }
1059 } 1064 }
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