Fix arm64 darwin hints when using use64bitall with Configure#22672
Merged
Conversation
When calling Configure with use64bitall on arm64 macOS, it compiles a test program using clang and an -arch flag that is not followed by anything. Seems like the darwin arch hint when using use64bitall couldn't work with the 'arm' result from uname -p.
Not sure if Apple are to introduce another CPU architecture to their device lineup - but they already did it 2 times. When building this on arm64 macOS, before adding the arm64 arch hint, Configure with use64bitall wouldn't exit, but a rather cryptic clang error would be thrown for an unknown arch name, simply because nothing was passed after the -arch flag.
Contributor
Author
|
Could somebody take a look at this? |
Contributor
|
Looks sensible to me, but I don't run mac |
Contributor
Author
|
@Leont, thanks for checking my PR. @jkeenan, thanks for approving the test pipeline run. I addressed the failing updateAUTHORS test. Could you please approve the workflow again? I'd greatly appreciate it if someone could merge the PR after the tests pass :) Manually patching the darwin hints to build perl for my application is causing some trouble. It'd be great to have an official perl release to use with this fix. |
Contributor
|
благодаря ви |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
-Duse64bitallto Configure) on macOS arm64, clang throws the following cryptic error when compiling a test program:The first commit is to handle the
armoutput fromuname -pand respectively to pass the proper architecture -arm64right after the-archflag 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 1with 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
-archflag, 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.