Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stdlib: Do not pass -static to cgo (#3593)
* stdlib: Do not pass -static to cgo The CGO_LDFLAGS we pass get embedded as the cgo_ldflag directive. Once we pass -static, any cgo/net/os.user usage will lead to linking statically. Avoid this. Fixes: #3590 * link: Control static linking through go.mode.static Control whether or not to link statically through go.mode.static and not through the C/C++ compiler's ldflags. This only matters when Go's linker decides to use external linker for linking the final binary. This started to happen with Go 1.20 as the builder passes `-fdebug-prefix-map=` when building cgo code. In return the Go compiler emits the preferlinkext hint.
- Loading branch information