Skip to content

runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel (regression in 1.19 when building for i686) #54313

Closed
@kanavin

Description

@kanavin

1.19 no longer builds for i686 targets (where 1.18 was working fine):

# 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

CGO_CFLAGS=-fno-stack-protector is a workaround.

See here for others having the same issue:
#52919

Activity

ianlancetaylor

ianlancetaylor commented on Aug 6, 2022

@ianlancetaylor
Contributor

Please fill out the issue template. Or at least tell us your GOOS and GOARCH values. Thanks.

added
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Aug 7, 2022
zhsj

zhsj commented on Aug 7, 2022

@zhsj
Contributor

It's caused by C flags -fstack-protector-strong

go env

GO111MODULE="on"
GOARCH="386"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/work/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/work/gopath/"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.19/pkg/tool/linux_386"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GO386="softfloat"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/work/gopath/src/github.com/ClusterHQ/flocker-go/go.mod"
GOWORK=""
CGO_CFLAGS="-fstack-protector-strong"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m32 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3479471873=/tmp/go-build -gno-record-gcc-switches"

go build works, but go test fails.

root@f4fdf4ead70c:/work/gopath/src/github.com/ClusterHQ/flocker-go# go build ./...
root@f4fdf4ead70c:/work/gopath/src/github.com/ClusterHQ/flocker-go# go test ./...
# github.com/ClusterHQ/flocker-go.test
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
FAIL    github.com/ClusterHQ/flocker-go [build failed]
FAIL

-fstack-protector-strong works on go1.18.

kanavin

kanavin commented on Aug 7, 2022

@kanavin
Author

Please fill out the issue template. Or at least tell us your GOOS and GOARCH values. Thanks.

Apologies. Does the above clarify matters?

ianlancetaylor

ianlancetaylor commented on Aug 8, 2022

@ianlancetaylor
Contributor

@kanavin Thanks. Does https://go.dev/cl/421935 fix the problem for you?

gopherbot

gopherbot commented on Aug 8, 2022

@gopherbot
Contributor

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

kanavin

kanavin commented on Aug 8, 2022

@kanavin
Author

@kanavin Thanks. Does https://go.dev/cl/421935 fix the problem for you?

Thanks, it does.

added this to the Go1.20 milestone on Aug 8, 2022
added
NeedsFixThe path to resolution is known, but the work has not been done.
and removed
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Aug 8, 2022
added a commit that references this issue on Aug 10, 2022
5ce1fb9
added a commit that references this issue on Aug 21, 2022

21 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tmm1@zhsj@kanavin@dmitshur@ianlancetaylor

        Issue actions

          runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel (regression in 1.19 when building for i686) · Issue #54313 · golang/go