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/dist: make.bash failed on linux/386 due to unknow symbol #52919

Closed
erifan opened this issue May 16, 2022 · 12 comments
Closed

cmd/dist: make.bash failed on linux/386 due to unknow symbol #52919

erifan opened this issue May 16, 2022 · 12 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@erifan
Copy link

erifan commented May 16, 2022

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

$ go version
Bootstrap go version is go1.13.8 linux/386

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="386"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_386"
GCCGO="gccgo"
GO386="387"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/golang/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build482662605=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run in linux/386 container, run:
$ linux32
$ cd golang/src
$ ./make.bash

It can also be reproduced like this on a linux/amd64 machine:
$ cd golang/src
$ linux32
$ ./make.bash

What did you expect to see?

Build successfully.

What did you see instead?

# ./make.bash
Building Go cmd/dist using /usr/lib/go-1.13. (go1.13.8 linux/386)
Building Go toolchain1 using /usr/lib/go-1.13.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/386.
# cmd/trace
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
# cmd/pprof
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
# cmd/go
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
go tool dist: FAILED: /root/golang/pkg/tool/linux_386/go_bootstrap install std cmd: exit status 2

@seankhliao
Copy link
Member

which version are you trying to build?

@erifan
Copy link
Author

erifan commented May 16, 2022

which version are you trying to build?

The latest version.

@ianlancetaylor
Copy link
Contributor

It looks like your C compiler defaults to -fstack-check being enabled. That configuration is not supported by Go. Try setting CC="gcc -fno-stack-check" in the environment when running make.bash.

@ianlancetaylor
Copy link
Contributor

Oh, I just noticed that you are building 1.13.8, which is long out of date. The current version is 1.18.2. Try that version.

@erifan
Copy link
Author

erifan commented May 17, 2022

It looks like your C compiler defaults to -fstack-check being enabled. That configuration is not supported by Go. Try setting CC="gcc -fno-stack-check" in the environment when running make.bash.

Yes, you are right. Setting CC="gcc -fno-stack-check" seems doesn't work, I worked around the issue by adding -fno-stack-protector to CGO_CFLAGS and CGO_LDFLAGS. Thanks, this is the root cause of this issue, no need to do anything in go, so close it.

@tianon
Copy link
Contributor

tianon commented Jun 10, 2022

FWIW, I'm getting the exact same failure on linux/386 in Alpine Linux when building 1.19beta1 with Go 1.18 from Alpine's package repository as my bootstrap.

Edit: can confirm that setting (only) CGO_CFLAGS=-fno-stack-protector was enough to work around it

Edit 2x: on both Alpine 3.16 and Alpine 3.15 (with Go 1.18 and 1.17 for bootstrap, respectively) 👍

@paralin
Copy link
Contributor

paralin commented Aug 5, 2022

Ran into this building for i386 on go1.19 on Buildroot, adding -fno-stack-protector to CGO_CFLAGS fixes it.

paralin added a commit to skiffos/buildroot that referenced this issue Aug 5, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 5, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 5, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 5, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/421935 mentions this issue: runtime/cgo: add -fno-stack-protector to CFLAGS

gopherbot pushed a commit that referenced this issue Aug 8, 2022
Some compilers default to having -fstack-protector on, which breaks
when using internal linking because the linker doesn't know how to
find the support functions.

Fixes #52919
Fixes #54313

Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087
Reviewed-on: https://go-review.googlesource.com/c/go/+/421935
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
aarzilli added a commit to aarzilli/delve that referenced this issue Aug 9, 2022
Go 1.19 is broken on linux/386 with some C compilers, this is a
workaround for our build script. See:

golang/go#52919

Also fix TestBuild if the first message reported by delve is not the
message that indicates the server is listening.
jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
Some compilers default to having -fstack-protector on, which breaks
when using internal linking because the linker doesn't know how to
find the support functions.

Fixes golang#52919
Fixes golang#54313

Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087
Reviewed-on: https://go-review.googlesource.com/c/go/+/421935
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
derekparker pushed a commit to go-delve/delve that referenced this issue Aug 15, 2022
Go 1.19 is broken on linux/386 with some C compilers, this is a
workaround for our build script. See:

golang/go#52919

Also fix TestBuild if the first message reported by delve is not the
message that indicates the server is listening.
paralin added a commit to skiffos/buildroot that referenced this issue Aug 15, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 15, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
@nmeum
Copy link

nmeum commented Aug 19, 2022

Just for the record: I bisected this and the build failure with -fstack-protector was introduced in Go 1.19 with commit 2049649 which explains why the build starting failing on i386 with Go 1.19.

paralin added a commit to skiffos/buildroot that referenced this issue Aug 21, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 21, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 21, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 23, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
hafu added a commit to hafu/docker-mjpeg-proxy-go that referenced this issue Sep 19, 2022
See: golang/go#52919

> It looks like your C compiler defaults to `-fstack-check` being
> enabled. That configuration is not supported by Go. Try setting
> `CC="gcc -fno-stack-check"` in the environment when running
> make.bash.
hafu added a commit to hafu/docker-mjpeg-proxy-go that referenced this issue Sep 19, 2022
See: golang/go#52919

> It looks like your C compiler defaults to `-fstack-check` being
> enabled. That configuration is not supported by Go. Try setting
> `CC="gcc -fno-stack-check"` in the environment when running
> make.bash.
paralin added a commit to skiffos/buildroot that referenced this issue Sep 26, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 1, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 4, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 15, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 16, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 25, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 26, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 26, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Oct 31, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 1, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 1, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 6, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 17, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 17, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 21, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Nov 22, 2022
Enabling the C stack protector for Cgo causes a build failure on i386:

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined
runtime/cgo(.text): relocation target __stack_chk_fail_local not defined

Add: CGO_CFLAGS=-fno-stack-protector

golang/go#52919

Set CGO_CFLAGS and other flags while building Go with make.bash as well.

Signed-off-by: Christian Stewart <christian@paral.in>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/456855 mentions this issue: os/user,net: add -fno-stack-protector to CFLAGS

gopherbot pushed a commit that referenced this issue Dec 16, 2022
Some compilers default to having -fstack-protector on, which breaks
when using internal linking because the linker doesn't know how to
find the support functions.

Updates #52919.
Updates #54313.
Fixes #57261.

Change-Id: Iaae731851407af4521fff2dfefc5b7e3e92cf284
Reviewed-on: https://go-review.googlesource.com/c/go/+/456855
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/466936 mentions this issue: cmd/link: try libspp_nonshared.a when looking for "__stack_chk_fail_local"

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/466935 mentions this issue: cmd/cgo: add -fno-stack-protector to CFLAGS (again)

gopherbot pushed a commit that referenced this issue Feb 10, 2023
Add -fno-stack-protector back to the default set of CFLAGS for cgo, so
as to avoid problems with internal linking locating the library
containing the "__stack_chk_fail_local" support function that some
compilers emit (the specific archive can vary based on GOOS).

Updates #52919.
Updates #54313.
Updates #57261.
Updates #58385.

Change-Id: I4591bfb15501f04b7afe1fcd50c4fb93c86db63d
Reviewed-on: https://go-review.googlesource.com/c/go/+/466935
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit that referenced this issue Feb 10, 2023
…ocal"

Update the code that tries to satisfy unresolved references to
"__stack_chk_fail_local" to look for "libssp_nonshared.a" in addition
to "libc_nonshared.a" (the former archive is the correct place on
Alpine).

Updates #52919.
Updates #54313.
Updates #57261.
Fixes #58385.

Change-Id: Id6cd3ebb4d5388df50a838e6efa5e5b683545b01
Reviewed-on: https://go-review.googlesource.com/c/go/+/466936
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
johanbrandhorst pushed a commit to Pryz/go that referenced this issue Feb 12, 2023
Add -fno-stack-protector back to the default set of CFLAGS for cgo, so
as to avoid problems with internal linking locating the library
containing the "__stack_chk_fail_local" support function that some
compilers emit (the specific archive can vary based on GOOS).

Updates golang#52919.
Updates golang#54313.
Updates golang#57261.
Updates golang#58385.

Change-Id: I4591bfb15501f04b7afe1fcd50c4fb93c86db63d
Reviewed-on: https://go-review.googlesource.com/c/go/+/466935
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
johanbrandhorst pushed a commit to Pryz/go that referenced this issue Feb 12, 2023
…ocal"

Update the code that tries to satisfy unresolved references to
"__stack_chk_fail_local" to look for "libssp_nonshared.a" in addition
to "libc_nonshared.a" (the former archive is the correct place on
Alpine).

Updates golang#52919.
Updates golang#54313.
Updates golang#57261.
Fixes golang#58385.

Change-Id: Id6cd3ebb4d5388df50a838e6efa5e5b683545b01
Reviewed-on: https://go-review.googlesource.com/c/go/+/466936
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

8 participants