Should llvm include a linker?

I've been thinking about how easy it would be to integrate lld into
the main llvm repo:

1) Preserve history with: `svnadmin load --parent-dir tools/lld . < lld.dump`
2) Move lld's target-specific libraries up to `lib/Target`, and
remaining libraries up to `lib`.
3) Move everything from the lld namespace to the llvm namespace.

But would it be valuable? I'd think that non-C, llvm-based compilers
like GHC or Rust would have the most to gain. Anybody else see value
in it? Maybe those that maintain the Target directories?

In your response, let's please avoid discussion about coding
conventions and sanitizer builds. Assume that's all resolved before
this integration is considered.

Thanks,
Greg

It’s not clear to me that this is worthwhile. Right now LLVM has no linker dependency, so there’s no pressing reason to want to fold LLD into LLVM to solve a circular dependency. LLD can just depend on LLVM to get LTO working.

It's not clear to me that this is worthwhile.

I'd think you'd see value when new languages get off the ground faster
because they don't need to think about linking. Dealing with all the
subtle differences between the various system linkers is no fun.
Maybe that's not a ton of value, but as I mentioned, the integration
is not a ton of work either.

Right now LLVM has no linker dependency

Correct, a linker dependency is not required. But by comparison,
binutils ships similar tools to llvm, but it also ships a linker.

-Greg

I think that you're conflating two issues:

- Should there be a set of libraries that allow language developers to turn IR into executables / shared libraries easily?

- Should these libraries be part of the core LLVM repository?

I don't think anyone will disagree with the first one. I believe that lld aims to provide such libraries and I hope to be able to use them. The question is whether these need to be part of the core LLVM distribution. The C front end isn't, yet there's equally an argument that using the clang libraries makes implementing an FFI for a new language easier.

David

IMO, such "set of libraries that allow language developers to turn IR into executables / shared libraries easily" would be more useful if it could use system linker.