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:
Родитель
fcd6b99663
Коммит
ac259f6da2
|
@ -307,15 +307,6 @@ config("compiler") {
|
||||||
cflags += [ "-fcolor-diagnostics" ]
|
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.
|
# C++11 compiler flags setup.
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
if (is_linux || is_android || (is_nacl && is_clang)) {
|
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).
|
# Pass the sysroot if we're using one (it requires the CPU arch also).
|
||||||
pkg_config_args = [
|
pkg_config_args = [
|
||||||
"-s",
|
"-s",
|
||||||
rebase_path(sysroot),
|
sysroot,
|
||||||
"-a",
|
"-a",
|
||||||
current_cpu,
|
current_cpu,
|
||||||
"--system_libdir",
|
"--system_libdir",
|
||||||
|
|
|
@ -13,7 +13,7 @@ assert(is_posix)
|
||||||
config("runtime_library") {
|
config("runtime_library") {
|
||||||
if (!is_mac && sysroot != "") {
|
if (!is_mac && sysroot != "") {
|
||||||
# Pass the sysroot to all C compiler variants, the assembler, and linker.
|
# 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
|
asmflags = cflags
|
||||||
ldflags = cflags
|
ldflags = cflags
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,17 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
|
||||||
} else if (is_android) {
|
} else if (is_android) {
|
||||||
import("//build/config/android/config.gni")
|
import("//build/config/android/config.gni")
|
||||||
if (current_cpu == "x86") {
|
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") {
|
} 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") {
|
} 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") {
|
} 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") {
|
} 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") {
|
} else if (current_cpu == "mips64") {
|
||||||
sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir"
|
sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir")
|
||||||
} else {
|
} else {
|
||||||
sysroot = ""
|
sysroot = ""
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,13 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
|
||||||
# By default build against a sysroot image downloaded from Cloud Storage
|
# By default build against a sysroot image downloaded from Cloud Storage
|
||||||
# during gclient runhooks.
|
# during gclient runhooks.
|
||||||
if (current_cpu == "x64") {
|
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") {
|
} 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") {
|
} 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") {
|
} else if (current_cpu == "arm") {
|
||||||
sysroot = "//build/linux/debian_wheezy_arm-sysroot"
|
sysroot = rebase_path("//build/linux/debian_wheezy_arm-sysroot")
|
||||||
} else {
|
} else {
|
||||||
# Any other builds don't use a sysroot.
|
# Any other builds don't use a sysroot.
|
||||||
sysroot = ""
|
sysroot = ""
|
||||||
|
@ -63,9 +63,7 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
|
||||||
_script_arch = "amd64"
|
_script_arch = "amd64"
|
||||||
}
|
}
|
||||||
assert(
|
assert(
|
||||||
exec_script("//build/dir_exists.py",
|
exec_script("//build/dir_exists.py", [ sysroot ], "string") == "True",
|
||||||
[ rebase_path(sysroot) ],
|
|
||||||
"string") == "True",
|
|
||||||
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$_script_arch")
|
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$_script_arch")
|
||||||
}
|
}
|
||||||
} else if (is_mac) {
|
} else if (is_mac) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче