We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm encountering an issue when using the hash method within a library function. The setup is as follows:
// ./lib/lib.odin package lib import "core:crypto/hash" @(export) foo :: proc() { hash.hash(hash.Algorithm.SHA256, "hello, world") return }
// ./main.odin package main foreign import lib "lib.so" foreign lib { foo :: proc() --- } main :: proc() { foo() return }
odin build lib -debug -build-mode:shared
odin build main.odin -file
When running the built executable, the following error is produced:
/usr/lib/odin/core/crypto/hash/low_level.odin(171:17) Invalid type assertion from union {Blake2b_Context, Blake2s_Context, Context_256, Context_512, Context, Context, Context, Context, Context} to Context_256 zsh: illegal hardware instruction (core dumped) ./main
Output of odin report
odin report
Odin: dev-2024-09-nightly:dd1f151 OS: Arch Linux, Linux 6.10.10-arch1-1 CPU: AMD Ryzen 7 PRO 6850U with Radeon Graphics RAM: 14747 MiB Backend: LLVM 18.1.8
The text was updated successfully, but these errors were encountered:
That should either be
@(default_calling_convention="odin") foreign lib { foo :: proc() --- }
Or
@(export) foo :: proc "c" () { ... }
The reason being that foreign blocks default to the c calling convention.
Sorry, something went wrong.
Same issue also with setting the calling convention
No branches or pull requests
Context
I'm encountering an issue when using the hash method within a library function. The setup is as follows:
Library Code
Executable Code
Build Commands
odin build lib -debug -build-mode:shared
.odin build main.odin -file
Error on Execution
When running the built executable, the following error is produced:
Additional Information
Output of
odin report
The text was updated successfully, but these errors were encountered: