Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/perl5Public

Fix arm64 darwin hints when using use64bitall with Configure#22672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
khwilliamson merged 3 commits intoPerl:bleadfrommtsanovv:darwinarm64archhint
Oct 26, 2024

Conversation

mtsanovv
Copy link
Contributor

@mtsanovvmtsanovv commentedOct 16, 2024
edited
Loading

When using 64-bit addressing (by passing-Duse64bitall to Configure) on macOS arm64, clang throws the following cryptic error when compiling a test program:

Use which C compiler? [cc]  clang: error: invalid arch name '-arch -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gcc'clang: error: invalid arch name '-arch -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'Uh-oh, the C compiler 'cc' doesn't seem to be working.'cc' ' -fno-common -DPERL_DARWIN -mmacosx-version-min=11 -arch  -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gcc -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/gcc -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -mmacosx-version-min=11' ' -mmacosx-version-min=11 -arch  -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'

The first commit is to handle thearm 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 extraexit 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:

Which of these apply, if any? [darwin]  Adding -mmacosx-version-min=10.14 to ccflagsAdding -mmacosx-version-min=10.14 to ldflags*** Don't recognize processor, can't specify 64 bit compilation.

After the second commit is added, the following Configure output that I saw before went missing:

Configure uses the operating system name and version to set some defaults.The default value is probably right if the name rings a bell. Otherwise,since spelling matters for me, either accept the default or answer "none"to leave it blank.Operating system name? [darwin]   Operating system version? [24.0.0]  By default, perl5 will be installed in /Users/mtsan/perl/gen/out/bin, manual pagesunder /Users/mtsan/perl/gen/out/man, etc..., i.e. with /Users/mtsan/perl/gen/out as prefix for allinstallation directories. Typically this is something like /usr/local.If you wish to have binaries under /usr/bin but other parts of theinstallation under /usr/local, that's ok: you will be promptedseparately for each of the installation directories, the prefix beingonly used to set the defaults.Installation prefix to use? (~name ok)[/Users/mtsan/perl/gen/out]   AFS does not seem to be running...In some special cases, particularly when building perl5 for distribution,it is convenient to distinguish the directory in which files should beinstalled from the directory (/Users/mtsan/perl/gen/out) in which they willeventually reside.  For most users, these two directories are the same.What installation prefix should I use for installing files? (~name ok)[/Users/mtsan/perl/gen/out]  Perl can be built to offer a form of threading support on some systemsTo do so, Configure can be run with -Dusethreads.Note that Perl built with threading support runs slightly slowerand uses slightly more memory than plain Perl.If this doesn't make any sense to you, just accept the default 'y'.Build a threading Perl? [y]  (Your platform does not have any specific hints for threaded builds. Assuming POSIX threads, then.)Perl can be built so that multiple Perl interpreters can coexistwithin the same Perl executable.This multiple interpreter support is required for interpreter-based threads. Use which C compiler? [cc]

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.

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.
@mtsanovv
Copy link
ContributorAuthor

mtsanovv commentedOct 24, 2024
edited
Loading

Could somebody take a look at this?

@Leont
Copy link
Contributor

Looks sensible to me, but I don't run mac

@mtsanovv
Copy link
ContributorAuthor

mtsanovv commentedOct 26, 2024
edited
Loading

@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.

@khwilliamsonkhwilliamson merged commit5403449 intoPerl:bleadOct 26, 2024
@khwilliamson
Copy link
Contributor

благодаря ви

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@mtsanovv@Leont@khwilliamson@jkeenan

[8]ページ先頭

©2009-2025 Movatter.jp