-
Notifications
You must be signed in to change notification settings - Fork 652
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
Fix cross compilation for armv6hf (Raspberry Pi 1) #1457
base: dev
Are you sure you want to change the base?
Conversation
Signed-off-by: Dariusz Olszewski <[email protected]>
Signed-off-by: Dariusz Olszewski <[email protected]>
Signed-off-by: Dariusz Olszewski <[email protected]>
I've not tried to compile for pi 1 lately but I would be extremely surprised if switching to ring is a requirement for that to work. It never used to be. I think we should put the default back to ring. I have been meaning to get back to that PR but I really don't think it should be merged in as part of this, it's too much of a big change. |
After installing cmake (from system packages) and bindgen-cli (using cargo) I got to the point of missing libclang.
I have not been able to find libclang in the set of armv6hf packages used by the Dockerfile. An alternative might be to use e.g. these tools (https://github.com/tttapa/docker-arm-cross-toolchain) instead. But I have not tried this yet.
Fair enough - I can remove this change from this PR and wait for another PR that will make this explicit. |
It might be missing |
Tried that - got a different error this time:
I suspected that libclang is required for the target architecture, not for the architecture used on the build host.
Indeed - I did not want to start with major changes. |
Bindgen is used to generate rust code (not binaries) from c headers, I'd have thought it would be fine with the host version. But it does need to have the target's c system (not clang) headers to do this task, think that might be the problem. Where are they provided? In the PI tools sysroot or from apt? |
But to be honest, you are right. It's a waste of time fighting aws-lc all the time. Let's see if we can switch to ring as default and make everyone's lives 10x easier. |
@kingosticks - thanks for this tip. I have finally managed to cross-compile aws-lc-rs. 👍 Setting BINDGEN_EXTRA_CLANG_ARGS environment variable did the trick - I have found it here: https://crates.io/crates/bindgen-cli The compiled librespot binary seems to run on a Raspberry Pi 1. I am not sure if it makes sense to include required changes in this PR. Maybe I will clean them up and submit - just in case. 🤔 |
…ustls" This reverts commit faeaf50.
Signed-off-by: Dariusz Olszewski <[email protected]>
It used to be ring before. Switching to aws-lc must have happened by me merging a Docker PR and not being aware of the implications. We don’t need the FIPS compliance and certainly not the hard time that it’s giving us. |
Apparently this has been changed upstream in hyper-rustls at 0.27.0 release:
|
Signed-off-by: Dariusz Olszewski <[email protected]>
Since I have found a way to build aws-lc-rs for armv6hf, I have reverted the change of the default TLS library to leave it for a separate explicit PR. Brief summary of changes required to build aws-lc-rs (might help someone in the future):
I have also added git to the packages in the I do not plan any more changes to this PR - unless there are further comments/suggestions. |
The Docker image intended to cross-compile librespot for armv6hf (i.e. Raspberry Pi 1) did not work for some time.
Changes proposed here attempt to fix this:
Commit faeaf50 changes the default tls library from aws-lc-rs to ring as suggested by @kingosticks in Avoid using default features of dependencies #1382 (commit: kingosticks@24bbc63). I tried to compile aws-lc-rs for armv6hf, but did not succeed. 😞 I understand that this change might be controversial - I am open to discuss this.Reverted in 6bb009aWith these changes in place I have been able to cross-compile librespot for armv6hf and verify that it runs as expected on a Raspberry Pi 1.
I have also verified builds using Docker for aarch64 and x86_64.