-
Notifications
You must be signed in to change notification settings - Fork 211
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
[ios] Unable to load GDNative library on iOS simulator #343
Comments
Could you try |
the output of I search in this log and found this:
looks like |
It seems like the symbols are prefixed with underscores somehow:
I'm not sure if this is a problem in godot-rust or cargo-lipo yet, but this isn't expected because the Meanwhile, could you try setting Symbol Prefix to |
@toasteater how to set Symbol Prefix to |
@atonamy You can set it in your |
I changed the symbol prefix, after export script still not working. I providing full log just in case:
I double check the library file I'm using and symbol is there: I suspect maybe because of Also I don't see any |
You shouldn't see the |
@toasteater I really hope we can resolve this issue |
@atonamy I'm not sure what the tool you're using here is supposed to do, but normally it's impossible to obtain a list of static libraries in a binary, only the symbols: the library names are discarded by the linker. It's normal to not see the |
Last information I have is that on iOS you need to statically link (I think this is no longer the case?), so to do that the exported game is provided as an unlinked binary. This is the only information I know of, I have never owned an iOS device and never did the export, so I can't help too much unfortunately :/ |
After some investigation, it seems that the leading underscores are being added by LLVM on Apple platforms, and that their presence is a normal part of the ABI. This could be an issue in Godot, since this is something that can be easily overlooked in a naive implementation, but also might be something to do with OP's configuration, since he is also having trouble with Android (#347) which had been confirmed to work before. Without further information and a full reproduction project, it's hard to tell which way it is. Unfortunately, I also can't provide further help, since I'm not familiar with iOS development and do not have a dev environment set up. I'm tagging this issue as "help wanted" for now. |
Maybe I can help? You just give some introduction where I should start investigation and research into this issue? |
You should look into the iOS-specific linking code in Godot's The Rust bindings are exporting symbols according to protocol, since the underscores are part of the ABI. However, as stated in the "Engine compatibility" section of README, we do intend to keep "bug-compatibility" with Godot 3.2 ABI-wise. This means that if Godot is expecting a non-standard ABI, we will try to comply with that. Otherwise, this will not be considered a bug in the bindings. |
I just tried to link static library explicitly in Xcode project and now I have different issue:
I checked multiple time. The library is compiled for current arm64 or x86_64 platform. |
OP communicated in private channels that the problem is resolved on real devices, but not on simulators. Editing issue title to reflect this. |
@toasteater yes Android emulator also working. Only problem with iOS simulator.
With real iPhone no issue confirmed. |
@toasteater @atonamy Maybe unrelated but worth the try : OP said :
These are definitely 64-bit toolchains. Please check your simulator device architecture. EDIT :
|
Looks like is no longer supported. I tried to test The issue only when I use |
@atonamy Indeed Apple/Rustup dropped 32-bit support since Rust 1.42.0 (early 2020) and since Xcode 10. Any related toolchain seems to be demoted to Tier 3. |
I'm using Xcode 11.4.X and default Simulator there is based on x86_64-apple-ios |
It is explained on the blog post. This is the lowest support priority tier for Rust team, meaning it is not supported anymore. |
So, I don't know anything about godot nor godot-rust so forgive me if I'm out of my element on the internals of godot. What I will add to the conversation is that godot-sys doesn't look to have iOS simulator support as of #286. The osx_include_path function needs to handle the |
@simlay I just tried to compile with hardcoded
|
It's possible that this is a problem in Godot, since it isn't finding the library at all. |
Might be resolved by #353 unless Godot still doesn't find the library correctly. Someone knows if there is some documentation about targets you can use in GDNative mapping files ? I'm currently working on the following summary table
If there was (hypothetically) a iOS simulator related configuration that doesn't belong to the mentionned ones above, that would explain some things. |
Since the target triple for the iOS simulator is Reading the code of |
@atonamy Possible to summary a bit the steps you did for making it work on real iOS devices, as mentionned in Schr3da/godot-rust-tutorials#1 ? All I need to know is if there was some things you did on terminal or if you had to edit some things on config files. So I can match my WiP CI configuration with yours. |
Closing due to inactivity. If you still have this question, feel free to reopen the issue! |
Hey @toasteater, finally had the chance again to look into the ios build way - unfortunately Im still unable to make it work. Do you have a instruction on how to do it - i tried to follow your description before but Im unable to make it work - If possible I would be also available for a call. kind regards |
Where do you stuck? I can help you to move on and setup ios build. |
Hey @atonamy, great - I built the library as expected using COMMAND
OUTPUT:
Initially I tried to ignore it and just directly moved to the xcode generation, adding images , code signing and so on. |
I'll send you build instructions tomorrow. |
Thanks a lot! Looking forward hearing from you soon. Best regards |
@Schr3da here you go If you have any questions let me know, appreciate if you create tutorials on your youtube channel based on this video for iOS and Android builds. |
@atonamy thank you for the video! |
No problem. Btw I still not able to make it work on iOS simulator (x86_64). Please update me about your progress. |
Can confirm does not work on simulator but Im happy it works on the real device - found my mistake - it was that I generated the gdnlib file by godot automatically but it needs to be created by myself using your template - than it works as expected! Thanks a lot |
I manage to compile successfully build for iOS using this code:
But not able to run it on the device.
I added
rustup target add aarch64-apple-ios
andrustup target add x86_64-apple-ios
then using
cargo lipo
to compile.During compilation was no issue. Final steps I added compiled libsimpler.a into my simpler.gdns:
![simpler.gdns](https://camo.githubusercontent.com/eb57ad7e92e1a75a9fb5b3096f360680c8b028f2b03c0e0466dce6a76f647442/68747470733a2f2f692e6962622e636f2f7a483530374e322f676f646f742d67646e61746976652e706e67)
After I exported to Xcode project and compile and run the sample on my Iphone I facing this bunch of errors (game doesn't crash):
What exactly I did wrong? Why is not working?
The text was updated successfully, but these errors were encountered: