Skip to content
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

stdlib: Do not pass -static to cgo #3593

Merged
merged 3 commits into from
Jun 23, 2023
Merged

Commits on Jun 19, 2023

  1. 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: bazelbuild#3590
    zecke committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    9de2bf1 View commit details
    Browse the repository at this point in the history
  2. 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.
    zecke committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    aa9e1a1 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. Configuration menu
    Copy the full SHA
    af3704e View commit details
    Browse the repository at this point in the history