mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 13:08:01 +00:00
Reland: [infra] Roll clang toolchain forward
Build spuriously worked after initial roll due to stale files hanging around longer than they should have. This CL relands and updates (hopefully) all the necessary paths. R=rmacnak@google.com Review-Url: https://codereview.chromium.org/3010023002 .
This commit is contained in:
parent
e8b0a7cbf9
commit
d1b542f8cd
2
DEPS
2
DEPS
|
@ -36,7 +36,7 @@ vars = {
|
|||
|
||||
# Revisions of GN related dependencies. This should match the revision
|
||||
# pulled by Flutter.
|
||||
"buildtools_revision": "@057ef89874e3c622248cf99259434fdc683c4e30",
|
||||
"buildtools_revision": "@5b8eb38aaf523f0124756454276cd0a5b720c17e",
|
||||
|
||||
# Scripts that make 'git cl format' work.
|
||||
"clang_format_scripts_rev": "@c09c8deeac31f05bd801995c475e7c8070f9ecda",
|
||||
|
|
|
@ -329,6 +329,20 @@ config("compiler") {
|
|||
}
|
||||
}
|
||||
|
||||
# We want to force a recompile and relink of the world whenever our toolchain
|
||||
# changes since artifacts from an older version of the toolchain may or may
|
||||
# not be compatible with newer ones. To achieve this, we insert a synthetic
|
||||
# define into the compile line.
|
||||
if (is_clang && (is_linux || is_mac)) {
|
||||
if (is_linux) {
|
||||
toolchain_stamp_file = "//buildtools/linux64/clang.stamp"
|
||||
} else {
|
||||
toolchain_stamp_file = "//buildtools/mac/clang.stamp"
|
||||
}
|
||||
toolchain_version = read_file(toolchain_stamp_file, "trim string")
|
||||
defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ]
|
||||
}
|
||||
|
||||
# Assign any flags set for the C compiler to asmflags so that they are sent
|
||||
# to the assembler. The Windows assembler takes different types of flags
|
||||
# so only do so for posix platforms.
|
||||
|
|
|
@ -47,17 +47,8 @@ template("android_gcc_toolchain") {
|
|||
|
||||
is_clang = invoker.is_clang
|
||||
if (is_clang) {
|
||||
host_suffix = ""
|
||||
if (host_os == "linux") {
|
||||
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)
|
||||
prefix =
|
||||
rebase_path("//buildtools/${host_os}-x64/clang/bin", root_build_dir)
|
||||
|
||||
cc = compiler_prefix + prefix + "/clang"
|
||||
cxx = compiler_prefix + prefix + "/clang++"
|
||||
|
|
|
@ -63,8 +63,7 @@ gcc_toolchain("arm64") {
|
|||
}
|
||||
|
||||
gcc_toolchain("clang_x86") {
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
||||
root_build_dir)
|
||||
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
readelf = "readelf"
|
||||
|
@ -95,8 +94,7 @@ gcc_toolchain("x86") {
|
|||
}
|
||||
|
||||
gcc_toolchain("clang_x64") {
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
||||
root_build_dir)
|
||||
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
|
||||
|
|
|
@ -223,8 +223,7 @@ template("mac_toolchain") {
|
|||
mac_toolchain("clang_x64") {
|
||||
toolchain_cpu = "x64"
|
||||
toolchain_os = "mac"
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
|
||||
root_build_dir)
|
||||
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
|
||||
cc = "${goma_prefix}$prefix/clang"
|
||||
cxx = "${goma_prefix}$prefix/clang++"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
|
@ -238,8 +237,7 @@ mac_toolchain("clang_x64") {
|
|||
mac_toolchain("clang_x86") {
|
||||
toolchain_cpu = "i386"
|
||||
toolchain_os = "mac"
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
|
||||
root_build_dir)
|
||||
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
|
||||
cc = "${goma_prefix}$prefix/clang"
|
||||
cxx = "${goma_prefix}$prefix/clang++"
|
||||
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, '..', '..'))
|
||||
BUILDTOOLS = os.path.join(DART_ROOT, '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'))
|
||||
import find_depot_tools
|
||||
|
@ -24,7 +23,7 @@ DEPOT_PATH = find_depot_tools.add_depot_tools_to_path()
|
|||
|
||||
def Update():
|
||||
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)
|
||||
|
||||
|
||||
|
@ -74,17 +73,19 @@ def UpdateClangFormatOnWindows():
|
|||
def CopyClangFormat():
|
||||
if sys.platform == 'darwin':
|
||||
platform = 'darwin'
|
||||
subdir = 'mac'
|
||||
tools = 'mac'
|
||||
toolchain = 'mac-x64'
|
||||
elif sys.platform.startswith('linux'):
|
||||
platform = 'linux'
|
||||
subdir = 'linux64'
|
||||
tools = 'linux64'
|
||||
toolchain = 'linux-x64'
|
||||
else:
|
||||
print 'Unknown platform: ' + sys.platform
|
||||
return 1
|
||||
|
||||
clang_format = os.path.join(
|
||||
TOOLCHAIN, 'clang+llvm-x86_64-' + platform, 'bin', 'clang-format')
|
||||
dest = os.path.join(BUILDTOOLS, subdir, 'clang-format')
|
||||
BUILDTOOLS, toolchain, 'clang', 'bin', 'clang-format')
|
||||
dest = os.path.join(BUILDTOOLS, tools, 'clang-format')
|
||||
shutil.copy2(clang_format, dest)
|
||||
return 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue