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

os/user: unknown symbol __stack_chk_fail_local in pcrel on linux/386 #57261

Closed
aarzilli opened this issue Dec 12, 2022 · 8 comments
Closed

os/user: unknown symbol __stack_chk_fail_local in pcrel on linux/386 #57261

aarzilli opened this issue Dec 12, 2022 · 8 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@aarzilli
Copy link
Contributor

$ go version
go version go1.20rc1 linux/386

seeing this builiding delve on linux/386:

# github.com/go-delve/delve/cmd/dlv.test
os/user(.text): unknown symbol __stack_chk_fail_local in pcrel
os/user(.text): unknown symbol __stack_chk_fail_local in pcrel
os/user(.text): unknown symbol __stack_chk_fail_local in pcrel
os/user(.text): unknown symbol __stack_chk_fail_local in pcrel
os/user(.text): relocation target __stack_chk_fail_local not defined
FAIL	github.com/go-delve/delve/cmd/dlv [build failed]

Related: #54313

This is on ubuntu 20.04.

@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 12, 2022
@thanm thanm added this to the Go1.20 milestone Dec 12, 2022
@thanm
Copy link
Contributor

thanm commented Dec 12, 2022

Thanks for the report.

Have you tried CGO_CFLAGS=-fno-stack-protector as a workaround, just to confirm?

@aarzilli
Copy link
Contributor Author

aarzilli commented Dec 12, 2022

It does work.

@thanm
Copy link
Contributor

thanm commented Dec 12, 2022

OK, thanks. Sounds like we need another CL similar to 421935, but with wider scope.

@gopherbot
Copy link

Change https://go.dev/cl/456856 mentions this issue: cmd/link: load host archive libc_nonshared.a for -fstack-protector

@gopherbot
Copy link

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

@thanm
Copy link
Contributor

thanm commented Dec 12, 2022

Not sure about the best way to fix this; sent two possible CLs.

gopherbot pushed a commit that referenced this issue Jan 31, 2023
For internal linking, at the point where we finish reading libgcc.a,
if the symbol "__stack_chk_local" is still undefined, then read
in the host archive libc_nonshared.a as well.

Updates #57261.

Change-Id: I0b1e485aa50aa7940db8cabcb3b9a7959bf99ce7
Reviewed-on: https://go-review.googlesource.com/c/go/+/456856
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link

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

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
For internal linking, at the point where we finish reading libgcc.a,
if the symbol "__stack_chk_local" is still undefined, then read
in the host archive libc_nonshared.a as well.

Updates golang#57261.

Change-Id: I0b1e485aa50aa7940db8cabcb3b9a7959bf99ce7
Reviewed-on: https://go-review.googlesource.com/c/go/+/456856
Reviewed-by: Cherry Mui <cherryyz@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
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 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants