Commit be7c1259 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Relativize cros compiler path

Combined with https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1180801
this patch removes absolute path from command line for simple chrome build.

This is a part of effort for build cache sharing when using goma by
removing absolute path from compile result.

Bug: chromium:846610
Change-Id: Ia40a7194b4e485f26424f27ebfc210355e352cc0
Reviewed-on: https://chromium-review.googlesource.com/1180826Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584648}
parent ee73c1cd
......@@ -12,6 +12,15 @@ gcc_toolchain("target") {
ar = cros_target_ar
cc = cros_target_cc
cxx = cros_target_cxx
# Relativize path if compiler is specified such that not to lookup from $PATH.
if (cc != get_path_info(cc, "file")) {
cc = rebase_path(cc, root_build_dir)
}
if (cxx != get_path_info(cxx, "file")) {
cxx = rebase_path(cxx, root_build_dir)
}
ld = cxx
if (cros_target_ld != "") {
ld = cros_target_ld
......@@ -46,6 +55,14 @@ gcc_toolchain("nacl_bootstrap") {
ar = cros_target_ar
cc = cros_target_cc
cxx = cros_target_cxx
# Relativize path if compiler is specified such that not to lookup from $PATH.
if (cc != get_path_info(cc, "file")) {
cc = rebase_path(cc, root_build_dir)
}
if (cxx != get_path_info(cxx, "file")) {
cxx = rebase_path(cxx, root_build_dir)
}
ld = cxx
if (cros_target_ld != "") {
ld = cros_target_ld
......@@ -77,6 +94,14 @@ gcc_toolchain("host") {
ar = cros_host_ar
cc = cros_host_cc
cxx = cros_host_cxx
# Relativize path if compiler is specified such that not to lookup from $PATH.
if (cc != get_path_info(cc, "file")) {
cc = rebase_path(cc, root_build_dir)
}
if (cxx != get_path_info(cxx, "file")) {
cxx = rebase_path(cxx, root_build_dir)
}
ld = cxx
if (cros_host_ld != "") {
ld = cros_host_ld
......@@ -106,6 +131,14 @@ gcc_toolchain("v8_snapshot") {
ar = cros_v8_snapshot_ar
cc = cros_v8_snapshot_cc
cxx = cros_v8_snapshot_cxx
# Relativize path if compiler is specified such that not to lookup from $PATH.
if (cc != get_path_info(cc, "file")) {
cc = rebase_path(cc, root_build_dir)
}
if (cxx != get_path_info(cxx, "file")) {
cxx = rebase_path(cxx, root_build_dir)
}
ld = cxx
if (cros_v8_snapshot_ld != "") {
ld = cros_v8_snapshot_ld
......
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