Fix arm64 darwin hints when using use64bitall with Configure #22672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using 64-bit addressing (by passing
-Duse64bitall
to Configure) on macOS arm64, clang throws the following cryptic error when compiling a test program:The first commit is to handle the
arm
output fromuname -p
and respectively to pass the proper architecture -arm64
right after the-arch
flag that would otherwise be dangling.Just in case some time in the future Apple introduces a yet another CPU architecture to their Mac devices, I decided to add an extra
exit 1
with the second commit so that the Configure error would be the last thing that is displayed to the user. This way, we don't see the cryptic clang error:After the second commit is added, the following Configure output that I saw before went missing:
Personally, I believe that this is a good tradeoff. If Configure can't do better but pass a dangling
-arch
flag, then maybe it is a good idea to exit as early as possible so that the user can either add a hint for their CPU architecture (and then create a PR here like I did) or just call Configure without 64-bit addressing. However, if any of the reviewers think that this is something that should not be done, I'll be fine with reverting the second commit.This set of changes does not require a perldelta entry.