[infra] Fixes for cross-toolchains

toolchain_prefix was not correctly propagated everywhere it needed to
go. This CL also adds an error to build.py if someone tries to use
--toolchain as it is not supported there.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2797303005 .
This commit is contained in:
Zachary Anderson 2017-04-06 15:03:25 -07:00
parent 5c3bcff375
commit f1c7a22c43
4 changed files with 28 additions and 14 deletions

2
DEPS
View file

@ -46,7 +46,7 @@ vars = {
"barback_tag" : "@0.15.2+9",
"bazel_worker_tag": "@0.1.2",
"boolean_selector_tag" : "@1.0.2",
"boringssl_gen_rev": "@1a810313a0290e1caace9da73fa3ab89995ad2c7",
"boringssl_gen_rev": "@753224969dbe43dad29343146529727b5066c0f3",
"boringssl_rev" : "@d519bf6be0b447fb80fbc539d4bff4479b5482a2",
"charcode_tag": "@v1.1.1",
"chrome_rev" : "@19997",

View file

@ -22,13 +22,18 @@ if (use_goma) {
}
gcc_toolchain("arm") {
cc = "${compiler_prefix}arm-linux-gnueabihf-gcc"
cxx = "${compiler_prefix}arm-linux-gnueabihf-g++"
prefix = "arm-linux-gnueabihf-"
if (toolchain_prefix != "") {
prefix = toolchain_prefix
}
ar = "arm-linux-gnueabihf-ar"
cc = "${compiler_prefix}${prefix}gcc"
cxx = "${compiler_prefix}${prefix}g++"
ar = "${prefix}ar"
ld = cxx
readelf = "arm-linux-gnueabihf-readelf"
nm = "arm-linux-gnueabihf-nm"
readelf = "${prefix}readelf"
nm = "${prefix}nm"
toolchain_cpu = "arm"
toolchain_os = "linux"
@ -36,13 +41,18 @@ gcc_toolchain("arm") {
}
gcc_toolchain("arm64") {
cc = "${compiler_prefix}aarch64-linux-gnu-gcc"
cxx = "${compiler_prefix}aarch64-linux-gnu-g++"
prefix = "aarch64-linux-gnu-"
if (toolchain_prefix != "") {
prefix = toolchain_prefix
}
ar = "aarch64-linux-gnu-ar"
cc = "${compiler_prefix}${prefix}gcc"
cxx = "${compiler_prefix}${prefix}g++"
ar = "${prefix}ar"
ld = cxx
readelf = "aarch64-linux-gnu-readelf"
nm = "aarch64-linux-gnu-nm"
readelf = "${prefix}readelf"
nm = "${prefix}nm"
toolchain_cpu = "arm64"
toolchain_os = "linux"
@ -109,8 +119,8 @@ gcc_toolchain("x64") {
}
gcc_toolchain("mipsel") {
cc = "${toolchain_prefix}gcc"
cxx = "${toolchain_prefix}g++"
cc = "${compiler_prefix}${toolchain_prefix}gcc"
cxx = "${compiler_prefix}${toolchain_prefix}g++"
ar = "${toolchain_prefix}ar"
ld = cxx
readelf = "${toolchain_prefix}readelf"

View file

@ -101,7 +101,7 @@ source_set("tcmalloc") {
"-fpermissive",
]
if (!is_clang && current_cpu == "x86") {
if (!is_clang) {
cflags += [ "-Wno-format" ]
}

View file

@ -107,6 +107,10 @@ def ProcessOptions(options, args):
options.mode = options.mode.split(',')
options.arch = options.arch.split(',')
options.os = options.os.split(',')
if not options.gyp and options.toolchain != None:
print "The --toolchain flag is only supported by the gyp build."
print "When using the GN build, set the toolchain and sysroot using gn.py."
return False
for mode in options.mode:
if not mode in ['debug', 'release', 'product']:
print "Unknown mode %s" % mode