Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for arm64e (iOS/macOS) #863

Closed
glen-mac opened this issue Nov 14, 2022 · 4 comments
Closed

No support for arm64e (iOS/macOS) #863

glen-mac opened this issue Nov 14, 2022 · 4 comments

Comments

@glen-mac
Copy link

I am building something with XCode 14.1 and passing "-fuse-ld=mold" through setting the LD_FLAGS argument to xcodebuild.

mold is returning:

mold: fatal: unknown -arch: arm64e

How difficult would it be to support arm64e?

@adouble042
Copy link

interesting because building using clang from llvm.org fails because -macos_version_min is what ld64.mold expects and the actual parameter being used is -macosx_version_min...but llvm.org clang passes -arch arm64 which works. it seems the Xcode clang is passing -arch arm64e to the linker which is different. can fix both problems, with -arch and -macos_version_min by looking in macho/cmdline.cc and amending it there. for -arch look for the line starting with "else if (arg == "arm64" " and patch to "else if (arg == "arm64" || arg == "arm64e")" to fix the problem you are having and for the other one "else if (read_arg("-macosx_version_min")) {" can become "else if (read_arg("-macosx_version_min") || read_arg("-macos_version_min")) {"
however this does not solve another problem I have; when linking against the libraries extracted from the dynamic linker cache for arm64e instead of the stub libraries, I get a segfault. it has to be in the code reading the library as the tbd support works...I will attempt to debug this , and find exactly where. I took a look but it was not in a debug build and I was not overly concerned. it had no problem though reading the archive libraries from the clang support libs.
this isn't my normal GitHub account, hence the one post, I am just unable to log in easily and haven't in a while so I created this one to respond to this issue
also I'd be happy to contribute especially if we could see the arm64e support be integrated to the gnu style linker. I am working on toolchains and have maintained an fork of the old ld64 of apples specifically to keep compatibility with that convention, and made a very functional support for much of the stuff apple removed..I maintain a lot of static libraries including a fairly complete libc and in fact I can say that supporting the gnu feature set may not be what apple is providing but there is call for it...
if you make the adjustments to cmdline.cc above you should be able to link with Xcode. it's using stub libraries and those don't cause a problem

@rui314
Copy link
Owner

rui314 commented Nov 22, 2022

arm64e is an ARM64 ABI with pointer authentication. It shouldn't be too hard to support it, but we need to learn the ABI first.

@Marvin-alt
Copy link

I am building something with XCode 14.1 and passing "-fuse-ld=mold" through setting the LD_FLAGS argument to xcodebuild.

mold is returning:

mold: fatal: unknown -arch: arm64e

How difficult would it be to support arm64e?

@rui314
Copy link
Owner

rui314 commented Oct 27, 2024

This is obsolete. mold does not support macOS, and its macOS version (sold) is no longer maintained. Please use Apple's linker instead.

@rui314 rui314 closed this as completed Oct 27, 2024
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

No branches or pull requests

4 participants