OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |