-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
GDNative library fails to load on M1 mac, "wrong architecture", regression #47355
Comments
Most likely your GDNative library is compiled for x86_64 and not arm64. It works in 3.2.3 as that build is also compiled for x86_64 (so you're using it via Rosetta 2), while 3.3 RC 6 is a universal binary supporting both x86_64 and arm64. |
That makes sense - the library is indeed compiled for x86_64. If it's not expected to be able to load x86_64 libraries in the arm64 version of the engine, feel free to close this - apologies for the false alarm. |
Yeah that can't work, the architectures have to match. But I'll let @bruvzg comment before closing, maybe we can improve the usability somewhat to make things more obvious to users? |
This is definitely not supported, as it not supported by macOS, but you can run x86-64 version of the engine:
Or you can build a universal version of GDNative library by applying this PR (godotengine/godot-cpp#529) to the Also, since RC6 is signed and notarized, it will refuse to load the library that was downloaded and is not notarized as well. You'll need to remove "quarantine attribute" from the library first, see https://disable-gatekeeper.github.io/ for more details. The locally built library can be loaded without extra steps. |
Thanks for all the helpful tips! |
Godot version:
3.3.rc6.official
OS/device including version:
M1 Macbook Air (OSX 11.2.3)
Issue description:
When opening my project, which uses a GDNative library, the library fails to load with the following message:
"Can't open dynamic library: /Users/thoughtquake/Desktop/Dev/galacticchef/Godot/bin/osx/lib_galactic_chef.dylib, error: dlopen(/Users/thoughtquake/Desktop/Dev/galacticchef/Godot/bin/osx/lib_galactic_chef.dylib, 2): no suitable image found. Did find:
/Users/thoughtquake/Desktop/Dev/galacticchef/Godot/bin/osx/lib_galactic_chef.dylib: mach-o, but wrong architecture"
On the same machine, using the same build of my library, it works fine in Godot 3.2.3. I don't know if there are expected breaking changes that would require me to recompile my library with a different version of godot-cpp, but the "wrong architecture" part makes me think that's not the problem.
Steps to reproduce:
Note: I expect this project to crash if run; I just grabbed the library from a more complex project without doing anything to remove dependencies on things that aren't in this repro project. The point of this repro is whether or not the library is able to be loaded when opening the project.
Minimal reproduction project:
M1GDNativeRepro.zip
The text was updated successfully, but these errors were encountered: