Revert "clang: Makes builds with clang less dependent on absolute file path"

This reverts commit fdca0741b22a4dddbf1808b8d0081651662b22c5.

This seems to break codesearch grok indexing.

BUG=580103
TBR=brettw

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

Cr-Original-Commit-Position: refs/heads/master@{#370919}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f6ea5e493b26f559ee94fcdd5b7e9a4727c62587
This commit is contained in:
dsansome 2016-01-21 23:21:17 -08:00 коммит произвёл Commit bot
Родитель fcd6b99663
Коммит ac259f6da2
4 изменённых файлов: 13 добавлений и 24 удалений

Просмотреть файл

@ -307,15 +307,6 @@ config("compiler") {
cflags += [ "-fcolor-diagnostics" ]
}
# Makes builds independent of absolute file path.
# clang-cl (used if is_win) doesn't expose this flag.
# Currently disabled for nacl since its toolchain lacks this flag (too old).
# TODO(zforman): Once nacl's toolchain is updated, remove check.
if (is_clang && !is_win && !is_nacl) {
absolute_path = rebase_path("//.")
cflags += [ "-fdebug-prefix-map=$absolute_path=." ]
}
# C++11 compiler flags setup.
# ---------------------------
if (is_linux || is_android || (is_nacl && is_clang)) {

Просмотреть файл

@ -52,7 +52,7 @@ if (sysroot != "") {
# Pass the sysroot if we're using one (it requires the CPU arch also).
pkg_config_args = [
"-s",
rebase_path(sysroot),
sysroot,
"-a",
current_cpu,
"--system_libdir",

Просмотреть файл

@ -13,7 +13,7 @@ assert(is_posix)
config("runtime_library") {
if (!is_mac && sysroot != "") {
# Pass the sysroot to all C compiler variants, the assembler, and linker.
cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
cflags = [ "--sysroot=" + sysroot ]
asmflags = cflags
ldflags = cflags

Просмотреть файл

@ -19,17 +19,17 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
} else if (is_android) {
import("//build/config/android/config.gni")
if (current_cpu == "x86") {
sysroot = "$android_ndk_root/$x86_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir")
} else if (current_cpu == "arm") {
sysroot = "$android_ndk_root/$arm_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir")
} else if (current_cpu == "mipsel") {
sysroot = "$android_ndk_root/$mips_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir")
} else if (current_cpu == "x64") {
sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir")
} else if (current_cpu == "arm64") {
sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir")
} else if (current_cpu == "mips64") {
sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir"
sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir")
} else {
sysroot = ""
}
@ -37,13 +37,13 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
# By default build against a sysroot image downloaded from Cloud Storage
# during gclient runhooks.
if (current_cpu == "x64") {
sysroot = "//build/linux/debian_wheezy_amd64-sysroot"
sysroot = rebase_path("//build/linux/debian_wheezy_amd64-sysroot")
} else if (current_cpu == "x86") {
sysroot = "//build/linux/debian_wheezy_i386-sysroot"
sysroot = rebase_path("//build/linux/debian_wheezy_i386-sysroot")
} else if (current_cpu == "mipsel") {
sysroot = "//build/linux/debian_wheezy_mips-sysroot"
sysroot = rebase_path("//build/linux/debian_wheezy_mips-sysroot")
} else if (current_cpu == "arm") {
sysroot = "//build/linux/debian_wheezy_arm-sysroot"
sysroot = rebase_path("//build/linux/debian_wheezy_arm-sysroot")
} else {
# Any other builds don't use a sysroot.
sysroot = ""
@ -63,9 +63,7 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
_script_arch = "amd64"
}
assert(
exec_script("//build/dir_exists.py",
[ rebase_path(sysroot) ],
"string") == "True",
exec_script("//build/dir_exists.py", [ sysroot ], "string") == "True",
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$_script_arch")
}
} else if (is_mac) {