Index: llvm/utils/gn/secondary/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/BUILD.gn +++ llvm/utils/gn/secondary/BUILD.gn @@ -8,6 +8,12 @@ "//clang/lib/Serialization", "//clang/tools/clang-format", "//lld/test", + "//llvm/tools/llvm-cat", + "//llvm/tools/llvm-lto", + "//llvm/tools/llvm-lto2", + "//llvm/tools/llvm-modextract", + "//llvm/tools/llvm-profdata", + "//llvm/tools/llvm-symbolizer:symlinks", "//llvm/tools/llvm-undname", ] testonly = true @@ -65,6 +71,11 @@ "//llvm/tools/llvm-readobj:symlinks", ] } +group("llvm-symbolizer") { + deps = [ + "//llvm/tools/llvm-symbolizer:symlinks", + ] +} # A pool called "console" in the root BUILD.gn is magic and represents ninja's # built-in console pool. (Requires a GN with `gn --version` >= 552353.) Index: llvm/utils/gn/secondary/llvm/tools/llvm-cat/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-cat/BUILD.gn @@ -0,0 +1,12 @@ +executable("llvm-cat") { + deps = [ + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/Support", + ] + sources = [ + "llvm-cat.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-lto/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-lto/BUILD.gn @@ -0,0 +1,17 @@ +executable("llvm-lto") { + deps = [ + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/LTO", + "//llvm/lib/MC", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Target", + "//llvm/lib/Target:TargetsToBuild", + ] + sources = [ + "llvm-lto.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-lto2/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-lto2/BUILD.gn @@ -0,0 +1,16 @@ +executable("llvm-lto2") { + deps = [ + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/IR", + "//llvm/lib/LTO", + "//llvm/lib/Linker", + "//llvm/lib/MC", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Target", + "//llvm/lib/Target:TargetsToBuild", + ] + sources = [ + "llvm-lto2.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-modextract/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-modextract/BUILD.gn @@ -0,0 +1,12 @@ +executable("llvm-modextract") { + deps = [ + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/Support", + ] + sources = [ + "llvm-modextract.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn @@ -0,0 +1,10 @@ +executable("llvm-profdata") { + deps = [ + "//llvm/lib/IR", + "//llvm/lib/ProfileData", + "//llvm/lib/Support", + ] + sources = [ + "llvm-profdata.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-symbolizer/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-symbolizer/BUILD.gn @@ -0,0 +1,36 @@ +import("//llvm/tools/binutils_symlinks.gni") +import("//llvm/utils/gn/build/symlink_or_copy.gni") + +if (llvm_install_binutils_symlinks) { + symlink_or_copy("addr2line") { + deps = [ + ":llvm-symbolizer", + ] + source = "llvm-symbolizer" + output = "$root_out_dir/bin/addr2line" + } +} + +# //:llvm-symbolizer depends on this symlink target, see comment in //BUILD.gn. +group("symlinks") { + deps = [ + ":llvm-symbolizer", + ] + if (llvm_install_binutils_symlinks) { + deps += [ ":addr2line" ] + } +} + +executable("llvm-symbolizer") { + deps = [ + "//llvm/lib/DebugInfo/DWARF", + "//llvm/lib/DebugInfo/PDB", + "//llvm/lib/DebugInfo/Symbolize", + "//llvm/lib/Demangle", + "//llvm/lib/Object", + "//llvm/lib/Support", + ] + sources = [ + "llvm-symbolizer.cpp", + ] +}