summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/config/compiler/BUILD.gn8
-rw-r--r--build/config/linux/pkg_config.gni2
-rw-r--r--build/config/posix/BUILD.gn2
-rw-r--r--build/config/sysroot.gni24
-rw-r--r--printing/BUILD.gn4
5 files changed, 25 insertions, 15 deletions
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index ab0d6c5..57b614c 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -307,6 +307,14 @@ config("compiler") {
cflags += [ "-fcolor-diagnostics" ]
}
+ # Makes builds independent of absolute file path.
+ # 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_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)) {
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni
index 58769e2..9ab1de9 100644
--- a/build/config/linux/pkg_config.gni
+++ b/build/config/linux/pkg_config.gni
@@ -52,7 +52,7 @@ if (sysroot != "") {
# Pass the sysroot if we're using one (it requires the CPU arch also).
pkg_config_args = [
"-s",
- sysroot,
+ rebase_path(sysroot),
"-a",
current_cpu,
"--system_libdir",
diff --git a/build/config/posix/BUILD.gn b/build/config/posix/BUILD.gn
index 6f65443..1abbceb 100644
--- a/build/config/posix/BUILD.gn
+++ b/build/config/posix/BUILD.gn
@@ -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=" + sysroot ]
+ cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
asmflags = cflags
ldflags = cflags
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index 29a2b61..dcd215a 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -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 = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir")
+ sysroot = "$android_ndk_root/$x86_android_sysroot_subdir"
} else if (current_cpu == "arm") {
- sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir")
+ sysroot = "$android_ndk_root/$arm_android_sysroot_subdir"
} else if (current_cpu == "mipsel") {
- sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir")
+ sysroot = "$android_ndk_root/$mips_android_sysroot_subdir"
} else if (current_cpu == "x64") {
- sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir")
+ sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir"
} else if (current_cpu == "arm64") {
- sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir")
+ sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir"
} else if (current_cpu == "mips64") {
- sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir")
+ sysroot = "$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 = rebase_path("//build/linux/debian_wheezy_amd64-sysroot")
+ sysroot = "//build/linux/debian_wheezy_amd64-sysroot"
} else if (current_cpu == "x86") {
- sysroot = rebase_path("//build/linux/debian_wheezy_i386-sysroot")
+ sysroot = "//build/linux/debian_wheezy_i386-sysroot"
} else if (current_cpu == "mipsel") {
- sysroot = rebase_path("//build/linux/debian_wheezy_mips-sysroot")
+ sysroot = "//build/linux/debian_wheezy_mips-sysroot"
} else if (current_cpu == "arm") {
- sysroot = rebase_path("//build/linux/debian_wheezy_arm-sysroot")
+ sysroot = "//build/linux/debian_wheezy_arm-sysroot"
} else {
# Any other builds don't use a sysroot.
sysroot = ""
@@ -63,7 +63,9 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
_script_arch = "amd64"
}
assert(
- exec_script("//build/dir_exists.py", [ sysroot ], "string") == "True",
+ exec_script("//build/dir_exists.py",
+ [ rebase_path(sysroot) ],
+ "string") == "True",
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$_script_arch")
}
} else if (is_mac) {
diff --git a/printing/BUILD.gn b/printing/BUILD.gn
index 45dfcc8..3b05be4 100644
--- a/printing/BUILD.gn
+++ b/printing/BUILD.gn
@@ -131,7 +131,7 @@ component("printing") {
cups_version = exec_script("cups_config_helper.py",
[
"--api-version",
- sysroot,
+ rebase_path(sysroot),
],
"trim string")
@@ -254,7 +254,7 @@ if (use_cups) {
libs = exec_script("cups_config_helper.py",
[
"--libs-for-gn",
- sysroot,
+ rebase_path(sysroot),
],
"value")
}