Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Oct 21, 2025

Problem

The upstream compiler uses target_arch = "bpf" when compiling to bpfel-unknown-none target, while the cfg conditional compilation is currently using only target_os = "solana".

Solution

Add target_arch = "bpf" along side target_os = "solana".

Note: Needs #389 to go first.

@febo febo force-pushed the upstream-sha256-hasher branch 2 times, most recently from a8a72eb to d0724f6 Compare October 28, 2025 11:44
@febo febo marked this pull request as ready for review October 28, 2025 13:40
@febo febo requested a review from joncinque October 28, 2025 13:40
@febo febo marked this pull request as draft October 28, 2025 15:04
@febo
Copy link
Contributor Author

febo commented Oct 28, 2025

Waiting on #408 to rebase.

Copy link
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great! Just the one comment

Comment on lines 6 to 8
pub use {
core::mem::MaybeUninit, solana_define_syscall::definitions::sol_sha256, solana_hash::HASH_BYTES,
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shouldn't be pub use, right?

Suggested change
pub use {
core::mem::MaybeUninit, solana_define_syscall::definitions::sol_sha256, solana_hash::HASH_BYTES,
};
use {
core::mem::MaybeUninit, solana_define_syscall::definitions::sol_sha256, solana_hash::HASH_BYTES,
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. We still need to re-export the sol_sha256 syscall – solana-program references it.

@febo febo changed the title sha256-hasher: Add bpf target Add bpf target to hashers Oct 29, 2025
@febo febo force-pushed the upstream-sha256-hasher branch from 66128b2 to a82aedf Compare October 29, 2025 10:53
@febo febo marked this pull request as ready for review October 29, 2025 11:17
@febo
Copy link
Contributor Author

febo commented Oct 29, 2025

@joncinque Rebased and expanded the PR to include all hasher crates. secp256k1-recover still not no_std because of the thiserror dependency, I will address that in a separate PR.

@febo febo requested a review from joncinque October 29, 2025 11:18
Copy link
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

@febo febo merged commit 857c2b1 into anza-xyz:master Oct 29, 2025
26 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