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

Add workaround for assembling crypto instructions on arm #311

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

yuvald-sweet-security
Copy link
Contributor

Hello,

This is a workaround for Zig issue ziglang/zig#10411 which prevents building the sha1-asm crate on zigbuild.

The end result is that in the special case that the ARMv8 crypto IS extension is requested the zig cc invocation turns from:
zig cc -g -target aarch64-linux-gnu ... -c src/aarch64.S -march=generic+crypto
to
zig cc -g -target aarch64-linux-gnu ... -c src/aarch64.S -march=generic+crypto -Xassembler -march=armv8-a+crypto

This way we skip zig cc and pass the correct march flag to clang-as directly. This solves #149.

As I'm not familiar with this codebase, the best way I found to implement this is to modify filter_linker_arg to return a vector of arguments. If there's another way you'd like me to structure this change please let me know.

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@messense messense merged commit 1ddfd9b into rust-cross:main Feb 5, 2025
33 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants