-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add macOS/arm64 cross-compilation Azure CI job incl. prebuilt package #3666
Conversation
As preparation for adding a macOS/arm64 cross-compilation job.
1927f3f
to
db38125
Compare
Can anyone with M1 hardware give this native macOS/arm64 package a try? https://github.com/ldc-developers/ldc/releases/download/CI/ldc2-f092783d-osx-arm64.tar.xz |
Can this wait tomorrow? |
Hello, here is the result of my tests.
For example, this generates the ICE: import std.stdio;
int main(string [] args) // build with: ldc2 main.d
{
writeln("hello\n");
return 0;
} This doesn't generate the ICE: int main(string [] args) // build with: ldc2 main.d
{
return 0;
} This doesn't generate the ICE either (and when run it works correctly): import core.stdc.stdio;
int main(string [] args) // build with: ldc2 main.d
{
printf("hello\n"); // Output: hello
return 0;
} When there is the ICE, it will also crash when using |
Sounds related to exceptions? Without throwing, this code compiles. But ICE when there is a throw. int main(string [] args)
{
try
{
// Uncomment to have the ICE
//throw new Exception("lol");
}
catch(Exception e)
{}
return 0;
} |
Thx for testing; please give https://github.com/ldc-developers/ldc/releases/download/CI/ldc2-f26956a4-osx-arm64.tar.xz a shot. |
yes, I've tested https://github.com/ldc-developers/ldc/releases/download/CI/ldc2-f26956a4-osx-arm64.tar.xz
With any main.d
|
Alright perfect, so the problem was somehow really that the LDC assertions were enabled, while the linked LLVM was built with disabled assertions. Not being able to cross-compile to x64 is expected, I haven't added those libs. (Expecting the user to copy the libs dir from the osx-x86_64 artifact and setting up ldc2.conf manually according to the regular cross-compilation steps on the Wiki page.) Wrt. performance comparison with Rosetta, what x64 package have you used? CI builds of osx-x86_64 and osx-arm64 cannot be compared because the former use enabled assertions, the latter don't. |
I think it was LDC-1.24-beta1, not sure at all. Was a CI build. |
To override the inherited LLVM assertions mode. It's needed for non-tagged CI builds for macOS/arm64, because the native LLVM (and its used bin/llvm-config) reports enabled assertions while the actually used arm64 LLVM build has them disabled. Building LDC with assertions and linking against an LLVM with disabled assertions apparently leads to LDC segfaults, see ldc-developers#3666 (comment).
[I should have been more precise, I meant master builds (from the |
For us on Apple hardware going from Rosetta to native code brings about 30% to 90% speed-up. |
I assume there's still the myriad of linker warnings? |
Yes. |
Accompanying LLVM CI addition: ldc-developers/llvm-project@c65e187