This introduces a support for multilibs to Fuchsia driver. Unlike the
existing multilibs that are used primarily for handling different
architecture variants, we use multilibs to handle different variants
of Clang runtime libraries: -fsanitize=address and -fno-exceptions
are the two we support initially. This replaces the existing support
for sanitized runtimes libraries that was only used by Fuchsia driver
and it also refactors some of the logic to allow sharing between GNU
and Fuchsia drivers.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
clang/lib/Driver/ToolChains/CommonArgs.h | ||
---|---|---|
122 ↗ | (On Diff #196335) | Can we enforce this precondition with an assert? The '-'-prefix-not-there part is easy, but what about the "it's a driver flag" part? |
clang/test/Driver/fuchsia.cpp | ||
53 ↗ | (On Diff #196335) | What about a test for -fsanitize=address + -fno-exceptions? |
clang/lib/Driver/ToolChains/CommonArgs.h | ||
---|---|---|
122 ↗ | (On Diff #196335) | We could, but we would need to pass in the reference to Driver so we can use getOpts().ParseOneArg to parse the flag. However, we're not doing that in Multilib either at the moment even though the comment says it has to be a valid flag. I'd prefer to keep this as a pure move and then add the additional checking both here and to Multilib as a separate change, would that be fine with you? |
lgtm
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1507 ↗ | (On Diff #196335) | I'd have reduced the duplication and just used Enabled ? "+" : "-" |
clang/lib/Driver/ToolChains/Fuchsia.cpp | ||
197 ↗ | (On Diff #196335) | These two lines repeating the path construction logic could be CSEd into a lambda. |
201 ↗ | (On Diff #196335) | This merits a comment about the order they're being inserted. |
clang/test/Driver/fuchsia.cpp | ||
60 ↗ | (On Diff #196335) | Might be worth adding a test that noexcept does *not* appear by default (or explicit -fexceptions). |
clang/lib/Driver/ToolChains/Fuchsia.cpp | ||
---|---|---|
179 ↗ | (On Diff #196335) | Add a comment about the priorities. |