8
Golang | cmd - go build 构建模式
source link: https://ijayer.github.io/post/tech/code/golang/20180624-go_cmd_01_2_go-build-mode/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Golang | cmd - go build 构建模式
2018-06-24
533 words
2 mins read
89 times read
build modes
The ‘go build’ and ‘go install’ commands take a -buildmode argument which indicates which kind of object file is to be built. Currently supported values are:
|
Go 的构建模式
什么是 build mode?
build mode
: 用于指导编辑器如何创建可执行的二进制文件。越多的执行方式,就意味着可以让 Go 运行在更多的地方。
Go 的 8 中 build mode
|
exe 静态编译
exe 动态链接 libc
exe 动态链接 libc 和非 Go 代码
exe 动态链接 libc 和非 Go 代码
pie 地址无关的可执行文件(安全特性)
c-archive C 的静态链接库
c-shared C 的动态链接库
shared Go 的动态链接库
See Also
Thanks to the authors 🙂
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK