Skip to content

Conversation

@statham-arm
Copy link
Contributor

ATfE doesn't currently provide any library variants built for RWPI. And if you link RWPI with non-RWPI code, nothing good will happen – they have incompatible ABIs. So we ought to give an error message rather than silently choose an incompatible library.

Using llvm/llvm-project#149132 which allowed multilib selection to be aware of the relocation model at all, this commit does the simplest possible thing: adds a catch-all error message that will trigger on any use of -frwpi, and report that there's no suitable library variant.

(Another possibility would have been to add -fno-rwpi to the validity criteria for each existing library, but that seemed less likely to give a good error message. It would allow RWPI variants to be present for some cases but not all, but at the moment, we don't need that.)

Since the error message works the same everywhere, I've just added one test.

ATfE doesn't currently provide any library variants built for RWPI.
And if you link RWPI with non-RWPI code, nothing good will happen –
they have incompatible ABIs. So we ought to give an error message
rather than silently choose an incompatible library.

Using llvm/llvm-project#149132 which allowed
multilib selection to be aware of the relocation model at all, this
commit does the simplest possible thing: adds a catch-all error
message that will trigger on _any_ use of `-frwpi`, and report that
there's no suitable library variant.

(Another possibility would have been to add `-fno-rwpi` to the
validity criteria for each existing library, but that seemed less
likely to give a good error message. It would allow RWPI variants to
be present for some cases but not all, but at the moment, we don't
need that.)

Since the error message works the same everywhere, I've just added one
test.
@statham-arm statham-arm requested a review from a team as a code owner July 18, 2025 13:01
@statham-arm statham-arm merged commit 43cc67f into arm:arm-software Jul 18, 2025
2 checks passed
@statham-arm statham-arm deleted the rwpi-error-message branch July 18, 2025 15:11
MarkMurrayARM pushed a commit to MarkMurrayARM/arm-toolchain that referenced this pull request Jul 28, 2025
ATfE doesn't currently provide any library variants built for RWPI. And
if you link RWPI with non-RWPI code, nothing good will happen – they
have incompatible ABIs. So we ought to give an error message rather than
silently choose an incompatible library.

Using llvm/llvm-project#149132 which allowed
multilib selection to be aware of the relocation model at all, this
commit does the simplest possible thing: adds a catch-all error message
that will trigger on _any_ use of `-frwpi`, and report that there's no
suitable library variant.

(Another possibility would have been to add `-fno-rwpi` to the validity
criteria for each existing library, but that seemed less likely to give
a good error message. It would allow RWPI variants to be present for
some cases but not all, but at the moment, we don't need that.)

Since the error message works the same everywhere, I've just added one
test.

(cherry picked from commit 43cc67f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants