This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] suppress LNK4221 warning when creating static libraries
ClosedPublic

Authored by inglorion on Jan 3 2017, 4:14 PM.

Details

Summary

We put empty object files in archives, which causes MSVC's linker to
complain about these objects not defining any previously undefined
symbols. Since we do it on purpose, this only creates noise during
the build process. This patch causes us to suppress the warnings.

Diff Detail

Repository
rL LLVM

Event Timeline

inglorion updated this revision to Diff 82968.Jan 3 2017, 4:14 PM
inglorion retitled this revision from to [compiler-rt] suppress LNK4221 warning when creating static libraries.
inglorion updated this object.
inglorion added reviewers: rnk, samsonov.
rnk accepted this revision.Jan 4 2017, 9:45 AM
rnk edited edge metadata.

lgtm

CMakeLists.txt
229–231 ↗(On Diff #82968)

I'd simplify the first two sentences to something like:
Silence MSVC linker warning about empty object files. The sanitizer libraries intentionally use ifdefs to compile out entire files, rather than skipping them in the build system. Ideally, ...

The reader should already know that we aim to have zero warnings and that we silence noisy warnings.

This revision is now accepted and ready to land.Jan 4 2017, 9:45 AM
inglorion updated this revision to Diff 83096.Jan 4 2017, 11:43 AM
inglorion edited edge metadata.

Reworded comment as per @rnk's suggestion.

inglorion updated this revision to Diff 83097.Jan 4 2017, 11:45 AM

Remove changes that were unintentionally pulled in.

inglorion updated this revision to Diff 83098.Jan 4 2017, 11:46 AM

One more time...

This revision was automatically updated to reflect the committed changes.