This is an archive of the discontinued LLVM Phabricator instance.

Add a LLVM_USE_LINKER that defines the linker to use when building LLVM
ClosedPublic

Authored by mehdi_amini on Jan 14 2017, 7:07 PM.

Details

Summary

This string parameter is passed to -fuse-ld when linking. It can be
an absolute path to your custom linker, otherwise clang will look for
ld.{name}.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to Add a LLVM_USE_LINKER that defines the linker to use when building LLVM.
mehdi_amini updated this object.
mehdi_amini added reviewers: davide, tejohnson, pcc.
mehdi_amini added a subscriber: llvm-commits.

Fix missing endif()

Restore unintended removal of warning on Apple when using LLD and LTO, and fix tailing whitespace.

davide edited edge metadata.Jan 14 2017, 7:14 PM

This is a nice improvement. Some comments inline.

llvm/cmake/modules/HandleLLVMOptions.cmake
99–101 ↗(On Diff #84472)

I think still emitting a diagnostic in this case would be good. In general, I think we should emit a diagnostic on every linker that can't do LTO when we try to do it. Why did you remove it?

llvm/docs/CMake.rst
385–389 ↗(On Diff #84472)

Hmm, this can be expanded a bit. If clang is used as base compiler, what you say is perfectly fine.
But gcc has some limitations:

  1. it doesn't support absoule paths.
  2. it hardcodes a couple of values, bfd/gold and rejects everything else.
mehdi_amini edited edge metadata.

Expand a bit the doc as pointed by Davide.

davide accepted this revision.Jan 14 2017, 7:21 PM
davide edited edge metadata.

LGTM modulo nit.

llvm/cmake/modules/HandleLLVMOptions.cmake
159–161 ↗(On Diff #84475)

I think the correct spelling is doesn't

This revision is now accepted and ready to land.Jan 14 2017, 7:21 PM
This revision was automatically updated to reflect the committed changes.