I'd like to build arm64e apps on macOS. So, I have tried to patch the Rust compiler, but I got the linked error for
building for iOS-arm64e but attempting to link with file build for unknown-arm64
I have tried to add two new targets:
They are based on:
Could you please share your tips how to add support arm64e for iOS/macOS ?
My understanding is that this requires using Apple's LLVM fork and modifications to the LLVM IR generator (in this case rustc) to specify the metadata that is checked during pointer authentication. Also do you still have to disable SIP and pass a special kernel arg for macOS to accept arm64e binaries that are not signed by Apple? Also you will need to extend the
object crate to support producing arm64e Mach-O object files and change https://github.com/rust-lang/rust/blob/c587fd418521c841f8683c58872293475b8d9b3b/compiler/rustc_codegen_ssa/src/back/metadata.rs#L185-L191 to produce arm64e binaries when using a target that uses them.
Yeah, could you explain why you'd like to do this? It's certainly possible, it's just going to be a lot of work and there might be an easier way to achieve it.
We can build arm64e apps using only C++. However, we have to be able to create arm64e apps for some research using Rust. Therefore, it would be great if Rust compiler supports arm64e architecture.
It seems 16 LLVM has the PAuth and arm64e features.
Right now, I am not sure about SIP. We can sign a binary file using the
@arttet If you're only using the app on your local systems (building it yourself) is there a need to code sign it? Is ad hoc code signing not sufficient?
We usually use cross-compile and check on different systems. For this reason, we need to sign apps manually.
Thank you for your great advice. It really works.
Could you please tell me what the best way is to add
pauth for Rust?
It seems we need to add the following
intrinsics (Pointer Authentication — LLVM 18.0.0git documentation):
Yeah, you will need to add those intrinsics there. And then you will need to add the intrinsic calls in the appropriate locations. I'm not sure what the appropriate locations would be though. I did recommend taking a look at where clang calls them.
How are you?
I have prepared a PR. Could you please look at it and let me know your opinion about it?
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.