Commit 0d539e12 authored by jbudorick's avatar jbudorick Committed by Commit bot

Revert of Implement arflags in the GN build. (patchset #2 id:20001 of...

Revert of Implement arflags in the GN build. (patchset #2 id:20001 of https://codereview.chromium.org/1896163003/ )

Reason for revert:
variety of compile failures on Android bots that have been switched to GN, see https://codereview.chromium.org/1896163003/#msg18

Original issue's description:
> Implement arflags in the GN build.
>
> This flag was recently added in GN. This patch hooks it up to the toolchains
> and moves some flags to use it that previously had to be hardcoded on the
> tool command itself.
>
> Remove concurrent_links variable from gcc_toolchain which was unused.
>
> BUG=598599

TBR=brucedawson@chromium.org,brettw@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=598599

Review URL: https://codereview.chromium.org/1903363003

Cr-Commit-Position: refs/heads/master@{#388646}
parent e7dc9028
......@@ -431,12 +431,6 @@ config("compiler") {
ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
}
arflags = [
"--plugin",
rebase_path("//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so",
root_build_dir),
]
# TODO(pcc): Make these flags work correctly with CFI.
if (!is_cfi) {
cflags += [
......
......@@ -103,18 +103,6 @@ config("compiler") {
assert(!is_win_fastlink, "/PROFILE and /DEBUG:FASTLINK are incompatible")
ldflags = [ "/PROFILE" ]
}
# arflags apply only to static_libraries. The normal linker configs are only
# set for executable and shared library targets so arflags must be set
# elsewhere. Since this is relatively contained, we just apply them in this
# more general config and they will only have an effect on static libraries.
arflags = [
# "No public symbols found; archive member will be inaccessible." This
# means that one or more object files in the library can never be
# pulled in to targets that link to this library. It's just a warning that
# the source file is a no-op.
"/ignore:4221",
]
}
config("vs_code_analysis") {
......
......@@ -8,6 +8,14 @@ import("//build/toolchain/cc_wrapper.gni")
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
# This value will be inherited in the toolchain below.
if (allow_posix_link_time_opt || is_cfi) {
concurrent_links =
exec_script("get_concurrent_links.py", [ "--lto" ], "value")
} else {
concurrent_links = exec_script("get_concurrent_links.py", [], "value")
}
# This template defines a toolchain for something that works like gcc
# (including clang).
#
......@@ -208,13 +216,21 @@ template("gcc_toolchain") {
tool("alink") {
rspfile = "{{output}}.rsp"
arflags = ""
if ((allow_posix_link_time_opt || is_cfi) &&
invoker.toolchain_os != "nacl") {
gold_plugin_path = rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so",
root_build_dir)
arflags = "--plugin \"$gold_plugin_path\""
}
# This needs a Python script to avoid using simple sh features in this
# command, in case the host does not use a POSIX shell (e.g. compiling
# POSIX-like toolchains such as NaCl on Windows).
ar_wrapper =
rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir)
command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" {{arflags}} rcsD @\"$rspfile\""
command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" $arflags rcsD @\"$rspfile\""
description = "AR {{output}}"
rspfile_content = "{{inputs}}"
outputs = [
......
......@@ -111,7 +111,7 @@ template("mac_toolchain") {
}
tool("alink") {
command = "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -static {{arflags}} -o {{output}} {{inputs}}"
command = "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -static -o {{output}} {{inputs}}"
description = "LIBTOOL-STATIC {{output}}"
outputs = [
"{{output_dir}}/{{target_output_name}}{{output_extension}}",
......
......@@ -145,7 +145,7 @@ template("msvc_toolchain") {
tool("alink") {
rspfile = "{{output}}.rsp"
command = "$python_path gyp-win-tool link-wrapper $env False $lib /nologo {{arflags}} /OUT:{{output}} @$rspfile"
command = "$python_path gyp-win-tool link-wrapper $env False $lib /nologo /ignore:4221 /OUT:{{output}} @$rspfile"
description = "LIB {{output}}"
outputs = [
# Ignore {{output_extension}} and always use .lib, there's no reason to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment