[llvm] r348945 - [gn build] Add all non-test build files for lld
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 12 09:57:11 PST 2018
Author: nico
Date: Wed Dec 12 09:57:10 2018
New Revision: 348945
URL: http://llvm.org/viewvc/llvm-project?rev=348945&view=rev
Log:
[gn build] Add all non-test build files for lld
Version.inc.in processing has a potentially interesting part which I've punted
on for now (LLD_REVISION and LLD_REPOSITORY are set to empty strings for now).
lld now builds in the gn build. But no symlinks to it are created yet, so it
can't be meaningfully run yet.
Differential Revision: https://reviews.llvm.org/D55593
Added:
llvm/trunk/utils/gn/secondary/lld/
llvm/trunk/utils/gn/secondary/lld/COFF/
llvm/trunk/utils/gn/secondary/lld/COFF/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/Common/
llvm/trunk/utils/gn/secondary/lld/Common/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/ELF/
llvm/trunk/utils/gn/secondary/lld/ELF/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/MinGW/
llvm/trunk/utils/gn/secondary/lld/MinGW/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/include/
llvm/trunk/utils/gn/secondary/lld/include/lld/
llvm/trunk/utils/gn/secondary/lld/include/lld/Common/
llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/lib/
llvm/trunk/utils/gn/secondary/lld/lib/Core/
llvm/trunk/utils/gn/secondary/lld/lib/Core/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/lib/Driver/
llvm/trunk/utils/gn/secondary/lld/lib/Driver/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/
llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/tools/
llvm/trunk/utils/gn/secondary/lld/tools/lld/
llvm/trunk/utils/gn/secondary/lld/tools/lld/BUILD.gn
llvm/trunk/utils/gn/secondary/lld/wasm/
llvm/trunk/utils/gn/secondary/lld/wasm/BUILD.gn
Modified:
llvm/trunk/utils/gn/build/libs/xml/BUILD.gn
llvm/trunk/utils/gn/secondary/BUILD.gn
Modified: llvm/trunk/utils/gn/build/libs/xml/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/libs/xml/BUILD.gn?rev=348945&r1=348944&r2=348945&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/libs/xml/BUILD.gn (original)
+++ llvm/trunk/utils/gn/build/libs/xml/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -6,7 +6,7 @@ config("xml_config") {
defines = [ "LLVM_LIBXML2_ENABLED" ]
libs = [ "xml2" ]
if (host_os == "mac") {
- include_dirs = [ "$mac_sdk/usr/include/libxml2" ]
+ include_dirs = [ "$mac_sdk_path/usr/include/libxml2" ]
} else {
include_dirs = [ "/usr/include/libxml2" ]
}
Modified: llvm/trunk/utils/gn/secondary/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/BUILD.gn?rev=348945&r1=348944&r2=348945&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -1,6 +1,6 @@
group("default") {
deps = [
- "//llvm/lib/LTO",
+ "//lld/tools/lld",
"//llvm/tools/llc",
"//llvm/tools/llvm-undname",
]
Added: llvm/trunk/utils/gn/secondary/lld/COFF/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/COFF/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/COFF/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/COFF/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,44 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("Options") {
+ visibility = [ ":COFF" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+static_library("COFF") {
+ output_name = "lldCOFF"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ ":Options",
+ "//lld/Common",
+ "//llvm/lib/BinaryFormat",
+ "//llvm/lib/DebugInfo/CodeView",
+ "//llvm/lib/DebugInfo/MSF",
+ "//llvm/lib/DebugInfo/PDB",
+ "//llvm/lib/IR",
+ "//llvm/lib/LTO",
+ "//llvm/lib/MC",
+ "//llvm/lib/Object",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target:TargetsToBuild",
+ "//llvm/lib/ToolDrivers/llvm-lib:LibDriver",
+ "//llvm/lib/WindowsManifest",
+ ]
+ sources = [
+ "Chunks.cpp",
+ "DLL.cpp",
+ "Driver.cpp",
+ "DriverUtils.cpp",
+ "ICF.cpp",
+ "InputFiles.cpp",
+ "LTO.cpp",
+ "MapFile.cpp",
+ "MarkLive.cpp",
+ "MinGW.cpp",
+ "PDB.cpp",
+ "SymbolTable.cpp",
+ "Symbols.cpp",
+ "Writer.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/Common/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/Common/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/Common/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/Common/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,28 @@
+static_library("Common") {
+ output_name = "lldCommon"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ public_deps = [
+ # public_dep because public header Version.h includes generated Version.inc.
+ "//lld/include/lld/Common:version",
+ ]
+ deps = [
+ "//llvm/lib/CodeGen",
+ "//llvm/lib/Demangle",
+ "//llvm/lib/IR",
+ "//llvm/lib/MC",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target",
+ ]
+ sources = [
+ "Args.cpp",
+ "ErrorHandler.cpp",
+ "Memory.cpp",
+ "Reproduce.cpp",
+ "Strings.cpp",
+ "TargetOptionsCommandFlags.cpp",
+ "Threads.cpp",
+ "Timer.cpp",
+ "Version.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/ELF/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/ELF/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/ELF/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/ELF/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,64 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("Options") {
+ visibility = [ ":ELF" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+static_library("ELF") {
+ output_name = "lldELF"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ ":Options",
+ "//lld/Common",
+ "//llvm/lib/BinaryFormat",
+ "//llvm/lib/DebugInfo/DWARF",
+ "//llvm/lib/IR",
+ "//llvm/lib/LTO",
+ "//llvm/lib/MC",
+ "//llvm/lib/Object",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target:TargetsToBuild",
+ ]
+ include_dirs = [ "." ]
+ sources = [
+ "AArch64ErrataFix.cpp",
+ "Arch/AArch64.cpp",
+ "Arch/AMDGPU.cpp",
+ "Arch/ARM.cpp",
+ "Arch/AVR.cpp",
+ "Arch/Hexagon.cpp",
+ "Arch/Mips.cpp",
+ "Arch/MipsArchTree.cpp",
+ "Arch/PPC.cpp",
+ "Arch/PPC64.cpp",
+ "Arch/RISCV.cpp",
+ "Arch/SPARCV9.cpp",
+ "Arch/X86.cpp",
+ "Arch/X86_64.cpp",
+ "CallGraphSort.cpp",
+ "DWARF.cpp",
+ "Driver.cpp",
+ "DriverUtils.cpp",
+ "EhFrame.cpp",
+ "Filesystem.cpp",
+ "ICF.cpp",
+ "InputFiles.cpp",
+ "InputSection.cpp",
+ "LTO.cpp",
+ "LinkerScript.cpp",
+ "MapFile.cpp",
+ "MarkLive.cpp",
+ "OutputSections.cpp",
+ "Relocations.cpp",
+ "ScriptLexer.cpp",
+ "ScriptParser.cpp",
+ "SymbolTable.cpp",
+ "Symbols.cpp",
+ "SyntheticSections.cpp",
+ "Target.cpp",
+ "Thunks.cpp",
+ "Writer.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/MinGW/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/MinGW/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/MinGW/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/MinGW/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,21 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("Options") {
+ visibility = [ ":MinGW" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+static_library("MinGW") {
+ output_name = "lldMinGW"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ ":Options",
+ "//lld/COFF",
+ "//lld/Common",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "Driver.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,26 @@
+import("//llvm/version.gni")
+
+action("version") {
+ script = "//llvm/utils/gn/build/write_cmake_config.py"
+
+ sources = [
+ "Version.inc.in",
+ ]
+ outputs = [
+ "$target_gen_dir/Version.inc",
+ ]
+ args = [
+ "-o",
+ rebase_path(outputs[0], root_out_dir),
+
+ rebase_path(sources[0], root_out_dir),
+
+ "LLD_VERSION=$llvm_version",
+ "LLD_VERSION_MAJOR=$llvm_version_major",
+ "LLD_VERSION_MINOR=$llvm_version_minor",
+
+ # FIXME: Real values for these:
+ "LLD_REVISION=",
+ "LLD_REPOSITORY=",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/lib/Core/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/lib/Core/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/lib/Core/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/lib/Core/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,20 @@
+static_library("Core") {
+ output_name = "lldCore"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ "//llvm/lib/BinaryFormat",
+ "//llvm/lib/MC",
+ "//llvm/lib/Support",
+ "//llvm/utils/gn/build/libs/pthread",
+ ]
+ sources = [
+ "DefinedAtom.cpp",
+ "Error.cpp",
+ "File.cpp",
+ "LinkingContext.cpp",
+ "Reader.cpp",
+ "Resolver.cpp",
+ "SymbolTable.cpp",
+ "Writer.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/lib/Driver/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/lib/Driver/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/lib/Driver/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/lib/Driver/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,24 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("DarwinLdOptions") {
+ visibility = [ ":Driver" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+static_library("Driver") {
+ output_name = "lldDriver"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ ":DarwinLdOptions",
+ "//lld/Common",
+ "//lld/lib/Core",
+ "//lld/lib/ReaderWriter",
+ "//lld/lib/ReaderWriter/MachO",
+ "//lld/lib/ReaderWriter/YAML",
+ "//llvm/lib/Option",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "DarwinLdDriver.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,17 @@
+static_library("ReaderWriter") {
+ output_name = "lldReaderWriter"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ "//lld/lib/Core",
+ "//llvm/lib/Object",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "FileArchive.cpp",
+ ]
+
+ # FIXME:
+ # if (is_msvc) {
+ # cflags = [ "-wd4062" ]
+ # }
+}
Added: llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/MachO/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,33 @@
+static_library("MachO") {
+ output_name = "lldMachO"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ "//lld/lib/Core",
+ "//lld/lib/ReaderWriter/YAML",
+ "//llvm/lib/DebugInfo/DWARF",
+ "//llvm/lib/Demangle",
+ "//llvm/lib/Object",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "ArchHandler.cpp",
+ "ArchHandler_arm.cpp",
+ "ArchHandler_arm64.cpp",
+ "ArchHandler_x86.cpp",
+ "ArchHandler_x86_64.cpp",
+ "CompactUnwindPass.cpp",
+ "GOTPass.cpp",
+ "LayoutPass.cpp",
+ "MachOLinkingContext.cpp",
+ "MachONormalizedFileBinaryReader.cpp",
+ "MachONormalizedFileBinaryWriter.cpp",
+ "MachONormalizedFileFromAtoms.cpp",
+ "MachONormalizedFileToAtoms.cpp",
+ "MachONormalizedFileYAML.cpp",
+ "ObjCPass.cpp",
+ "ShimPass.cpp",
+ "StubsPass.cpp",
+ "TLVPass.cpp",
+ "WriterMachO.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/lib/ReaderWriter/YAML/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,11 @@
+static_library("YAML") {
+ output_name = "lldYAML"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ "//lld/lib/Core",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "ReaderWriterYAML.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/tools/lld/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/tools/lld/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/tools/lld/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/tools/lld/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,16 @@
+# FIXME: Set up symlinks pointing to lld.
+
+executable("lld") {
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ "//lld/COFF",
+ "//lld/ELF",
+ "//lld/MinGW",
+ "//lld/lib/Driver",
+ "//lld/wasm",
+ "//llvm/lib/Support",
+ ]
+ sources = [
+ "lld.cpp",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/lld/wasm/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/wasm/BUILD.gn?rev=348945&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/wasm/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/lld/wasm/BUILD.gn Wed Dec 12 09:57:10 2018
@@ -0,0 +1,32 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("Options") {
+ visibility = [ ":wasm" ]
+ args = [ "-gen-opt-parser-defs" ]
+}
+
+static_library("wasm") {
+ output_name = "lldWasm"
+ configs += [ "//llvm/utils/gn/build:lld_code" ]
+ deps = [
+ ":Options",
+ "//lld/Common",
+ "//llvm/lib/BinaryFormat",
+ "//llvm/lib/Demangle",
+ "//llvm/lib/IR",
+ "//llvm/lib/Object",
+ "//llvm/lib/Option",
+ ]
+ sources = [
+ "Driver.cpp",
+ "InputChunks.cpp",
+ "InputFiles.cpp",
+ "LTO.cpp",
+ "MarkLive.cpp",
+ "OutputSections.cpp",
+ "SymbolTable.cpp",
+ "Symbols.cpp",
+ "Writer.cpp",
+ "WriterUtils.cpp",
+ ]
+}
More information about the llvm-commits
mailing list