I'm working towards making LLD configurable in the same way LLVM is. Its build iterates over LLVM_TARGETS_TO_BUILD, including only those directories. This patch is the first step in making LLD follow suit. It merges the X86_64 library into the X86 library. No functionality is changed.
Diff Detail
- Repository
- rL LLVM
Event Timeline
Do we really need to do this? The build time for each target is tiny, and they don't have dependencies on the llvm targets.
No, we don't have to do this. We don't have to do anything. This is open source!
I believe we'd have an easier time recruiting more target-specific expertise if LLD is rethought as 2 pieces, the LLVM Integrated Linker and a ld-compatible front-end called 'lld'. I'd want to eventually merge both into the LLVM repo. <lld>/tools/lld would sit in <llvm>/tools/lld. <lld>/lib/ReaderWriter/{arch} would be merged into <llvm>/lib/Target/{arch}. After this migration, it'd be natural to add a section for Linker Support to:
http://llvm.org/docs/WritingAnLLVMBackend.html
Imagine the implications of that bit of documentation. Ultimately, I want LLD to follow all the same patterns as the integrated assembler. I believe its success could be partially credited to its tight integration.
-Greg
This is a pretty drastic departure from the original vision for lld. I would rather we discuss this on llvm-dev before pursuing it. Please start a discussion thread there.
So it doesn't look like there's much interest in moving lld into the llvm repo, but I'd still like to move forward with supporting LLVM_TARGETS_TO_BUILD. Here's what needs to be done:
- Land this patch.
- Move target-specific code into lib/Target.
- Reorg the tests
After this reorg, there would be no separate ELF libs - just Arch libs. We could also move lib/ReaderWriter/ELF up to lib/ELF so that all lld libs are leaves of the directory tree. lld's directory structure seems awkward to me. I usually don't see subdirectories have dependencies on their parent directories - only the other way around.
I don't see the point in merging 32bit and 64bit x86 backend into one directory. They share very few common properties, i.e. all the relocations are different, the TLS models are different etc.
I think I was only looking at this from the perspective of the build and not from the developer. Since the two targets are conceptually distinct, I don't want to create confusion by merging the directories.