diff --git a/DEPS b/DEPS index 3fd8ba93c19..4c9fbb5bd68 100644 --- a/DEPS +++ b/DEPS @@ -30,11 +30,9 @@ vars = { "co19_rev": "@dec2b67aaab3bb7339b9764049707e71e601da3d", - # As Flutter does, we pull buildtools, including the clang toolchain, from - # Fuchsia. This revision should be kept up to date with the revision pulled - # by the Flutter engine. If there are problems with the toolchain, contact - # fuchsia-toolchain@. - "buildtools_revision": "@de2d6da936fa0be8bcb0bacd096fe124efff2854", + # Revisions of GN related dependencies. This should match the revision + # pulled by Flutter. + "buildtools_revision": "@057ef89874e3c622248cf99259434fdc683c4e30", # Scripts that make 'git cl format' work. "clang_format_scripts_rev": "@c09c8deeac31f05bd801995c475e7c8070f9ecda", diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 0c8bbea7e5b..12dca5d3940 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -341,9 +341,9 @@ config("compiler") { # define into the compile line. if (is_clang && (is_linux || is_mac)) { if (is_linux) { - toolchain_stamp_file = "//buildtools/linux64/clang.stamp" + toolchain_stamp_file = "//buildtools/linux64/toolchain.stamp" } else { - toolchain_stamp_file = "//buildtools/mac/clang.stamp" + toolchain_stamp_file = "//buildtools/mac/toolchain.stamp" } toolchain_version = read_file(toolchain_stamp_file, "trim string") defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ] @@ -503,10 +503,6 @@ if (is_win) { "-Wno-unused-parameter", # Unused function parameters. ] - if (is_clang) { - default_warning_flags += [ "-Wno-tautological-constant-compare" ] - } - if (is_mac) { # TODO(abarth): Re-enable once https://github.com/domokit/mojo/issues/728 # is fixed. diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn index 8568ef7a4da..38f95b92b4f 100644 --- a/build/toolchain/android/BUILD.gn +++ b/build/toolchain/android/BUILD.gn @@ -46,8 +46,17 @@ template("android_gcc_toolchain") { is_clang = invoker.is_clang if (is_clang) { - prefix = - rebase_path("//buildtools/${host_os}-x64/clang/bin", root_build_dir) + 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) cc = compiler_prefix + prefix + "/clang" cxx = compiler_prefix + prefix + "/clang++" diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index b21a7d1b27c..08dd4179a0a 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -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 # all executables as they are built. The stripped artifacts will be put in # exe.stripped/. -# - llvm_objcopy -# Location of the llvm-objcopy executable. Used as strip instead of strip -# when specified. template("gcc_toolchain") { toolchain(target_name) { assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") @@ -196,7 +193,7 @@ template("gcc_toolchain") { outfile = "{{root_out_dir}}/$exename" rspfile = "$outfile.rsp" - if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) { + if (defined(invoker.strip)) { stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename" } @@ -206,11 +203,6 @@ template("gcc_toolchain") { strip_command = "${strip} --strip-unneeded -o $stripped_outfile $outfile" 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)) { command += " && " + invoker.postlink @@ -220,7 +212,7 @@ template("gcc_toolchain") { outputs = [ outfile, ] - if (defined(invoker.strip) || defined(invoker.llvm_objcopy)) { + if (defined(invoker.strip)) { outputs += [ stripped_outfile ] } if (defined(invoker.link_outputs)) { diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn index 313deba7522..7a3d2dfe0a4 100644 --- a/build/toolchain/linux/BUILD.gn +++ b/build/toolchain/linux/BUILD.gn @@ -46,12 +46,11 @@ gcc_toolchain("clang_arm") { root_build_dir) cc = "${compiler_prefix}${prefix}/clang" cxx = "${compiler_prefix}${prefix}/clang++" - - readelf = "${prefix}/llvm-readelf" + readelf = "readelf" nm = "${prefix}/llvm-nm" ar = "${prefix}/llvm-ar" ld = cxx - llvm_objcopy = "${prefix}/llvm-objcopy" + strip = "${prefix}/strip" toolchain_cpu = "arm" toolchain_os = "linux" @@ -79,7 +78,8 @@ gcc_toolchain("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" cxx = "${compiler_prefix}${prefix}/clang++" @@ -87,7 +87,7 @@ gcc_toolchain("clang_arm64") { nm = "${prefix}/llvm-nm" ar = "${prefix}/llvm-ar" ld = cxx - llvm_objcopy = "${prefix}/llvm-objcopy" + strip = "${prefix}/strip" toolchain_cpu = "arm64" toolchain_os = "linux" @@ -95,15 +95,15 @@ gcc_toolchain("clang_arm64") { } 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" cxx = "${compiler_prefix}${prefix}/clang++" - - readelf = "${prefix}/llvm-readelf" + readelf = "readelf" nm = "${prefix}/llvm-nm" ar = "${prefix}/llvm-ar" ld = cxx - llvm_objcopy = "${prefix}/llvm-objcopy" + strip = "${prefix}/strip" toolchain_cpu = "x86" toolchain_os = "linux" @@ -127,15 +127,16 @@ gcc_toolchain("x86") { } 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" cxx = "${compiler_prefix}${prefix}/clang++" - readelf = "${prefix}/llvm-readelf" + readelf = "readelf" nm = "${prefix}/llvm-nm" ar = "${prefix}/llvm-ar" ld = cxx - llvm_objcopy = "${prefix}/llvm-objcopy" + strip = "${prefix}/strip" toolchain_cpu = "x64" toolchain_os = "linux" diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 4ed409af76c..4ccc69b24c6 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -222,7 +222,8 @@ template("mac_toolchain") { mac_toolchain("clang_x64") { toolchain_cpu = "x64" 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" cxx = "${goma_prefix}$prefix/clang++" ar = "${prefix}/llvm-ar" @@ -236,7 +237,8 @@ mac_toolchain("clang_x64") { mac_toolchain("clang_x86") { toolchain_cpu = "i386" 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" cxx = "${goma_prefix}$prefix/clang++" ar = "${prefix}/llvm-ar" diff --git a/tools/buildtools/update.py b/tools/buildtools/update.py index 8658059c130..43560c0af13 100755 --- a/tools/buildtools/update.py +++ b/tools/buildtools/update.py @@ -14,6 +14,7 @@ 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 @@ -23,7 +24,7 @@ DEPOT_PATH = find_depot_tools.add_depot_tools_to_path() def Update(): 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) @@ -73,19 +74,17 @@ def UpdateClangFormatOnWindows(): def CopyClangFormat(): if sys.platform == 'darwin': platform = 'darwin' - tools = 'mac' - toolchain = 'mac-x64' + subdir = 'mac' elif sys.platform.startswith('linux'): platform = 'linux' - tools = 'linux64' - toolchain = 'linux-x64' + subdir = 'linux64' else: print 'Unknown platform: ' + sys.platform return 1 clang_format = os.path.join( - BUILDTOOLS, toolchain, 'clang', 'bin', 'clang-format') - dest = os.path.join(BUILDTOOLS, tools, 'clang-format') + TOOLCHAIN, 'clang+llvm-x86_64-' + platform, 'bin', 'clang-format') + dest = os.path.join(BUILDTOOLS, subdir, 'clang-format') shutil.copy2(clang_format, dest) return 0