[CMake] Add detection for the mold linker in AddLLVM.cmake.
authorFrederic Cambus <fred@statdns.com>
Tue, 28 Sep 2021 12:15:31 +0000 (17:45 +0530)
committerShivam Gupta <shivam98.tkg@gmail.com>
Tue, 28 Sep 2021 12:16:52 +0000 (17:46 +0530)
commit5b125a49ba9f52cb6b24767f3c98ce623a2d5207
tree52be565fb38faedae3142d0472483618d408331d
parent9413ead7bcbaf5d8876ee484256df65c2846c5c9
[CMake] Add detection for the mold linker in AddLLVM.cmake.

mold says it is compatible with GNU ld and gold linkers:

```
$ mold -v
mold 0.9.5 (compatible with GNU ld and GNU gold)
```

And thus it currently gets detected as Gold.

With the following diff, CMake now correctly reports the linker name, and mold keeps being identified as Gold internally for now.

Reviewed By: ldionne, MaskRay

Differential Revision: https://reviews.llvm.org/D110035
llvm/cmake/modules/AddLLVM.cmake