golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.72k stars 17.5k forks source link

cmd/link: regression on building an app with `GOOS=wasip1 GOARCH=wasm` #65786

Closed HarikrishnanBalagopal closed 6 months ago

HarikrishnanBalagopal commented 6 months ago

Go version

go version go1.22.0 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/haribala/Library/Caches/go-build'
GOENV='/Users/haribala/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/haribala/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/haribala/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.0/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.0/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/81/pzmd85sj2d9dg02xgmd7wlhr0000gn/T/go-build1347662950=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

This is a wasm app that builds with GOOS=wasip1 and GOARCH=wasm

Steps to reproduce:

  1. Clone the wasm branch latest commit https://github.com/konveyor/move2kube/tree/6173004d80d1e21592374b54362f3d9a13ab3de5

  2. Use the docker container to build using different versions of the Go compiler

  3. Using version 1.21.6 the build is successful

    $ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21.6 bash
    Unable to find image 'golang:1.21.6' locally
    1.21.6: Pulling from library/golang
    66932e2b787d: Pull complete 
    4afa7e263db1: Pull complete 
    c812910e5e62: Pull complete 
    f0415bb1783d: Pull complete 
    d7276b11ada4: Pull complete 
    19aeecab7f9b: Pull complete 
    4f4fb700ef54: Pull complete 
    Digest: sha256:7b575fe0d9c2e01553b04d9de8ffea6d35ca3ab3380d2a8db2acc8f0f1519a53
    Status: Downloaded newer image for golang:1.21.6
    root@4b191bbc5fed:/usr/src/myapp# go env
    GO111MODULE=''
    GOARCH='arm64'
    GOBIN=''
    GOCACHE='/root/.cache/go-build'
    GOENV='/root/.config/go/env'
    GOEXE=''
    GOEXPERIMENT=''
    GOFLAGS=''
    GOHOSTARCH='arm64'
    GOHOSTOS='linux'
    GOINSECURE=''
    GOMODCACHE='/go/pkg/mod'
    GONOPROXY=''
    GONOSUMDB=''
    GOOS='linux'
    GOPATH='/go'
    GOPRIVATE=''
    GOPROXY='https://proxy.golang.org,direct'
    GOROOT='/usr/local/go'
    GOSUMDB='sum.golang.org'
    GOTMPDIR=''
    GOTOOLCHAIN='local'
    GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
    GOVCS=''
    GOVERSION='go1.21.6'
    GCCGO='gccgo'
    AR='ar'
    CC='gcc'
    CXX='g++'
    CGO_ENABLED='1'
    GOMOD='/usr/src/myapp/go.mod'
    GOWORK=''
    CGO_CFLAGS='-O2 -g'
    CGO_CPPFLAGS=''
    CGO_CXXFLAGS='-O2 -g'
    CGO_FFLAGS='-O2 -g'
    CGO_LDFLAGS='-O2 -g'
    PKG_CONFIG='pkg-config'
    GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4290207339=/tmp/go-build -gno-record-gcc-switches'
    root@e9f3aa0a9ee8:/usr/src/myapp# ls
    LICENSE   README.md  bin  collector  environment  go.mod  graph  m2k-web-ui  qaengine  transformer
    Makefile  assets     cmd  common     filesystem   go.sum  lib    main.go     scripts   types
    root@e9f3aa0a9ee8:/usr/src/myapp# make build
    mkdir -p "./bin"
    CGO_ENABLED=0 GOOS=wasip1 GOARCH=wasm go build -ldflags '-X github.com/konveyor/move2kube-wasm/types/info.buildmetadata=unreleased -X github.com/konveyor/move2kube-wasm/types/info.gitCommit=6173004d80d1e21592374b54362f3d9a13ab3de5 -X github.com/konveyor/move2kube-wasm/types/info.gitTreeState=clean' -o "./bin/move2kube.wasm" .
    go: downloading gopkg.in/yaml.v3 v3.0.1
    go: downloading github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
    go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
    go: downloading github.com/docker/docker v24.0.0+incompatible
    go: downloading github.com/mitchellh/mapstructure v1.5.0
    go: downloading github.com/spf13/cast v1.5.1
    go: downloading golang.org/x/crypto v0.12.0
    go: downloading golang.org/x/text v0.12.0
    go: downloading k8s.io/apimachinery v0.23.1
    go: downloading github.com/gorilla/mux v1.8.0
    go: downloading github.com/mholt/archiver/v3 v3.5.1
    go: downloading github.com/spf13/cobra v1.7.0
    go: downloading github.com/spf13/viper v1.16.0
    go: downloading github.com/Masterminds/goutils v1.1.1
    go: downloading github.com/Masterminds/semver v1.5.0
    go: downloading github.com/google/uuid v1.3.0
    go: downloading github.com/huandu/xstrings v1.3.2
    go: downloading github.com/imdario/mergo v0.3.13
    go: downloading github.com/mitchellh/copystructure v1.2.0
    go: downloading github.com/gogo/protobuf v1.3.2
    go: downloading gopkg.in/inf.v0 v0.9.1
    go: downloading github.com/google/gofuzz v1.2.0
    go: downloading github.com/google/go-cmp v0.5.9
    go: downloading k8s.io/klog/v2 v2.100.1
    go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.3
    go: downloading github.com/andybalholm/brotli v1.0.3
    go: downloading github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
    go: downloading github.com/golang/snappy v0.0.4
    go: downloading github.com/klauspost/compress v1.16.5
    go: downloading github.com/klauspost/pgzip v1.2.5
    go: downloading github.com/nwaples/rardecode v1.1.0
    go: downloading github.com/pierrec/lz4/v4 v4.1.2
    go: downloading github.com/ulikunitz/xz v0.5.9
    go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
    go: downloading github.com/fsnotify/fsnotify v1.6.0
    go: downloading github.com/jilleJr/afero v1.9.6-0.20230808154115-904d2897c961
    go: downloading github.com/spf13/jwalterweatherman v1.1.0
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
    go: downloading github.com/mitchellh/reflectwalk v1.0.2
    go: downloading k8s.io/utils v0.0.0-20230505201702-9f6742963106
    go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
    go: downloading github.com/Masterminds/semver/v3 v3.1.1
    go: downloading github.com/cloudfoundry-community/go-cfclient/v2 v2.0.0
    go: downloading github.com/pkg/errors v0.9.1
    go: downloading k8s.io/client-go v0.23.1
    go: downloading github.com/mikefarah/yq/v4 v4.16.2
    go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
    go: downloading github.com/go-logr/logr v1.2.4
    go: downloading github.com/json-iterator/go v1.1.12
    go: downloading gopkg.in/yaml.v2 v2.4.0
    go: downloading github.com/hashicorp/hcl v1.0.0
    go: downloading gopkg.in/ini.v1 v1.67.0
    go: downloading github.com/subosito/gotenv v1.4.2
    go: downloading github.com/magiconair/properties v1.8.7
    go: downloading github.com/pelletier/go-toml/v2 v2.0.8
    go: downloading github.com/russross/blackfriday/v2 v2.1.0
    go: downloading golang.org/x/net v0.14.0
    go: downloading golang.org/x/oauth2 v0.7.0
    go: downloading k8s.io/api v0.23.1
    go: downloading k8s.io/kubernetes v1.23.1
    go: downloading knative.dev/serving v0.31.0
    go: downloading github.com/golang/protobuf v1.5.3
    go: downloading github.com/googleapis/gnostic v0.5.5
    go: downloading golang.org/x/term v0.11.0
    go: downloading github.com/moby/buildkit v0.9.3
    go: downloading github.com/Akash-Nayak/GopacheConfig v0.0.0-20210730101443-d5bfa3109be4
    go: downloading github.com/BurntSushi/toml v1.0.0
    go: downloading github.com/hashicorp/go-version v1.6.0
    go: downloading github.com/joho/godotenv v1.4.0
    go: downloading golang.org/x/mod v0.10.0
    go: downloading github.com/elliotchance/orderedmap v1.4.0
    go: downloading github.com/fatih/color v1.13.0
    go: downloading github.com/goccy/go-yaml v1.9.4
    go: downloading github.com/jinzhu/copier v0.3.4
    go: downloading github.com/timtadh/lexmachine v0.2.2
    go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
    go: downloading github.com/modern-go/reflect2 v1.0.2
    go: downloading github.com/docker/go-connections v0.4.0
    go: downloading github.com/docker/go-units v0.4.0
    go: downloading github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198
    go: downloading github.com/docker/cli v0.0.0-20200210162036-a4bedce16568
    go: downloading google.golang.org/protobuf v1.30.0
    go: downloading github.com/openshift/api v0.0.0-20220112145620-704957ce4980
    go: downloading github.com/whilp/git-urls v1.0.0
    go: downloading knative.dev/networking v0.0.0-20220412163509-1145ec58c8be
    go: downloading knative.dev/pkg v0.0.0-20220412134708-e325df66cb51
    go: downloading github.com/mattn/go-colorable v0.1.12
    go: downloading github.com/mattn/go-isatty v0.0.14
    go: downloading sigs.k8s.io/yaml v1.3.0
    go: downloading k8s.io/apiserver v0.23.1
    go: downloading github.com/davecgh/go-spew v1.1.1
    go: downloading golang.org/x/time v0.1.0
    go: downloading k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
    go: downloading github.com/opencontainers/go-digest v1.0.0
    go: downloading github.com/containerd/typeurl v1.0.2
    go: downloading github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387
    go: downloading github.com/timtadh/data-structures v0.5.3
    go: downloading k8s.io/component-base v0.23.1
    go: downloading github.com/docker/distribution v2.8.0+incompatible
    go: downloading golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
    go: downloading github.com/docker/docker-credential-helpers v0.7.0
    go: downloading github.com/evanphx/json-patch/v5 v5.6.0
    go: downloading gomodules.xyz/jsonpatch/v2 v2.2.0
    go: downloading go.uber.org/atomic v1.9.0
    go: downloading go.uber.org/zap v1.21.0
    go: downloading golang.org/x/sys v0.11.0
    go: downloading github.com/hashicorp/golang-lru v0.5.4
    go: downloading github.com/blendle/zapdriver v1.3.1
    go: downloading go.uber.org/multierr v1.8.0
    gzip -f "./bin/move2kube.wasm"
    # We have to put require github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
    # in order for logrus to work. See https://github.com/HarikrishnanBalagopal/test-wasi-fs-browser/tree/main
    # CGO_ENABLED=0 tinygo build -o "./bin/move2kube.wasm" -target=wasi .
    root@e9f3aa0a9ee8:/usr/src/myapp# echo $?
    0
    # ls bin/
    move2kube  move2kube.wasm.gz
  4. Build using version 1.22.0

    $ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.22.0 bash
    Unable to find image 'golang:1.22.0' locally
    1.22.0: Pulling from library/golang
    c2964e85ea54: Pull complete 
    d3436c315a5d: Pull complete 
    603ae72c83b1: Pull complete 
    a23d83702b67: Pull complete 
    b64f8be2f560: Pull complete 
    056502cbc32b: Pull complete 
    4f4fb700ef54: Pull complete 
    Digest: sha256:7b297d9abee021bab9046e492506b3c2da8a3722cbf301653186545ecc1e00bb
    Status: Downloaded newer image for golang:1.22.0
    root@3a4e59aed3db:/usr/src/myapp# go env
    GO111MODULE=''
    GOARCH='arm64'
    GOBIN=''
    GOCACHE='/root/.cache/go-build'
    GOENV='/root/.config/go/env'
    GOEXE=''
    GOEXPERIMENT=''
    GOFLAGS=''
    GOHOSTARCH='arm64'
    GOHOSTOS='linux'
    GOINSECURE=''
    GOMODCACHE='/go/pkg/mod'
    GONOPROXY=''
    GONOSUMDB=''
    GOOS='linux'
    GOPATH='/go'
    GOPRIVATE=''
    GOPROXY='https://proxy.golang.org,direct'
    GOROOT='/usr/local/go'
    GOSUMDB='sum.golang.org'
    GOTMPDIR=''
    GOTOOLCHAIN='local'
    GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
    GOVCS=''
    GOVERSION='go1.22.0'
    GCCGO='gccgo'
    AR='ar'
    CC='gcc'
    CXX='g++'
    CGO_ENABLED='1'
    GOMOD='/usr/src/myapp/go.mod'
    GOWORK=''
    CGO_CFLAGS='-O2 -g'
    CGO_CPPFLAGS=''
    CGO_CXXFLAGS='-O2 -g'
    CGO_FFLAGS='-O2 -g'
    CGO_LDFLAGS='-O2 -g'
    PKG_CONFIG='pkg-config'
    GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3154462467=/tmp/go-build -gno-record-gcc-switches'
    root@3a4e59aed3db:/usr/src/myapp# make build
    mkdir -p "./bin"
    CGO_ENABLED=0 GOOS=wasip1 GOARCH=wasm go build -ldflags '-X github.com/konveyor/move2kube-wasm/types/info.buildmetadata=unreleased -X github.com/konveyor/move2kube-wasm/types/info.gitCommit=6173004d80d1e21592374b54362f3d9a13ab3de5 -X github.com/konveyor/move2kube-wasm/types/info.gitTreeState=clean' -o "./bin/move2kube.wasm" .
    go: downloading gopkg.in/yaml.v3 v3.0.1
    go: downloading github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
    go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
    go: downloading github.com/docker/docker v24.0.0+incompatible
    go: downloading github.com/mitchellh/mapstructure v1.5.0
    go: downloading github.com/spf13/cast v1.5.1
    go: downloading golang.org/x/crypto v0.12.0
    go: downloading golang.org/x/text v0.12.0
    go: downloading k8s.io/apimachinery v0.23.1
    go: downloading github.com/gorilla/mux v1.8.0
    go: downloading github.com/mholt/archiver/v3 v3.5.1
    go: downloading github.com/spf13/cobra v1.7.0
    go: downloading github.com/spf13/viper v1.16.0
    go: downloading github.com/Masterminds/goutils v1.1.1
    go: downloading github.com/Masterminds/semver v1.5.0
    go: downloading github.com/google/uuid v1.3.0
    go: downloading github.com/huandu/xstrings v1.3.2
    go: downloading github.com/imdario/mergo v0.3.13
    go: downloading github.com/mitchellh/copystructure v1.2.0
    go: downloading github.com/gogo/protobuf v1.3.2
    go: downloading gopkg.in/inf.v0 v0.9.1
    go: downloading github.com/google/gofuzz v1.2.0
    go: downloading github.com/google/go-cmp v0.5.9
    go: downloading k8s.io/klog/v2 v2.100.1
    go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.3
    go: downloading github.com/andybalholm/brotli v1.0.3
    go: downloading github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
    go: downloading github.com/golang/snappy v0.0.4
    go: downloading github.com/klauspost/compress v1.16.5
    go: downloading github.com/klauspost/pgzip v1.2.5
    go: downloading github.com/nwaples/rardecode v1.1.0
    go: downloading github.com/pierrec/lz4/v4 v4.1.2
    go: downloading github.com/ulikunitz/xz v0.5.9
    go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
    go: downloading github.com/fsnotify/fsnotify v1.6.0
    go: downloading github.com/jilleJr/afero v1.9.6-0.20230808154115-904d2897c961
    go: downloading github.com/spf13/jwalterweatherman v1.1.0
    go: downloading github.com/mitchellh/reflectwalk v1.0.2
    go: downloading k8s.io/utils v0.0.0-20230505201702-9f6742963106
    go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
    go: downloading github.com/Masterminds/semver/v3 v3.1.1
    go: downloading github.com/cloudfoundry-community/go-cfclient/v2 v2.0.0
    go: downloading github.com/pkg/errors v0.9.1
    go: downloading k8s.io/client-go v0.23.1
    go: downloading github.com/mikefarah/yq/v4 v4.16.2
    go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
    go: downloading github.com/go-logr/logr v1.2.4
    go: downloading github.com/json-iterator/go v1.1.12
    go: downloading gopkg.in/yaml.v2 v2.4.0
    go: downloading github.com/russross/blackfriday/v2 v2.1.0
    go: downloading github.com/subosito/gotenv v1.4.2
    go: downloading github.com/hashicorp/hcl v1.0.0
    go: downloading github.com/magiconair/properties v1.8.7
    go: downloading gopkg.in/ini.v1 v1.67.0
    go: downloading github.com/pelletier/go-toml/v2 v2.0.8
    go: downloading golang.org/x/net v0.14.0
    go: downloading golang.org/x/oauth2 v0.7.0
    go: downloading k8s.io/api v0.23.1
    go: downloading k8s.io/kubernetes v1.23.1
    go: downloading knative.dev/serving v0.31.0
    go: downloading github.com/googleapis/gnostic v0.5.5
    go: downloading github.com/golang/protobuf v1.5.3
    go: downloading golang.org/x/term v0.11.0
    go: downloading github.com/moby/buildkit v0.9.3
    go: downloading github.com/Akash-Nayak/GopacheConfig v0.0.0-20210730101443-d5bfa3109be4
    go: downloading github.com/BurntSushi/toml v1.0.0
    go: downloading github.com/hashicorp/go-version v1.6.0
    go: downloading github.com/joho/godotenv v1.4.0
    go: downloading golang.org/x/mod v0.10.0
    go: downloading github.com/elliotchance/orderedmap v1.4.0
    go: downloading github.com/fatih/color v1.13.0
    go: downloading github.com/goccy/go-yaml v1.9.4
    go: downloading github.com/jinzhu/copier v0.3.4
    go: downloading github.com/timtadh/lexmachine v0.2.2
    go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
    go: downloading github.com/modern-go/reflect2 v1.0.2
    go: downloading github.com/docker/go-units v0.4.0
    go: downloading github.com/docker/go-connections v0.4.0
    go: downloading github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198
    go: downloading github.com/docker/cli v0.0.0-20200210162036-a4bedce16568
    go: downloading google.golang.org/protobuf v1.30.0
    go: downloading github.com/openshift/api v0.0.0-20220112145620-704957ce4980
    go: downloading github.com/whilp/git-urls v1.0.0
    go: downloading github.com/mattn/go-colorable v0.1.12
    go: downloading github.com/mattn/go-isatty v0.0.14
    go: downloading knative.dev/networking v0.0.0-20220412163509-1145ec58c8be
    go: downloading knative.dev/pkg v0.0.0-20220412134708-e325df66cb51
    go: downloading sigs.k8s.io/yaml v1.3.0
    go: downloading k8s.io/apiserver v0.23.1
    go: downloading github.com/davecgh/go-spew v1.1.1
    go: downloading golang.org/x/time v0.1.0
    go: downloading k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
    go: downloading github.com/opencontainers/go-digest v1.0.0
    go: downloading github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387
    go: downloading github.com/containerd/typeurl v1.0.2
    go: downloading golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
    go: downloading k8s.io/component-base v0.23.1
    go: downloading github.com/docker/distribution v2.8.0+incompatible
    go: downloading github.com/timtadh/data-structures v0.5.3
    go: downloading github.com/docker/docker-credential-helpers v0.7.0
    go: downloading github.com/evanphx/json-patch/v5 v5.6.0
    go: downloading gomodules.xyz/jsonpatch/v2 v2.2.0
    go: downloading go.uber.org/atomic v1.9.0
    go: downloading go.uber.org/zap v1.21.0
    go: downloading golang.org/x/sys v0.11.0
    go: downloading github.com/hashicorp/golang-lru v0.5.4
    go: downloading github.com/blendle/zapdriver v1.3.1
    go: downloading go.uber.org/multierr v1.8.0
    # github.com/konveyor/move2kube-wasm
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Close is too big: 0x100010000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Close is too big: 0x100010000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Match is too big: 0x100030000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Match is too big: 0x100030000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Read is too big: 0x100050000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Read is too big: 0x100050000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Write is too big: 0x100070000
    type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Write is too big: 0x100070000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).CheckPath is too big: 0x100090000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).CheckPath is too big: 0x100090000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Close is too big: 0x1000b0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Close is too big: 0x1000b0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Match is too big: 0x1000d0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Match is too big: 0x1000d0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Read is too big: 0x1000f0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Read is too big: 0x1000f0000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Write is too big: 0x100110000
    type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Write is too big: 0x100110000
    type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).CheckPath is too big: 0x100130000
    type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).CheckPath is too big: 0x100130000
    type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).Close is too big: 0x100150000
    /usr/local/go/pkg/tool/linux_arm64/link: too many errors
    make: *** [Makefile:45: build] Error 1
    root@3a4e59aed3db:/usr/src/myapp# echo $?
    2

What did you see happen?

Build succeeds with v1.21.6 but fails with v1.22.0

What did you expect to see?

Build should succeed with v1.22.0 as well

mauri870 commented 6 months ago

Hmmm, I'm not sure if this is really a regression. It seems to be the same issue as #64856. I think we added some more functions in 1.22 and it made so now it is crossing the 2^16 limit more easily.

cc @golang/wasm @golang/compiler

thanm commented 6 months ago

Hi @HarikrishnanBalagopal I would agree with @mauri870 , this seems to be the same issue as #64856 ; it would be more productive to have the discussion all in one place. I am going to close this as a dup, please re-open if needed.

thanm commented 6 months ago

Duplicate of #64856.