-
Notifications
You must be signed in to change notification settings - Fork 33
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
Possibly wrong argc/argv #72
Comments
|
Use the code snippets below to work with |
Global asm also works, and does not require any nightly features:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rust contracts built by
capsule build
(esp. in non-release build) may not get the correct argc and argv arguments because the compiler may insert function prologue before our assembly code in_start
and change thesp
register.One possible solution is to mark the
_start
function#[naked]
.Or the
_start
function can be written in pure assembly and linked with rust code.(By the way the
program_entry
function should useextern "C"
so that it has a defined calling convention.)The text was updated successfully, but these errors were encountered: