| 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 (is_posix) { | 9 if (is_posix) { |
| 10 import("//build/config/gcc/gcc_version.gni") | 10 import("//build/config/gcc/gcc_version.gni") |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 "-Wl,-z,now", | 176 "-Wl,-z,now", |
| 177 "-Wl,-z,relro", | 177 "-Wl,-z,relro", |
| 178 ] | 178 ] |
| 179 } | 179 } |
| 180 | 180 |
| 181 # Linux-specific compiler flags setup. | 181 # Linux-specific compiler flags setup. |
| 182 # ------------------------------------ | 182 # ------------------------------------ |
| 183 if (is_linux) { | 183 if (is_linux) { |
| 184 cflags += [ "-pthread" ] | 184 cflags += [ "-pthread" ] |
| 185 | 185 |
| 186 if (cpu_arch == "x64") { | 186 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of |
| 187 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of | 187 # address space, and it doesn't support cross-compiling). |
| 188 # address space, and it doesn't support cross-compiling). | 188 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
| 189 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 189 root_build_dir) |
| 190 root_build_dir) | 190 ldflags += [ |
| 191 ldflags += [ | 191 "-B$gold_path", |
| 192 "-B$gold_path", | |
| 193 | 192 |
| 194 # There seems to be a conflict of --icf and -pie in gold which can | 193 # There seems to be a conflict of --icf and -pie in gold which can |
| 195 # generate crashy binaries. As a security measure, -pie takes | 194 # generate crashy binaries. As a security measure, -pie takes |
| 196 # precedence for now. | 195 # precedence for now. |
| 197 # TODO(brettw) common.gypi has this only for target toolset. | 196 # TODO(brettw) common.gypi has this only for target toolset. |
| 198 #"-Wl,--icf=safe", | 197 #"-Wl,--icf=safe", |
| 199 "-Wl,--icf=none", | 198 "-Wl,--icf=none", |
| 200 | 199 |
| 201 # Experimentation found that using four linking threads | 200 # Experimentation found that using four linking threads |
| 202 # saved ~20% of link time. | 201 # saved ~20% of link time. |
| 203 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thr
ead/thread/281527606915bb36 | 202 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa
d/thread/281527606915bb36 |
| 204 # Only apply this to the target linker, since the host | 203 # Only apply this to the target linker, since the host |
| 205 # linker might not be gold, but isn't used much anyway. | 204 # linker might not be gold, but isn't used much anyway. |
| 206 # TODO(raymes): Disable threading because gold is frequently | 205 # TODO(raymes): Disable threading because gold is frequently |
| 207 # crashing on the bots: crbug.com/161942. | 206 # crashing on the bots: crbug.com/161942. |
| 208 #"-Wl,--threads", | 207 #"-Wl,--threads", |
| 209 #"-Wl,--thread-count=4", | 208 #"-Wl,--thread-count=4", |
| 210 ] | 209 ] |
| 211 } | |
| 212 | 210 |
| 213 ldflags += [ | 211 ldflags += [ |
| 214 "-pthread", | 212 "-pthread", |
| 215 ] | 213 ] |
| 216 } | 214 } |
| 217 | 215 |
| 218 # Clang-specific compiler flags setup. | 216 # Clang-specific compiler flags setup. |
| 219 # ------------------------------------ | 217 # ------------------------------------ |
| 220 if (is_clang) { | 218 if (is_clang) { |
| 221 cflags += [ | 219 cflags += [ |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 } else { | 884 } else { |
| 887 cflags = [ "-g1" ] | 885 cflags = [ "-g1" ] |
| 888 } | 886 } |
| 889 } | 887 } |
| 890 | 888 |
| 891 config("no_symbols") { | 889 config("no_symbols") { |
| 892 if (!is_win) { | 890 if (!is_win) { |
| 893 cflags = [ "-g0" ] | 891 cflags = [ "-g0" ] |
| 894 } | 892 } |
| 895 } | 893 } |
| OLD | NEW |