-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
android arm64 support #513
Comments
I just found https://github.com/veandco/sdl2-static-library-build-scripts I can probably work with that. |
Ahh sorry, I haven't managed to finalize the scripts. I will push what I have now tomorrow so it will be more up-to-date. |
No worries. I'm thinking that library might be good for me to practise my github actions skills. If you would be interested in an automated solution? I have gained some experience with docker recently which I could put to use to have github produce the static libs. I noticed that it's set up for the older android NDKs though, which I am not sure if supported arm64 (new ones use LLVM and is much easier to configure). In any case I can take care of updating that at the same time |
That would be extremely helpful! I have met a couple stumbling blocks in building for android and darwin arm64 architecture so I greatly appreciate any help on those matters! |
I started working on it: veandco/sdl2-static-library-build-scripts#1 Now it should be possible to build using that container. No time for that today though. I'll add some instructions also later on. |
Thanks @Lundis! I have also pushed the current state of the repository which may have affected the list of packages installed in the Dockerfile. |
Hey there! Any progress on this? I was trying to build an SDL app for an aarch64 linux embedded system and getting an error:
I'm assuming this is because there are no SDL libs for this platform. I'm happy to compile them myself if there are some instructions, but I haven't been able to find any. |
Hi @n-i-x, you could try downloading the latest SDL2 library from GitHub at https://github.com/libsdl-org/SDL/releases After extracting it, you could build it like this:
and then make sure
After that, I believe you should be able to use the binding. |
I don't think that'll let me statically compile though will it? I have all the .a files from the device I'm targeting and tried adding them to the repo... but it couldn't find them. Not sure what I missed. |
FYI, I tried compiling SDL 2.0.7 (the version included in the embedded device) using your instructions and then building one of the examples and I get the following error:
I've tried |
@n-i-x That is because you need to explicitly enable cgo with CGO_ENABLED=1, Go will by default disable cgo when ever you try to cross-compile. It is a common error when one wants to cross-compile a cgo project just like that. When you add CGO_ENABLED, the next error will probably be something that tells you that you must use the C compiler/toolchain for the target architecture, i.e. to set CC. Btw. you must also compile SDL with the same toolchain, not with your host CC. |
Okay I tried all of that except compiling sdl with the aarch64 gcc I’ll try that next and report back. |
Then when trying to cross-compile I get the following:
Is there something I need to do to make sure cgo can see the the libs in ~/.local? I have |
I also wonder if I just need to compile SDL -image,-mixer,-ttf,-gfx to get all the references needed by the bindings... I'll make my way through compiling those libs for aarch64 as well. I really appreciate you helping me through this. |
Hi @n-i-x, the SDL2 build instructions written above are for dynamic compilation as we don't have static libraries for android arm64 yet. There shouldn't be a need to install the other SDL2 libraries such as SDL2_image if only All SDL2 versions should also work with the binding according to the Github Actions test but perhaps there's special case with android arm64. If so, could you let me know how to reproduce your environment? |
It seems that android arm64 (AKA aarch64 / arm64-v8a) is the standard now (meaning you cant technically use this library for android). I suppose adding support for it is as "simple" as cd80a89
I would do it myself but I'm guessing you already have SDL cross-compiling set up (which does not exactly seem trivial according to SDL's docs). Seeing how I have no experience compiling C libraries I'm not sure I would figure it out in any reasonable timeframe. Anyhow if you are able to somewhat easily do this, I will do the testing of it for you, and also update the android example (which is really outdated).
If you don't have time for this, maybe you could point me in the right direction?
The text was updated successfully, but these errors were encountered: