7 Commits

Author SHA1 Message Date
Simon Tatham
e0df221dcf [clang][Driver] Rename "FatalError" key to "Error" in multilib.yaml (#110804)
This is a late-breaking change to #105684, suggested after the
original patch was already landed.
2024-10-07 09:32:06 +01:00
Simon Tatham
26bf0b4ae7
[clang][Driver] Add a custom error option in multilib.yaml. (#105684)
Sometimes a collection of multilibs has a gap in it, where a set of
driver command-line options can't work with any of the available
libraries.

For example, the Arm MVE extension requires special startup code (you
need to initialize FPSCR.LTPSIZE), and also benefits greatly from
-mfloat-abi=hard. So a multilib provider might build a library for
systems without MVE, and another for MVE with -mfloat-abi=hard,
anticipating that that's what most MVE users would want. But then if a
user compiles for MVE _without_ -mfloat-abi=hard, thhey can't use either
of those libraries – one has an ABI mismatch, and the other will fail to
set up LTPSIZE.

In that situation, it's useful to include a multilib.yaml entry for the
unworkable intermediate situation, and have it map to a fatal error
message rather than a set of actual libraries. Then the user gets a
build failure with a sensible explanation, instead of selecting an
unworkable library and silently generating bad output. The new
regression test demonstrates this case.

This patch introduces extra syntax into multilib.yaml, so that a record
in the `Variants` list can omit the `Dir` key, and in its place, provide
a `FatalError` key. Then, if that variant is selected, the error message
is emitted as a clang diagnostic, and multilib selection fails.

In order to emit the error message in `MultilibSet::select`, I had to
pass a `Driver &` to that function, which involved plumbing one through
to every call site, and in the unit tests, constructing one specially.
2024-09-02 16:56:03 +01:00
YunQiang Su
4b75fcf0a5
Triple::normalize: Use none as OS for XX-none-ABI (#89638)
When parsing a 3-component triple, after we determine Arch and Env, if
the middle component is "none", treat it as OS instead of Vendor.

See:
https://discourse.llvm.org/t/rfc-baremetal-target-triple-normalization/78524
Fixes: #89582.
2024-05-02 08:04:53 +08:00
Simon Pilgrim
7e20e13dd8 [docs] Add missing label 2023-06-14 13:08:07 +01:00
Simon Pilgrim
00b1dd82d7 [docs] Add missing empty line at start of code-block 2023-06-14 12:49:07 +01:00
Simon Pilgrim
bf449be967 [docs] Add missing empty line before lists 2023-06-14 11:42:09 +01:00
Michael Platings
a5aeba7376 [Docs] Multilib design
Reviewed By: peter.smith, MaskRay

Differential Revision: https://reviews.llvm.org/D143587
2023-06-14 06:46:42 +01:00