This is an archive of the discontinued LLVM Phabricator instance.

[CMake][libunwind] Use -nodefaultlibs for CMake checks
ClosedPublic

Authored by phosek on Apr 3 2017, 7:11 PM.

Details

Summary

Since libunwind is built with -nodefaultlibs, we should be using this option even for CMake checks to avoid any inconsistency and also to avoid dependency on a working C++ standard library just for the setting up the build itself, because check_cxx_compile_flags adds the flag to COMPILE_DEFINITIONS when calling try_compile and this variable is only considered for compilation but not for linking where -nodefaultlibs actually makes a difference. The implementation is largely similar to the one used by libc++.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Apr 3 2017, 7:11 PM
phosek edited the summary of this revision. (Show Details)Apr 3 2017, 7:46 PM
compnerd accepted this revision.Apr 3 2017, 9:01 PM

Sure, using the same flags sounds reasonable.

This revision is now accepted and ready to land.Apr 3 2017, 9:01 PM
This revision was automatically updated to reflect the committed changes.