This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Add linker detection for Apple platforms
ClosedPublic

Authored by smeenai on Jun 14 2018, 3:33 PM.

Details

Summary

LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since ld64.lld -v doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Jun 14 2018, 3:33 PM
compnerd accepted this revision.Jun 14 2018, 4:09 PM

It really is unfortunate that linkers can spell version differently :-(. It would be really nice to be able to unify the linker version detection.

llvm/cmake/modules/AddLLVM.cmake
157 ↗(On Diff #151432)

YES is better than ON here IMO

This revision is now accepted and ready to land.Jun 14 2018, 4:09 PM
smeenai added inline comments.Jun 14 2018, 4:11 PM
llvm/cmake/modules/AddLLVM.cmake
157 ↗(On Diff #151432)

I'll change this (and all the ones below) in a follow-up.

This revision was automatically updated to reflect the committed changes.