-
Notifications
You must be signed in to change notification settings - Fork 382
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
Strange behavior on aarch64 linux #970
Comments
Hi! cross mounts a toolchain that can be run in the docker image, rn, it's only x86_64, hence why it's installing the toolchain for x86_64. see #751 for progress on the effort to be able to use aarch64 toolchains automatically, with #817 it is possible already though (see the example). This error is interesting though, seems like the podman machine can't run x86_64, however, we should automatically install the interpreters. (I'm not 100% on how podman works though, so I may be wrong with that) Try doing the following
|
So, I guess podman is what's confused somehow? |
Yes, it's unable to emulate x86_64, I'm not sure how to fix it. |
Sorry about the issue edits i thought i could get things working with Docker instead, but it appears there's an error down that path as well:
|
|
Ok it's using the right toolchain but it seems like it's unable to emulate x86_64 for some reason. Can you just confirm it by trying: docker run --platform linux/amd64 hello-world
docker run --platform linux/amd64 ubuntu:20.04 dpkg --print-architecture The latter we'd expect to fail for sure (since |
|
Yep, then it's a Qemu emulation error. I wonder if Podman has support for this. This likely should go in our Wiki for known bugs. If you would like to use cross on an aarch64 Linux host, you may be able to use Podman (no guarantees, however). The installation instructions are here, and you can use the same 2 above commands to test if it works: podman run --platform linux/amd64 hello-world
podman run --platform linux/amd64 ubuntu:20.04 dpkg --print-architecture If it works, you can provide |
In the meantime, however, I've confirmed that specific target works out-of-the-box with a native aarch64 Linux Docker image. I can export it to a tarball and send it to you if desired (or try to host it via Dockerhub or something). The image was built via |
Appears that the same
|
Want me to send you a tarball of an image for I've confirmed it passes all of cross's tests emulated via Qemu on an x86_64 host. |
I can wait for the full setup stuff to be done at your normal pace and in whatever hosting situation you need to figure out. I've got |
I already have the tarball, so it's just [target.arm-unknown-linux-gnueabi]
name = "ghcr.io/cross-rs/arm-unknown-linux-gnueabi:local"
toolchain = ["linux/arm64=aarch64-unknown-linux-gnu"] I was working on this problem as we were speaking so it's no big deal (and actually had built this image 2 hours ago just for this reason). |
uh, sure. i'm not sure how you can send it easily though. aren't they like hundreds of megabytes? |
Yeah, I can probably upload it to Dockerhub (similar to a Github registry). |
Alright. I can probably try that tomorrow once it's uploaded. |
Image is Set this to be your [target.arm-unknown-linux-gnueabi]
name = "docker.io/ahuszagh/aarch64-cross:arm-unknown-linux-gnueabi"
toolchain = ["linux/arm64=aarch64-unknown-linux-gnu"] The image details are here just in case you want to verify it. Update: added |
Wait this might have been something we assumed, because Docker comes with Try the following and see if it works: sudo apt-get install qemu binfmt-support qemu-user-static
docker run --privileged --rm tonistiigi/binfmt --install all This installs Qemu and binfmt (recognizes the binary format and chooses the right Qemu emulator to use) so the containers can run automatically. Just know that emulated Docker images are quite slow (my builds for these cross-compiled emulators take hours, if not longer, for builds that normally take 15 min). Using the aarch64 Linux image may be much faster. |
ah ofc, it's definitely that, I hit the same issue on my M1 and just used tonistiigi/binfmt without really thinking about it... my bad! Hopefully it's that simple |
Seems to be working! jemalloc is really loud though, here's what happened.
So, I guess maybe notes about this need to go in the wiki or something? (PS: sorry about the delay in getting back to this issue, but the device this is on is in set up in a distant room with no AC, so with the heat wave on I'm only going out there a little bit between like 11pm and midnight.) |
Wonderful, glad to hear it.
For sure, good idea.
No worries, I hope everything's ok. You're also helping us out (and the documentation), so there's absolutely no rush. Thanks for all the help. |
Oh no worries the main house is safe and cool, but the raspberry pi is just over in a shed in the back yard is all. |
This has been documented on the wiki under FAQ/Exec Format Error. Let me know if anything else needs to be added. |
Now here's a log of when I went to try out a
cross test
just now on my Raspberry Pi using the 64-bit OS (aarch64 linux)The last error on the end is totally my fault, I just forgot to install the container engine.
So I install podman and then this happens instead
And I'm not sure what's going on, but I'm pretty sure that the fact that
cross
tried to install an x86_64 thing on my aarch64 device when I was asking for ARM means that I'm probably breaking some sort of assumption that cross is making.The text was updated successfully, but these errors were encountered: