Revert "[infra] Roll clang toolchain forward"

This reverts commit 8ee7a97651.

Reason for revert: lld optimization level -Wl,-O1 appears to either
have a regression or to confuse Golem binary comparison tool.

Original change's description:
> [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>

TBR=whesse@google.com,rmacnak@google.com,zra@google.com,athom@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I36ec03150a22f89c4cb5371dd1bf43df8a6f16f6
Reviewed-on: https://dart-review.googlesource.com/32800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This commit is contained in:
Zach Anderson 2018-01-06 07:44:57 +00:00 committed by commit-bot@chromium.org
parent cb115acf3c
commit 897c6257cd
7 changed files with 41 additions and 44 deletions

8
DEPS
View file

@ -30,11 +30,9 @@ vars = {
"co19_rev": "@dec2b67aaab3bb7339b9764049707e71e601da3d", "co19_rev": "@dec2b67aaab3bb7339b9764049707e71e601da3d",
# As Flutter does, we pull buildtools, including the clang toolchain, from # Revisions of GN related dependencies. This should match the revision
# Fuchsia. This revision should be kept up to date with the revision pulled # pulled by Flutter.
# by the Flutter engine. If there are problems with the toolchain, contact "buildtools_revision": "@057ef89874e3c622248cf99259434fdc683c4e30",
# 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",

View file

@ -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/clang.stamp" toolchain_stamp_file = "//buildtools/linux64/toolchain.stamp"
} else { } else {
toolchain_stamp_file = "//buildtools/mac/clang.stamp" toolchain_stamp_file = "//buildtools/mac/toolchain.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,10 +503,6 @@ 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.

View file

@ -46,8 +46,17 @@ template("android_gcc_toolchain") {
is_clang = invoker.is_clang is_clang = invoker.is_clang
if (is_clang) { if (is_clang) {
prefix = host_suffix = ""
rebase_path("//buildtools/${host_os}-x64/clang/bin", root_build_dir) 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)
cc = compiler_prefix + prefix + "/clang" cc = compiler_prefix + prefix + "/clang"
cxx = compiler_prefix + prefix + "/clang++" cxx = compiler_prefix + prefix + "/clang++"

View file

@ -40,9 +40,6 @@ 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")
@ -196,7 +193,7 @@ template("gcc_toolchain") {
outfile = "{{root_out_dir}}/$exename" outfile = "{{root_out_dir}}/$exename"
rspfile = "$outfile.rsp" rspfile = "$outfile.rsp"
if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) { if (defined(invoker.strip)) {
stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename" stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
} }
@ -206,11 +203,6 @@ 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
@ -220,7 +212,7 @@ template("gcc_toolchain") {
outputs = [ outputs = [
outfile, outfile,
] ]
if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) { if (defined(invoker.strip)) {
outputs += [ stripped_outfile ] outputs += [ stripped_outfile ]
} }
if (defined(invoker.link_outputs)) { if (defined(invoker.link_outputs)) {

View file

@ -46,12 +46,11 @@ 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
llvm_objcopy = "${prefix}/llvm-objcopy" strip = "${prefix}/strip"
toolchain_cpu = "arm" toolchain_cpu = "arm"
toolchain_os = "linux" toolchain_os = "linux"
@ -79,7 +78,8 @@ gcc_toolchain("arm64") {
} }
gcc_toolchain("clang_arm64") { gcc_toolchain("clang_arm64") {
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir) prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
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
llvm_objcopy = "${prefix}/llvm-objcopy" strip = "${prefix}/strip"
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/linux-x64/clang/bin", root_build_dir) prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
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
llvm_objcopy = "${prefix}/llvm-objcopy" strip = "${prefix}/strip"
toolchain_cpu = "x86" toolchain_cpu = "x86"
toolchain_os = "linux" toolchain_os = "linux"
@ -127,15 +127,16 @@ gcc_toolchain("x86") {
} }
gcc_toolchain("clang_x64") { gcc_toolchain("clang_x64") {
prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir) prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
root_build_dir)
cc = "${compiler_prefix}${prefix}/clang" cc = "${compiler_prefix}${prefix}/clang"
cxx = "${compiler_prefix}${prefix}/clang++" cxx = "${compiler_prefix}${prefix}/clang++"
readelf = "${prefix}/llvm-readelf" readelf = "readelf"
nm = "${prefix}/llvm-nm" nm = "${prefix}/llvm-nm"
ar = "${prefix}/llvm-ar" ar = "${prefix}/llvm-ar"
ld = cxx ld = cxx
llvm_objcopy = "${prefix}/llvm-objcopy" strip = "${prefix}/strip"
toolchain_cpu = "x64" toolchain_cpu = "x64"
toolchain_os = "linux" toolchain_os = "linux"

View file

@ -222,7 +222,8 @@ 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/mac-x64/clang/bin", root_build_dir) prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
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"
@ -236,7 +237,8 @@ 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/mac-x64/clang/bin", root_build_dir) prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-darwin/bin",
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"

View file

@ -14,6 +14,7 @@ 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
@ -23,7 +24,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, '--clang', '--gn'] command = ['/bin/bash', path, '--toolchain', '--gn']
return subprocess.call(command, cwd=DART_ROOT) return subprocess.call(command, cwd=DART_ROOT)
@ -73,19 +74,17 @@ def UpdateClangFormatOnWindows():
def CopyClangFormat(): def CopyClangFormat():
if sys.platform == 'darwin': if sys.platform == 'darwin':
platform = 'darwin' platform = 'darwin'
tools = 'mac' subdir = 'mac'
toolchain = 'mac-x64'
elif sys.platform.startswith('linux'): elif sys.platform.startswith('linux'):
platform = 'linux' platform = 'linux'
tools = 'linux64' subdir = '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(
BUILDTOOLS, toolchain, 'clang', 'bin', 'clang-format') TOOLCHAIN, 'clang+llvm-x86_64-' + platform, 'bin', 'clang-format')
dest = os.path.join(BUILDTOOLS, tools, 'clang-format') dest = os.path.join(BUILDTOOLS, subdir, 'clang-format')
shutil.copy2(clang_format, dest) shutil.copy2(clang_format, dest)
return 0 return 0