bytecodealliance/wasmtime-go

Why are static libraries provided by default instead of dynamic ones?

rayowang opened this issue · 5 comments

I think a dynamic library version should be provided to support some users, because static libraries may cause symbol redefinition conflicts, what do you think? @alexcrichton

In short I don't know how to get dynamic libraries working in Go. A PR to implement this would be appreciated!

In short I don't know how to get dynamic libraries working in Go. A PR to implement this would be appreciated!

Sorry, maybe I didn't describe it clearly, what I mean is to use .so or .dylib or .dll to avoid the following symbol conflict errors @alexcrichton

/usr/local/Cellar/go/1.17.2/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
duplicate symbol '_ZSTD_isError' in:
    /var/folders/l2/z53nzn7x0zq404jrdkrqqybh0000gp/T/go-link-1822175626/000101.o
    /Users/wangzhilong23/go/pkg/mod/github.com/bytecodealliance/wasmtime-go@v1.0.0/build/macos-x86_64/libwasmtime.a(zstd_common.o)
duplicate symbol '_ZSTD_versionNumber' in:
    /var/folders/l2/z53nzn7x0zq404jrdkrqqybh0000gp/T/go-link-1822175626/000101.o
    /Users/wangzhilong23/go/pkg/mod/github.com/bytecodealliance/wasmtime-go@v1.0.0/build/macos-x86_64/libwasmtime.a(zstd_common.o)
duplicate symbol '_ZSTD_getErrorString' in:
    /var/folders/l2/z53nzn7x0zq404jrdkrqqybh0000gp/T/go-link-1822175626/000101.o
    /Users/wangzhilong23/go/pkg/mod/github.com/bytecodealliance/wasmtime-go@v1.0.0/build/macos-x86_64/libwasmtime.a(zstd_common.o)
duplicate symbol '_ZSTD_versionString' in:
    /var/folders/l2/z53nzn7x0zq404jrdkrqqybh0000gp/T/go-link-1822175626/000101.o

I have same issue. @alexcrichton Is there any workaround solution?

Yes I understand what this issue is asking for, and my response is "I don't know how to do this in Go". A PR would be appreciated if y'all know how to implement this in Go.

Yes I understand what this issue is asking for, and my response is "I don't know how to do this in Go". A PR would be appreciated if y'all know how to implement this in Go.

@alexcrichton I made a simple modification to let wasmtime-go use the dynamic library by default in the linux, so that symbol conflicts can be avoided in dapr related projects. If you have time, please help to review and see if there are any problems and suggestions, thank you. #155