Commit c183c84a authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Revert "win: Pass /libpath: on Windows too, and use /lldignoreenv to make lld...

Revert "win: Pass /libpath: on Windows too, and use /lldignoreenv to make lld ignore the %LIB% env var."

This reverts commit 1a693093.

Reason for revert: Apparently breaks cross builds:
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/yhbrbPU0yLQ

Original change's description:
> win: Pass /libpath: on Windows too, and use /lldignoreenv to make lld ignore the %LIB% env var.
> 
> See https://reviews.llvm.org/D67456
> 
> Makes the build a bit more hermetic, and should have no behavior change.
> 
> Bug: none
> Change-Id: I90080aa7f8ec814e6ec9b1a4fbcad464e12a450d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807154
> Auto-Submit: Nico Weber <thakis@chromium.org>
> Commit-Queue: Reid Kleckner <rnk@chromium.org>
> Reviewed-by: Reid Kleckner <rnk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#697369}

TBR=thakis@chromium.org,rnk@chromium.org

Change-Id: Idccc2a0bd54f6543734bf6f24a5cd73bbe0295d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808036Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697397}
parent 62e2c221
......@@ -142,9 +142,6 @@ config("compiler") {
# (link.exe also writes the current time, but it doesn't have a flag to
# override that behavior.)
ldflags += [ "/TIMESTAMP:" + build_timestamp ]
# Don't look for libpaths in %LIB%, similar to /X in cflags above.
ldflags += [ "/lldignoreenv" ]
}
if (!is_debug && !is_component_build) {
......
......@@ -130,17 +130,17 @@ template("msvc_toolchain") {
# ninja does not have -t msvc other than windows, and lld doesn't depend on
# mt.exe in PATH on non-Windows, so it's not needed there anyways.
if (host_os != "win") {
if (defined(invoker.sys_lib_flags)) {
linker_wrapper = ""
sys_lib_flags = "${invoker.sys_lib_flags} " # Note trailing space
} else if (defined(invoker.sys_lib_flags)) {
} else if (use_lld) {
# Invoke ninja as wrapper instead of tool wrapper, because python
# invocation requires higher cpu usage compared to ninja invocation, and
# the python wrapper is only needed to work around link.exe problems.
# TODO(thakis): Remove wrapper once lld-link can merge manifests without
# relying on mt.exe being in %PATH% on Windows, https://crbug.com/872740
linker_wrapper = "ninja -t msvc -e $env -- " # Note trailing space.
sys_lib_flags = "${invoker.sys_lib_flags} " # Note trailing space
sys_lib_flags = ""
} else {
linker_wrapper =
"$python_path $tool_wrapper_path link-wrapper $env False " # Note trailing space.
......@@ -359,6 +359,10 @@ template("win_toolchains") {
msvc_toolchain(target_name) {
environment = "environment." + toolchain_arch
cl = "${goma_prefix}\"${win_toolchain_data.vc_bin_dir}/cl.exe\""
if (host_os != "win") {
# For win cross build
sys_lib_flags = "${win_toolchain_data.libpath_flags}"
}
toolchain_args = {
if (defined(invoker.toolchain_args)) {
......@@ -379,7 +383,10 @@ template("win_toolchains") {
cl = string_replace(cl, "/", "\\")
}
sys_include_flags = "${win_toolchain_data.include_flags_imsvc}"
sys_lib_flags = "${win_toolchain_data.libpath_flags}"
if (host_os != "win") {
# For win cross build
sys_lib_flags = "${win_toolchain_data.libpath_flags}"
}
toolchain_args = {
if (defined(invoker.toolchain_args)) {
......
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