This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fix the -nodefaultlibs check.
Needs ReviewPublic

Authored by cdavis5x on Oct 8 2018, 11:51 AM.

Details

Reviewers
mstorsjo
rnk
beanz
Summary

This is a linker flag, so we want to pass it in CMAKE_REQUIRED_FLAGS.
That way, it'll get passed during the link step.

Add some libraries on MinGW and Darwin, which need them to successfully
link.

Event Timeline

cdavis5x created this revision.Oct 8 2018, 11:51 AM

That way, it'll get passed during the link step.

When I do shared builds of libunwind (for mingw), I do get -nodefaultlibs passed, so I'm a little puzzled about why that happens. Aside from that, this change looks sane to me, and doesn't break my build.

rnk added inline comments.Oct 18 2018, 9:31 PM
cmake/config-ix.cmake
43

Do we really need a dynamic configure check here? Where is nodefaultlibs unsupported, just MSVC? If so, I'd rather drop the feature check and just say if (NOT MSVC). Does libunwind even build with MSVC?