Index: llvm/utils/gn/build/BUILDCONFIG.gn =================================================================== --- llvm/utils/gn/build/BUILDCONFIG.gn +++ llvm/utils/gn/build/BUILDCONFIG.gn @@ -26,7 +26,9 @@ } if (host_os == "win") { - set_default_toolchain("//llvm/utils/gn/build/toolchain:win") + host_toolchain = "//llvm/utils/gn/build/toolchain:win" } else { - set_default_toolchain("//llvm/utils/gn/build/toolchain:unix") + host_toolchain = "//llvm/utils/gn/build/toolchain:unix" } + +set_default_toolchain(host_toolchain) Index: llvm/utils/gn/secondary/clang/utils/TableGen/clang_tablegen.gni =================================================================== --- llvm/utils/gn/secondary/clang/utils/TableGen/clang_tablegen.gni +++ llvm/utils/gn/secondary/clang/utils/TableGen/clang_tablegen.gni @@ -35,7 +35,6 @@ "visibility", ]) - # FIXME: In cross builds, this should depend on the host binary. tblgen_target = "//clang/utils/TableGen:clang-tblgen" } } Index: llvm/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni =================================================================== --- llvm/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni +++ llvm/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni @@ -39,9 +39,9 @@ if (defined(invoker.tblgen_target)) { tblgen_target = invoker.tblgen_target } else { - # FIXME: In cross builds, this should depend on the host binary. tblgen_target = "//llvm/utils/TableGen:llvm-tblgen" } + tblgen_target += "($host_toolchain)" tblgen_executable = get_label_info(tblgen_target, "root_out_dir") + "/bin/" + get_label_info(tblgen_target, "name") deps = [