This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Avoid using unwind library in the MSVC environment
ClosedPublic

Authored by phosek on Aug 23 2022, 12:30 AM.

Details

Summary

We're seeing the following warnings with --rtlib=compiler-rt:

  
lld-link: warning: ignoring unknown argument '--as-needed'
lld-link: warning: ignoring unknown argument '-lunwind'
lld-link: warning: ignoring unknown argument '--no-as-needed'

MSVC doesn't use the unwind library, so just omit it.

Diff Detail

Event Timeline

phosek created this revision.Aug 23 2022, 12:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2022, 12:30 AM
phosek requested review of this revision.Aug 23 2022, 12:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2022, 12:30 AM
mstorsjo accepted this revision.Aug 23 2022, 12:39 AM

LGTM.

(Should we have a testcase for this, or is it trivial enough to just go as is?)

This revision is now accepted and ready to land.Aug 23 2022, 12:39 AM
phosek updated this revision to Diff 455020.Aug 23 2022, 5:08 PM

Test added.

This revision was landed with ongoing or failed builds.Aug 23 2022, 5:09 PM
This revision was automatically updated to reflect the committed changes.

This reverts commit eca29d4a37b8d1c93fe99be6289a60bb11cf789d since the test fails in the per-target-runtime-dir layout.

Does that mean that the testcase ended up looking at other libraries next to clang, in the build dir where the tests are run? That's rather annoying... I guess it could be fixed by adding -resource-dir in the testcase? (And ideally in the future, by making a harder switch between the two runtime install layouts in clang, as discussed on Discourse.)

This reverts commit eca29d4a37b8d1c93fe99be6289a60bb11cf789d since the test fails in the per-target-runtime-dir layout.

Does that mean that the testcase ended up looking at other libraries next to clang, in the build dir where the tests are run? That's rather annoying... I guess it could be fixed by adding -resource-dir in the testcase? (And ideally in the future, by making a harder switch between the two runtime install layouts in clang, as discussed on Discourse.)

Yes, that's the issue, I added -resource-dir which is the solution we use in other tests as well.