diff options
Diffstat (limited to 'build/config/compiler/BUILD.gn')
-rw-r--r-- | build/config/compiler/BUILD.gn | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index f5b1d46068..78a52a0435 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -67,10 +67,6 @@ declare_args() { # Requires profiling to be set to true. enable_full_stack_frames_for_profiling = false - # When we are going to use gold we need to find it. - # This is initialized below, after use_gold might have been overridden. - gold_path = "" - # Enable fatal linker warnings. Building Chromium with certain versions # of binutils can cause linker warning. fatal_linker_warnings = true @@ -208,19 +204,9 @@ declare_args() { declare_args() { # Set to true to use icf, Identical Code Folding. - # - # icf=all is broken in older golds, see - # https://sourceware.org/bugzilla/show_bug.cgi?id=17704 - # chromeos binutils has been patched with the fix, so always use icf there. - # The bug only affects x86 and x64, so we can still use ICF when targeting - # other architectures. - # - # lld doesn't have the bug. use_icf = (is_posix || is_fuchsia) && !is_debug && !using_sanitizer && !use_clang_coverage && current_os != "zos" && - !(is_android && use_order_profiling) && - (use_lld || (use_gold && (is_chromeos || !(current_cpu == "x86" || - current_cpu == "x64")))) + !(is_android && use_order_profiling) && use_lld } if (is_android) { @@ -515,35 +501,6 @@ config("compiler") { # Linux-specific compiler flags setup. # ------------------------------------ - if (use_gold) { - ldflags += [ "-fuse-ld=gold" ] - if (!is_android) { - # On Android, this isn't needed. gcc in the NDK knows to look next to - # it with -fuse-ld=gold, and clang gets a --gcc-toolchain flag passed - # above. - if (gold_path != "") { - ldflags += [ "-B$gold_path" ] - } - - ldflags += [ - # Experimentation found that using four linking threads - # saved ~20% of link time. - # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 - # Only apply this to the target linker, since the host - # linker might not be gold, but isn't used much anyway. - "-Wl,--threads", - "-Wl,--thread-count=4", - ] - } - - # TODO(thestig): Make this flag work with GN. - #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan || is_msan)) { - # ldflags += [ - # "-Wl,--detect-odr-violations", - # ] - #} - } - if (use_icf && (!is_apple || use_lld)) { ldflags += [ "-Wl,--icf=all" ] } @@ -2372,7 +2329,7 @@ if (is_win) { common_optimize_on_ldflags += [ # Specifically tell the linker to perform optimizations. # See http://lwn.net/Articles/192624/ . - # -O2 enables string tail merge optimization in gold and lld. + # -O2 enables string tail merge optimization in lld. "-Wl,-O2", "-Wl,--gc-sections", ] @@ -2804,7 +2761,7 @@ config("symbols") { # sections" there. Maybe just a bug in nacl_switch_32.S. _enable_gdb_index = symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" && - current_os != "zos" && (use_gold || use_lld) && + current_os != "zos" && use_lld && # Disable on non-fission 32-bit Android because it pushes # libcomponents_unittests over the 4gb size limit. !(is_android && !use_debug_fission && current_cpu != "x64" && |