This is an archive of the discontinued LLVM Phabricator instance.

Fix all the CMake code that can only handle -stdlib= but not --stdlib=
ClosedPublic

Authored by teemperor on Sep 4 2020, 3:31 AM.

Details

Reviewers
ldionne
phosek
Group Reviewers
Restricted Project
Restricted Project
Restricted Project
Commits
rG6b7a49bb43d5: Fix all the CMake code that can only handle -stdlib= but not --stdlib=
Summary

There are several places in LLVM's CMake setup that try to remove the stdlib=... flag from the
CMake flags. All this code however only considered the -stdlib= variant of the flag but not
the alternative spelling with a double dash. This causes that when one adds --stdlib=...
to the user-provided CMake flags that this gets transformed into just - which ends up causing the
build system to think it should read the source from stdin (which then lead to very confusing build
errors).

This just adds the alternative spelling before the`-stdlib=` variant in all these places

Diff Detail

Event Timeline

teemperor created this revision.Sep 4 2020, 3:31 AM
teemperor requested review of this revision.Sep 4 2020, 3:31 AM
teemperor added reviewers: ldionne, phosek.
ldionne accepted this revision.Sep 4 2020, 8:09 AM

This LGTM, however it is an artifact of the fact that LLVM sets flags globally, and we then need to sanitize them. In the longer term, it would be nice to completely stop setting flags globally in LLVM, or to insulate the runtimes from those globally set flags somehow.

This revision is now accepted and ready to land.Sep 4 2020, 8:09 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptOct 13 2020, 7:05 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript