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

cmd/link: "HEADR too small" error when linking against huge static library #47312

Open
mortie opened this issue Jul 21, 2021 · 2 comments
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mortie
Copy link

mortie commented Jul 21, 2021

What version of Go are you using (go version)?

$ go version
1.17-rc1

(though it also applies to at least 1.16.5, and probably goes back much further)

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/bendik/Library/Caches/go-build"
GOENV="/Users/bendik/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/bendik/go/pkg/mod"
GONOPROXY="git.noisolation.com"
GONOSUMDB="git.noisolation.com"
GOOS="darwin"
GOPATH="/Users/bendik/go"
GOPRIVATE="git.noisolation.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17rc1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rq/k2szrdln2t72syt8tzhzrds80000gn/T/go-build1228245628=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I tried to link a Go program against a static WebRTC library (32MB without debug symbols). That, in combination with using the large net/http package, made Go print this error: /usr/local/go/pkg/tool/darwin_amd64/link: HEADR too small: 4408 > 4096

What did you expect to see?

I expected Go to link the binary correctly.

What did you see instead?

The aforementioned HEADR too small error.

@seankhliao seankhliao changed the title "HEADR too small" error when linking agianst huge static library cmd/link: "HEADR too small" error when linking against huge static library Jul 21, 2021
@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 21, 2021
@thanm
Copy link
Contributor

thanm commented Jul 21, 2021

@mortie thanks for reporting.

To take action on this issue we'll need a way to reproduce it -- can you please post detailed instructions? E.g. exact commands that you did that will trigger this problem.

@thanm
Copy link
Contributor

thanm commented Jul 21, 2021

@cherrymui @thanm

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Triage Backlog
Development

No branches or pull requests

4 participants