2 回答
TA贡献1891条经验 获得超3个赞
这个过程对我有用:
$ docker run -it golang /bin/sh
# cd src
# mkdir test
# cat << EOF > test/lib.go
> package test
import "fmt"
func Hello() {
fmt.Println("Hi")
}> > > >
> EOF
# cat test/lib.go
package test
import "fmt"
func Hello() {
fmt.Println("Hi")
}
# go install -buildmode=shared -linkshared std
# ldd /usr/local/go/pkg/linux_amd64_dynlink/libstd.so
linux-vdso.so.1 (0x00007fff4093d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3454de5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3454dc4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3454c03000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3457514000)
# go install -buildmode=shared -linkshared test
# ldd /go/pkg/linux_amd64_dynlink/libtest.so
linux-vdso.so.1 (0x00007ffddbbeb000)
libstd.so => /usr/local/go/pkg/linux_amd64_dynlink/libstd.so (0x00007f82bc8cf000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f82bc70a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f82bc705000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f82bc6e4000)
/lib64/ld-linux-x86-64.so.2 (0x00007f82bf0fc000)
#
- 2 回答
- 0 关注
- 173 浏览
添加回答
举报