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: need to handle new-style loong64 relocs #63725

Closed
abner-chenc opened this issue Oct 25, 2023 · 4 comments
Closed

cmd/link: need to handle new-style loong64 relocs #63725

abner-chenc opened this issue Oct 25, 2023 · 4 comments
Labels
arch-loong64 Issues solely affecting the loongson architecture. compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@abner-chenc
Copy link
Contributor

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

$ go version
go version go1.21.3 linux/loong64

Does this issue reproduce with the latest release?

Yes (found during packaging testing)

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

Debian Linux sid, Loongson 3A5000.

go env Output
$ go env

What did you do?

cd $GOROOT/src/cmd/link && go test ./...

What did you expect to see?

all tests pass

What did you see instead?

ok  	cmd/internal/src	0.013s
ok  	cmd/internal/test2json	0.779s
--- FAIL: TestMinusRSymsWithSameName (0.76s)
    elf_test.go:164: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -c -o /tmp/TestMinusRSymsWithSameName5512364/001/x0.o /tmp/TestMinusRSymsWithSameName5512364/001/x0.c
    elf_test.go:164: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -c -o /tmp/TestMinusRSymsWithSameName5512364/001/x1.o /tmp/TestMinusRSymsWithSameName5512364/001/x1.c
    elf_test.go:172: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -nostdlib -r -o /tmp/TestMinusRSymsWithSameName5512364/001/ldr.syso [/tmp/TestMinusRSymsWithSameName5512364/001/x0.o /tmp/TestMinusRSymsWithSameName5512364/001/x1.o]
    elf_test.go:192: /root/debian-upstream/golang-1.21-1.21.3/bin/go build
    elf_test.go:197: # elf_test
        /tmp/go-build2943499130/b001/_pkg_.a(ldr.syso): unknown relocation type 66; compiled without -fpic?
    elf_test.go:198: exit status 1
FAIL
FAIL	cmd/link	13.001s
ok  	cmd/link/internal/benchmark	0.023s
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 25, 2023
@abner-chenc abner-chenc added this to the Go1.22 milestone Oct 25, 2023
@abner-chenc abner-chenc added the arch-loong64 Issues solely affecting the loongson architecture. label Oct 25, 2023
@gopherbot
Copy link

Change https://go.dev/cl/537615 mentions this issue: cmd/link/internal/loadelf: add additional relocations for loong64

@dr2chase
Copy link
Contributor

@golang/compiler does this want a backport, perhaps? The change is small, and this looks like regression (though I am not sure).

@dr2chase dr2chase added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 25, 2023
@cherrymui
Copy link
Member

cherrymui commented Oct 25, 2023

Looks fine with me. Up to the Loong64 maintainers for whether this needs backport.

I think this is not a regression, just that Go 1.21 doesn't support newer C toolchains. To be clear, what version of the C toolchain do you use?

@gopherbot
Copy link

Change https://go.dev/cl/548478 mentions this issue: doc/go1.22: document addtional constants in debug/elf package

gopherbot pushed a commit that referenced this issue Dec 8, 2023
Updates #61974, #63725.
For #61422.

Change-Id: Ifd6c62e877dbd13f0e86fef801fe70d39fb3a66b
Reviewed-on: https://go-review.googlesource.com/c/go/+/548478
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
Updates golang#61974, golang#63725.
For golang#61422.

Change-Id: Ifd6c62e877dbd13f0e86fef801fe70d39fb3a66b
Reviewed-on: https://go-review.googlesource.com/c/go/+/548478
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-loong64 Issues solely affecting the loongson architecture. compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants