-
Notifications
You must be signed in to change notification settings - Fork 164
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
int64 param not working for imported functions #50
Comments
In #51, I've added tests to cover all Wasm types combined to Wasm imported functions. I would recommend to debug cgo generated files with By reading the message, it seems that the |
It doesn't seem to be declared twice, I've made sure it isn't in any other files. Looking in _cgo_export.c, I have this declaration which looks correct:
The other declaration is in the go file. I'm not sure what's going wrong since it seems to look the same as your tests. |
The error comes from cgo, not wasmer. I'm not sure how I can help you right now. Did you try to remove all the Go compiler caches? |
@Hywan no worries, yeah I tried. I'll try to figure it out. |
when running the tests for this repo with
Perhaps something is wrong with my environment, what does your go env look like? |
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hywan/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hywan/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m0/4f6b8rhj4gnb_29c_gz1xq0m0000gn/T/go-build398726835=/tmp/go-build -gno-record-gcc-switches -fno-common" |
Do you want me to instruct the CI to print |
Here's mine:
Looks like the main difference is I'm using gcc and you have clang. Update: I changed the compiler to clang with |
@losfair can you check why this is happening on Linux and not on Mac OS? |
Hey, any updates? I would really like to use wasmer in one of my projects :) |
Using |
@yuce that resolved my issue, thanks so much! |
@noot happy to help! |
After changing I think it's either because the cgo type checker does not handle C typedefs properly, or |
67: Changed int64_t to long long as suggested by losfair / hywan r=Hywan a=ethanfrey Closes #65 Based on this suggestion: #50 (comment) Co-authored-by: Ethan Frey <[email protected]>
Describe the bug
I have a wasm module that imports a function ext_print_num that takes an int64 parameter. However when I try to implement it, I get an error saying "conflicting types for ext_print_num".
Maybe this is an issue with int64? My other import functions that accept int32 all work perfectly.
Steps to reproduce
the full code is here: https://github.com/ChainSafe/gossamer/blob/elizabeth/wasmer/runtime/wasmer.go
Expected behavior
I wouldn't expect an error since the types should match.
Actual behavior
Additional context
Also, just wondering if you have a gitter or some other channel I can reach you on. Thanks :)
The text was updated successfully, but these errors were encountered: