This is an archive of the discontinued LLVM Phabricator instance.

Fix -fuse-ld feature detection error.
ClosedPublic

Authored by ruiu on Oct 24 2017, 6:34 PM.

Details

Summary

check_cxx_compiler_flag doesn't seem to try to link a program, so
the existing code doesn't correctly detect the availability of a given
linker. This patch uses check_cxx_source_compiles instead.

I confirmed that cmake now reports this error

Host compiler does not support '-fuse-ld=foo'

for -DLLVM_USE_LINKER=foo.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Oct 24 2017, 6:34 PM
ruiu added a comment.Oct 25 2017, 7:37 AM

Are you suggesting I use check_cxx_comipler_flags instead of check_cxx_source_compiles, or something different?

lichray accepted this revision.Oct 25 2017, 10:19 AM
In D39274#906587, @ruiu wrote:

Are you suggesting I use check_cxx_comipler_flags instead of check_cxx_source_compiles, or something different?

Never mind, I didn't saw you already be using CMAKE_REQUIRED_FLAGS.

This revision is now accepted and ready to land.Oct 25 2017, 10:19 AM
This revision was automatically updated to reflect the committed changes.