[llvm] r349598 - [gn build] Add build file for llvm-objcopy
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 18 18:48:01 PST 2018
Author: nico
Date: Tue Dec 18 18:48:01 2018
New Revision: 349598
URL: http://llvm.org/viewvc/llvm-project?rev=349598&view=rev
Log:
[gn build] Add build file for llvm-objcopy
Needed by check-lld.
This should've been part of r349486 but I messed up.
Differential Revision: https://reviews.llvm.org/D55831
Added:
llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/
llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn
Modified:
llvm/trunk/utils/gn/secondary/BUILD.gn
Modified: llvm/trunk/utils/gn/secondary/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/BUILD.gn?rev=349598&r1=349597&r2=349598&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/BUILD.gn Tue Dec 18 18:48:01 2018
@@ -9,6 +9,7 @@ group("default") {
"//llvm/tools/llvm-dwarfdump",
"//llvm/tools/llvm-mc",
"//llvm/tools/llvm-nm:symlinks",
+ "//llvm/tools/llvm-objcopy:symlinks",
"//llvm/tools/llvm-objdump:symlinks",
"//llvm/tools/llvm-pdbutil",
"//llvm/tools/llvm-readobj:symlinks",
@@ -59,6 +60,11 @@ group("llvm-nm") {
"//llvm/tools/llvm-nm:symlinks",
]
}
+group("llvm-objcopy") {
+ deps = [
+ "//llvm/tools/llvm-objcopy:symlinks",
+ ]
+}
group("llvm-objdump") {
deps = [
"//llvm/tools/llvm-objdump:symlinks",
Added: llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn?rev=349598&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn Tue Dec 18 18:48:01 2018
@@ -0,0 +1,57 @@
+import("//llvm/tools/binutils_symlinks.gni")
+import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/symlink_or_copy.gni")
+
+tablegen("ObjcopyOpts") {
+ visibility = [ ":llvm-objcopy" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+tablegen("StripOpts") {
+ visibility = [ ":llvm-objcopy" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+symlinks = [ "llvm-strip" ]
+if (llvm_install_binutils_symlinks) {
+ symlinks += [
+ "objcopy",
+ "strip",
+ ]
+}
+foreach(target, symlinks) {
+ symlink_or_copy(target) {
+ deps = [
+ ":llvm-objcopy",
+ ]
+ source = "llvm-objcopy"
+ output = "$root_out_dir/bin/$target"
+ }
+}
+
+# //:llvm-objcopy depends on this symlink target, see comment in //BUILD.gn.
+group("symlinks") {
+ deps = []
+ foreach(target, symlinks) {
+ deps += [ ":$target" ]
+ }
+}
+
+executable("llvm-objcopy") {
+ deps = [
+ ":ObjcopyOpts",
+ ":StripOpts",
+ "//llvm/lib/MC",
+ "//llvm/lib/Object",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ ]
+ include_dirs = [ "." ]
+ sources = [
+ "Buffer.cpp",
+ "CopyConfig.cpp",
+ "ELF/ELFObjcopy.cpp",
+ "ELF/Object.cpp",
+ "llvm-objcopy.cpp",
+ ]
+}
More information about the llvm-commits
mailing list