This is an archive of the discontinued LLVM Phabricator instance.

Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning
ClosedPublic

Authored by kubamracek on Nov 24 2016, 4:30 PM.

Details

Summary

Building compiler-rt on Darwin produces dozens of meaningless warnings about object files having no symbols during static archive creation. This is very intentional as compiler-rt uses #ifdefs to conditionally compile platform-specific code, and we even have a .cpp source file that only contains static asserts to make sure the environment is configured right. On Linux, this situation is fine and no warning is produces. This patch adds a libtool version detection and if it's new enough, we'll use the -no_warning_for_no_symbols flag that suppresses this warning. Build logs should be much cleaner now!

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 79267.Nov 24 2016, 4:30 PM
kubamracek retitled this revision from to Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning.
kubamracek updated this object.
kubamracek added reviewers: beanz, bogner, pete, zaks.anna.
kubamracek set the repository for this revision to rL LLVM.
kubamracek added a subscriber: llvm-commits.

Note that cctools version 862 was shipped with Xcode 6.0.

kubamracek removed rL LLVM as the repository for this revision.
beanz accepted this revision.Dec 4 2016, 8:49 PM
beanz edited edge metadata.

One minor nit below, otherwise LGTM.

CMakeLists.txt
77

You don't need to set the variable to empty, an unset variable will evaluate to empty anyways.

This revision is now accepted and ready to land.Dec 4 2016, 8:49 PM
This revision was automatically updated to reflect the committed changes.