mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
[LLD] Allow usage of LLD as a library
As discussed in https://github.com/llvm/llvm-project/issues/53475 this patch allows using LLD-as-a-lib. It also lets clients link only the drivers that they want (see unit tests). This also adds the unit test infra as in the other LLVM projects. Among the test coverage, I've added the original issue from @krzysz00, see: https://github.com/ROCmSoftwarePlatform/D108850-lld-bug-reproduction Important note: this doesn't allow (yet) linking in parallel. This will come a bit later, in subsequent patches, for COFF at last. Differential revision: https://reviews.llvm.org/D119049
This commit is contained in:
@@ -84,7 +84,7 @@ private:
|
||||
|
||||
bool link(ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS,
|
||||
llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput) {
|
||||
// This driver-specific context will be freed later by lldMain().
|
||||
// This driver-specific context will be freed later by unsafeLldMain().
|
||||
auto *ctx = new CommonLinkerContext;
|
||||
|
||||
ctx->e.initialize(stdoutOS, stderrOS, exitEarly, disableOutput);
|
||||
|
||||
Reference in New Issue
Block a user