Skip to content
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

libatomic.a included in arm-unknown-linux-gnueabihf:0.2.5 contains armv7 instructions #39

Open
regwhitton opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@regwhitton
Copy link

Hello.

When cross compiling for a 2011 Raspberry Pi 1 (armv6) using docker, if the program includes libatomic.a then when the program is run on the target architecture it outputs "Illegal Instructions" and stops.

Looking through the past issues, there are a number that have similar symptoms, but in this case the root cause seems to be this library. Only libatomic.a and libatomic.so seem to include armv7 instructions. My work-around is to replace libatomic.a from the Raspberry Pi distribution: https://downloads.raspberrypi.org/raspios_lite_armhf/root.tar.xz

Perhaps, the docker file could include a check of the sysroot contents.

$ docker run --rm -it ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:0.2.5 bash
root@e1eb3b13927c:/# readelf -A /x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/lib/libatomic.a | grep 'Tag_CPU_arch: v7' | head -1
  Tag_CPU_arch: v7
root@e1eb3b13927c:/# readelf -A /x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/lib/libatomic.so | grep 'Tag_CPU_arch: v7' | head -1
  Tag_CPU_arch: v7
@Emilgardis Emilgardis added the bug Something isn't working label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants