mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[infra] Roll clang toolchain forward
Change-Id: I41afe48f2fdc056436b58dc8158c62e9207cc43f Reviewed-on: https://dart-review.googlesource.com/32140 Commit-Queue: Zach Anderson <zra@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
parent
a0abc35f60
commit
8ee7a97651
8
DEPS
8
DEPS
|
@ -30,9 +30,11 @@ vars = {
|
||||||
|
|
||||||
"co19_rev": "@dec2b67aaab3bb7339b9764049707e71e601da3d",
|
"co19_rev": "@dec2b67aaab3bb7339b9764049707e71e601da3d",
|
||||||
|
|
||||||
# Revisions of GN related dependencies. This should match the revision
|
# As Flutter does, we pull buildtools, including the clang toolchain, from
|
||||||
# pulled by Flutter.
|
# Fuchsia. This revision should be kept up to date with the revision pulled
|
||||||
"buildtools_revision": "@057ef89874e3c622248cf99259434fdc683c4e30",
|
# by the Flutter engine. If there are problems with the toolchain, contact
|
||||||
|
# fuchsia-toolchain@.
|
||||||
|
"buildtools_revision": "@de2d6da936fa0be8bcb0bacd096fe124efff2854",
|
||||||
|
|
||||||
# Scripts that make 'git cl format' work.
|
# Scripts that make 'git cl format' work.
|
||||||
"clang_format_scripts_rev": "@c09c8deeac31f05bd801995c475e7c8070f9ecda",
|
"clang_format_scripts_rev": "@c09c8deeac31f05bd801995c475e7c8070f9ecda",
|
||||||
|
|
|
@ -341,9 +341,9 @@ config("compiler") {
|
||||||
# define into the compile line.
|
# define into the compile line.
|
||||||
if (is_clang && (is_linux || is_mac)) {
|
if (is_clang && (is_linux || is_mac)) {
|
||||||
if (is_linux) {
|
if (is_linux) {
|
||||||
toolchain_stamp_file = "//buildtools/linux64/toolchain.stamp"
|
toolchain_stamp_file = "//buildtools/linux64/clang.stamp"
|
||||||
} else {
|
} else {
|
||||||
toolchain_stamp_file = "//buildtools/mac/toolchain.stamp"
|
toolchain_stamp_file = "//buildtools/mac/clang.stamp"
|
||||||
}
|
}
|
||||||
toolchain_version = read_file(toolchain_stamp_file, "trim string")
|
toolchain_version = read_file(toolchain_stamp_file, "trim string")
|
||||||
defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ]
|
defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ]
|
||||||
|
@ -503,6 +503,10 @@ if (is_win) {
|
||||||
"-Wno-unused-parameter", # Unused function parameters.
|
"-Wno-unused-parameter", # Unused function parameters.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (is_clang) {
|
||||||
|
default_warning_flags += [ "-Wno-tautological-constant-compare" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
# TODO(abarth): Re-enable once https://github.com/domokit/mojo/issues/728
|
# TODO(abarth): Re-enable once https://github.com/domokit/mojo/issues/728
|
||||||
# is fixed.
|
# is fixed.
|
||||||
|
|
|
@ -46,17 +46,8 @@ template("android_gcc_toolchain") {
|
||||||
|
|
||||||
is_clang = invoker.is_clang
|
is_clang = invoker.is_clang
|
||||||
if (is_clang) {
|
if (is_clang) {
|
||||||
host_suffix = ""
|
prefix =
|
||||||
if (host_os == "linux") {
|
rebase_path("//buildtools/${host_os}-x64/clang/bin", root_build_dir)
|
||||||
host_suffix = "x86_64-linux"
|
|
||||||
} else if (host_os == "mac") {
|
|
||||||
host_suffix = "x86_64-darwin"
|
|
||||||
} else {
|
|
||||||
assert(false, "Unknown host")
|
|
||||||
}
|
|
||||||
|
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-$host_suffix/bin",
|
|
||||||
root_build_dir)
|
|
||||||
|
|
||||||
cc = compiler_prefix + prefix + "/clang"
|
cc = compiler_prefix + prefix + "/clang"
|
||||||
cxx = compiler_prefix + prefix + "/clang++"
|
cxx = compiler_prefix + prefix + "/clang++"
|
||||||
|
|
|
@ -40,6 +40,9 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
||||||
# Location of the strip executable. When specified, strip will be run on
|
# Location of the strip executable. When specified, strip will be run on
|
||||||
# all executables as they are built. The stripped artifacts will be put in
|
# all executables as they are built. The stripped artifacts will be put in
|
||||||
# exe.stripped/.
|
# exe.stripped/.
|
||||||
|
# - llvm_objcopy
|
||||||
|
# Location of the llvm-objcopy executable. Used as strip instead of strip
|
||||||
|
# when specified.
|
||||||
template("gcc_toolchain") {
|
template("gcc_toolchain") {
|
||||||
toolchain(target_name) {
|
toolchain(target_name) {
|
||||||
assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
|
assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
|
||||||
|
@ -193,7 +196,7 @@ template("gcc_toolchain") {
|
||||||
outfile = "{{root_out_dir}}/$exename"
|
outfile = "{{root_out_dir}}/$exename"
|
||||||
rspfile = "$outfile.rsp"
|
rspfile = "$outfile.rsp"
|
||||||
|
|
||||||
if (defined(invoker.strip)) {
|
if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) {
|
||||||
stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
|
stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,6 +206,11 @@ template("gcc_toolchain") {
|
||||||
strip_command =
|
strip_command =
|
||||||
"${strip} --strip-unneeded -o $stripped_outfile $outfile"
|
"${strip} --strip-unneeded -o $stripped_outfile $outfile"
|
||||||
command += " && " + strip_command
|
command += " && " + strip_command
|
||||||
|
} else if (defined(invoker.llvm_objcopy)) {
|
||||||
|
strip = invoker.llvm_objcopy
|
||||||
|
strip_command =
|
||||||
|
"${strip} --strip-all $outfile $stripped_outfile"
|
||||||
|
command += " && " + strip_command
|
||||||
}
|
}
|
||||||
if (defined(invoker.postlink)) {
|
if (defined(invoker.postlink)) {
|
||||||
command += " && " + invoker.postlink
|
command += " && " + invoker.postlink
|
||||||
|
@ -212,7 +220,7 @@ template("gcc_toolchain") {
|
||||||
outputs = [
|
outputs = [
|
||||||
outfile,
|
outfile,
|
||||||
]
|
]
|
||||||
if (defined(invoker.strip)) {
|
if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) {
|
||||||
outputs += [ stripped_outfile ]
|
outputs += [ stripped_outfile ]
|
||||||
}
|
}
|
||||||
if (defined(invoker.link_outputs)) {
|
if (defined(invoker.link_outputs)) {
|
||||||
|
|
|
@ -46,11 +46,12 @@ gcc_toolchain("clang_arm") {
|
||||||
root_build_dir)
|
root_build_dir)
|
||||||
cc = "${compiler_prefix}${prefix}/clang"
|
cc = "${compiler_prefix}${prefix}/clang"
|
||||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||||
readelf = "readelf"
|
|
||||||
|
readelf = "${prefix}/llvm-readelf"
|
||||||
nm = "${prefix}/llvm-nm"
|
nm = "${prefix}/llvm-nm"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
ld = cxx
|
ld = cxx
|
||||||
strip = "${prefix}/strip"
|
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||||
|
|
||||||
toolchain_cpu = "arm"
|
toolchain_cpu = "arm"
|
||||||
toolchain_os = "linux"
|
toolchain_os = "linux"
|
||||||
|
@ -78,8 +79,7 @@ gcc_toolchain("arm64") {
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_toolchain("clang_arm64") {
|
gcc_toolchain("clang_arm64") {
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
|
||||||
root_build_dir)
|
|
||||||
cc = "${compiler_prefix}${prefix}/clang"
|
cc = "${compiler_prefix}${prefix}/clang"
|
||||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ gcc_toolchain("clang_arm64") {
|
||||||
nm = "${prefix}/llvm-nm"
|
nm = "${prefix}/llvm-nm"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
ld = cxx
|
ld = cxx
|
||||||
strip = "${prefix}/strip"
|
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||||
|
|
||||||
toolchain_cpu = "arm64"
|
toolchain_cpu = "arm64"
|
||||||
toolchain_os = "linux"
|
toolchain_os = "linux"
|
||||||
|
@ -95,15 +95,15 @@ gcc_toolchain("clang_arm64") {
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_toolchain("clang_x86") {
|
gcc_toolchain("clang_x86") {
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
|
||||||
root_build_dir)
|
|
||||||
cc = "${compiler_prefix}${prefix}/clang"
|
cc = "${compiler_prefix}${prefix}/clang"
|
||||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||||
readelf = "readelf"
|
|
||||||
|
readelf = "${prefix}/llvm-readelf"
|
||||||
nm = "${prefix}/llvm-nm"
|
nm = "${prefix}/llvm-nm"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
ld = cxx
|
ld = cxx
|
||||||
strip = "${prefix}/strip"
|
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||||
|
|
||||||
toolchain_cpu = "x86"
|
toolchain_cpu = "x86"
|
||||||
toolchain_os = "linux"
|
toolchain_os = "linux"
|
||||||
|
@ -127,16 +127,15 @@ gcc_toolchain("x86") {
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_toolchain("clang_x64") {
|
gcc_toolchain("clang_x64") {
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
|
||||||
root_build_dir)
|
|
||||||
cc = "${compiler_prefix}${prefix}/clang"
|
cc = "${compiler_prefix}${prefix}/clang"
|
||||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||||
|
|
||||||
readelf = "readelf"
|
readelf = "${prefix}/llvm-readelf"
|
||||||
nm = "${prefix}/llvm-nm"
|
nm = "${prefix}/llvm-nm"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
ld = cxx
|
ld = cxx
|
||||||
strip = "${prefix}/strip"
|
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||||
|
|
||||||
toolchain_cpu = "x64"
|
toolchain_cpu = "x64"
|
||||||
toolchain_os = "linux"
|
toolchain_os = "linux"
|
||||||
|
|
|
@ -222,8 +222,7 @@ template("mac_toolchain") {
|
||||||
mac_toolchain("clang_x64") {
|
mac_toolchain("clang_x64") {
|
||||||
toolchain_cpu = "x64"
|
toolchain_cpu = "x64"
|
||||||
toolchain_os = "mac"
|
toolchain_os = "mac"
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
|
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
|
||||||
root_build_dir)
|
|
||||||
cc = "${goma_prefix}$prefix/clang"
|
cc = "${goma_prefix}$prefix/clang"
|
||||||
cxx = "${goma_prefix}$prefix/clang++"
|
cxx = "${goma_prefix}$prefix/clang++"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
|
@ -237,8 +236,7 @@ mac_toolchain("clang_x64") {
|
||||||
mac_toolchain("clang_x86") {
|
mac_toolchain("clang_x86") {
|
||||||
toolchain_cpu = "i386"
|
toolchain_cpu = "i386"
|
||||||
toolchain_os = "mac"
|
toolchain_os = "mac"
|
||||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
|
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
|
||||||
root_build_dir)
|
|
||||||
cc = "${goma_prefix}$prefix/clang"
|
cc = "${goma_prefix}$prefix/clang"
|
||||||
cxx = "${goma_prefix}$prefix/clang++"
|
cxx = "${goma_prefix}$prefix/clang++"
|
||||||
ar = "${prefix}/llvm-ar"
|
ar = "${prefix}/llvm-ar"
|
||||||
|
|
|
@ -14,7 +14,6 @@ THIS_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
DART_ROOT = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))
|
DART_ROOT = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))
|
||||||
BUILDTOOLS = os.path.join(DART_ROOT, 'buildtools')
|
BUILDTOOLS = os.path.join(DART_ROOT, 'buildtools')
|
||||||
TOOLS_BUILDTOOLS = os.path.join(DART_ROOT, 'tools', 'buildtools')
|
TOOLS_BUILDTOOLS = os.path.join(DART_ROOT, 'tools', 'buildtools')
|
||||||
TOOLCHAIN = os.path.join(BUILDTOOLS, 'toolchain')
|
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(DART_ROOT, 'tools'))
|
sys.path.insert(0, os.path.join(DART_ROOT, 'tools'))
|
||||||
import find_depot_tools
|
import find_depot_tools
|
||||||
|
@ -24,7 +23,7 @@ DEPOT_PATH = find_depot_tools.add_depot_tools_to_path()
|
||||||
|
|
||||||
def Update():
|
def Update():
|
||||||
path = os.path.join(BUILDTOOLS, 'update.sh')
|
path = os.path.join(BUILDTOOLS, 'update.sh')
|
||||||
command = ['/bin/bash', path, '--toolchain', '--gn']
|
command = ['/bin/bash', path, '--clang', '--gn']
|
||||||
return subprocess.call(command, cwd=DART_ROOT)
|
return subprocess.call(command, cwd=DART_ROOT)
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,17 +73,19 @@ def UpdateClangFormatOnWindows():
|
||||||
def CopyClangFormat():
|
def CopyClangFormat():
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
platform = 'darwin'
|
platform = 'darwin'
|
||||||
subdir = 'mac'
|
tools = 'mac'
|
||||||
|
toolchain = 'mac-x64'
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
platform = 'linux'
|
platform = 'linux'
|
||||||
subdir = 'linux64'
|
tools = 'linux64'
|
||||||
|
toolchain = 'linux-x64'
|
||||||
else:
|
else:
|
||||||
print 'Unknown platform: ' + sys.platform
|
print 'Unknown platform: ' + sys.platform
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
clang_format = os.path.join(
|
clang_format = os.path.join(
|
||||||
TOOLCHAIN, 'clang+llvm-x86_64-' + platform, 'bin', 'clang-format')
|
BUILDTOOLS, toolchain, 'clang', 'bin', 'clang-format')
|
||||||
dest = os.path.join(BUILDTOOLS, subdir, 'clang-format')
|
dest = os.path.join(BUILDTOOLS, tools, 'clang-format')
|
||||||
shutil.copy2(clang_format, dest)
|
shutil.copy2(clang_format, dest)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue