This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Avoid passing -rtlib=compiler-rt when using compiler-rt
ClosedPublic

Authored by phosek on Feb 11 2019, 4:10 PM.

Details

Summary

We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt has no
effect and results in an 'argument unused during compilation' warning which
breaks the build when using -Werror. We can therefore drop -rtlib=compiler-rt
without any functional change; note that the actual compiler-rt linking is
handled by HandleCompilerRT.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Feb 11 2019, 4:10 PM
smeenai accepted this revision.Feb 11 2019, 5:28 PM

I think the commit message could be clarified a bit. Something like

We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt has no
effect and results in an 'argument unused during compilation' warning which
breaks the build when using -Werror. We can therefore drop -rtlib=compiler-rt
without any functional change; note that the actual compiler-rt linking is
handled by HandleCompilerRT.
This revision is now accepted and ready to land.Feb 11 2019, 5:28 PM
phosek edited the summary of this revision. (Show Details)Feb 11 2019, 5:30 PM

I think the commit message could be clarified a bit. Something like

We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt has no
effect and results in an 'argument unused during compilation' warning which
breaks the build when using -Werror. We can therefore drop -rtlib=compiler-rt
without any functional change; note that the actual compiler-rt linking is
handled by HandleCompilerRT.

Done, thanks!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 5:35 PM