[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 13 15:55:00 PST 2025


bd1976bris wrote:

> If I were to convert [this example](https://gist.github.com/MaskRay/24f4e2eed208b9d8b0a3752575a665d4#distributed-thinlto) to its functional equivalent in DTLTO, would it be:
> 
> ```
> clang -fuse-ld=lld -O2 -flto=thin -fthinlto-distributor=distributor_process a.c b.c c.c
> ```

In essence, yes. I was able to get the example to link using DTLTO (via the simple: [local.py](https://github.com/bd1976bris/llvm-project/blob/main/llvm/utils/dtlto/local.py)) with the following:

> clang -flto=thin -fuse-ld=lld a.c b.c c.c elf0.c elf1.c -fthinlto-distributor=$(which python3) -Xdist $LLVMSRC/llvm/utils/dtlto/local.py

This isn't a faithful port of the example because that uses --start-lib, --end-lib to make a virtual archive from `b.o` and `c.o`  but I don't think that detail matters.

> Is that correct?

Yes. A dump of the JSON generated can be seen [here](https://gist.github.com/bd1976bris/625a077aec170aace5ca8685c992f161).

https://github.com/llvm/llvm-project/pull/126654


More information about the cfe-commits mailing list