Skip to content

define-syscall: Add no_std attribute #119

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

febo
Copy link
Contributor

@febo febo commented Apr 2, 2025

Problem

Currently the define-syscall crate is no_std "friendly" but does not have the crate attribute. This indirectly brings the std at link stage when trying to compile no_std programs:

error[E0152]: found duplicate lang item `panic_impl`
 --> src/lib.rs:9:1
  |
9 | pinocchio::nostd_panic_handler!();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: the lang item is first defined in crate `std` (which `solana_define_syscall` depends on)

Solution

Add the #![no_std] attribute to the crate.

@febo febo marked this pull request as ready for review April 2, 2025 19:14
@febo febo requested a review from joncinque April 2, 2025 19:15
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 to me!

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