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

Only complie ARMv6 for Raspberry Pi boards #635

Open
ravenclaw900 opened this issue Aug 26, 2023 · 4 comments
Open

Only complie ARMv6 for Raspberry Pi boards #635

ravenclaw900 opened this issue Aug 26, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@ravenclaw900
Copy link
Owner

ravenclaw900 commented Aug 26, 2023

@MichaIng, just wanted to ask your opinion on this.

Rust/LLVM has an option to compile for a specific target CPU. This lets it take better advantage of the unique features of that CPU, generally increasing performance. From my look at the survey page, the only ARMv6 boards currently used with DietPi are the RPi A, B, and 0 (and varieties of those). All those SBCs have an ARM1176JZF-S processor. Therefore, we could compile the ARMv6 version of dashboard for that CPU specifically to take advantage of it.

@ravenclaw900 ravenclaw900 changed the title Only complie for ARMv6 Raspberry Pi boards Only complie ARMv6 for Raspberry Pi boards Aug 26, 2023
@MichaIng
Copy link
Collaborator

MichaIng commented Aug 26, 2023

Jep that is all correct: The only supported ARMv6 boards are RPi 1 (all variants) and Zero, which all use the same SoC/CPU.

Not sure if it will make much or any difference, at least hard-float is defined already with the target tuple, but it does not hurt.

@ravenclaw900
Copy link
Owner Author

Just from my testing, it increases binary size slightly, so my guess is that it's using some more specialized and faster instructions only supported by that CPU.

@MichaIng
Copy link
Collaborator

Larger binary means more RAM usage. However, I guess we should trust the compiler to do the best thing when knowing the exact CPU.

@MichaIng
Copy link
Collaborator

Checking conditionals in Justfile. Probably this will work:

RUSTFLAGS := if {{target}} == "arm-unknown-linux-musleabihf" { "-C target-cpu=arm1176jzf-s" } else { "" }

Or in the workflow:

env:
  RUSTFLAGS: ${{ matrix.job.target == 'arm-unknown-linux-musleabihf' && '-C target-cpu=arm1176jzf-s' || '' }}

But not sure whether this is passed through to Justfile and the build?

@MichaIng MichaIng added the enhancement New feature or request label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants