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 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
8 import("//build/config/compiler/compiler.gni") | 8 import("//build/config/compiler/compiler.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 # ] | 389 # ] |
390 #} | 390 #} |
391 } else if (linux_use_bundled_binutils) { | 391 } else if (linux_use_bundled_binutils) { |
392 # Gold is the default linker for the bundled binutils so we explicitly | 392 # Gold is the default linker for the bundled binutils so we explicitly |
393 # enable the bfd linker when use_gold is not set. | 393 # enable the bfd linker when use_gold is not set. |
394 ldflags += [ "-fuse-ld=bfd" ] | 394 ldflags += [ "-fuse-ld=bfd" ] |
395 } | 395 } |
396 | 396 |
397 if (is_posix && (use_gold || (use_lld && !is_nacl)) && !using_sanitizer && | 397 if (is_posix && (use_gold || (use_lld && !is_nacl)) && !using_sanitizer && |
398 !(is_android && use_order_profiling)) { | 398 !(is_android && use_order_profiling)) { |
399 # TODO(crbug.com/576197) - gcc on x86 platforms + gold + icf=all | 399 # TODO(thakis): Remove `!is_android` below once NDK gold has been rolled |
400 # doesn't currently work on non-chromeos platforms. | 400 # with the fix for https://sourceware.org/bugzilla/show_bug.cgi?id=17704 |
401 # Additionally, on Android x86 --icf=safe seems to cause issues as well. | 401 # merged. See also https://crbug.com/663886 |
402 # Additionally, on cast Android x86, --icf=all causes issues. | 402 # `linux_use_bundled_binutils` is to avoid breaking Linux distros which may |
403 if (is_android && current_cpu == "x86") { | 403 # still have a buggy gold. |
404 ldflags += [ "-Wl,--icf=none" ] | 404 if (!is_android && linux_use_bundled_binutils) { |
Nico
2017/05/10 18:13:16
This is the default everywhere, yes?
pcc1
2017/05/10 18:17:20
Yes as best as I can tell from reading the gold an
| |
405 } else if ((is_clang && !is_android) || is_chromeos || | |
406 (current_cpu != "x86" && current_cpu != "x64")) { | |
407 # TODO(thakis): Remove `!is_android` above once our gold has been rolled | |
408 # with the fix for https://sourceware.org/bugzilla/show_bug.cgi?id=17704 | |
409 # merged. See also https://crbug.com/663886 | |
410 ldflags += [ "-Wl,--icf=all" ] | 405 ldflags += [ "-Wl,--icf=all" ] |
411 } else if (!is_android || is_clang) { | |
412 ldflags += [ "-Wl,--icf=safe" ] | |
413 } | 406 } |
414 } | 407 } |
415 | 408 |
416 if (linux_use_bundled_binutils) { | 409 if (linux_use_bundled_binutils) { |
417 cflags += [ "-B$binutils_path" ] | 410 cflags += [ "-B$binutils_path" ] |
418 } | 411 } |
419 | 412 |
420 # Clang-specific compiler flags setup. | 413 # Clang-specific compiler flags setup. |
421 # ------------------------------------ | 414 # ------------------------------------ |
422 if (is_clang) { | 415 if (is_clang) { |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1751 | 1744 |
1752 if (is_ios || is_mac) { | 1745 if (is_ios || is_mac) { |
1753 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1746 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1754 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1747 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1755 config("enable_arc") { | 1748 config("enable_arc") { |
1756 common_flags = [ "-fobjc-arc" ] | 1749 common_flags = [ "-fobjc-arc" ] |
1757 cflags_objc = common_flags | 1750 cflags_objc = common_flags |
1758 cflags_objcc = common_flags | 1751 cflags_objcc = common_flags |
1759 } | 1752 } |
1760 } | 1753 } |
OLD | NEW |