You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x/sys/unix: go get -u -linkshared -buildmode=shared golang.org/x/sys/unix results in error: call to `syscall.Syscall' lacks nop, can't restore toc; recompile with -fPIC
#16662
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.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version devel +ff37d0e Tue Aug 9 17:13:43 2016 +0000 linux/ppc64le
What operating system and processor architecture are you using (go env)?
ppc64le Ubuntu 16.04
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Set up a directory and set the GOPATH to it.
go install -buildmode=shared std
go get -u -linkshared -buildmode=shared golang.org/x/sys/unix
What did you expect to see?
No output, correct shared library built for golang.org/x/sys/unix.
What did you see instead?
go get -u -linkshared -buildmode=shared golang.org/x/sys/unix
//# /tmp/go-build737614428/libgolang.org-x-sys-unix.so
/home/boger/golang/upstream/go/pkg/tool/linux_ppc64le/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-742945850/go.o: In function local.golang.org/x/sys/unix.Syscall': go.go:(.text+0x1b4c8): call tosyscall.Syscall' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: go.go:(.text+0x1b4c8): unresolvable R_PPC64_REL24 against syscall.Syscall' /usr/bin/ld: /tmp/go-link-742945850/go.o: In functionlocal.golang.org/x/sys/unix.Syscall6':
go.go:(.text+0x1b4d8): call to syscall.Syscall6' lacks nop, can't restore toc; recompile with -fPIC /usr/bin/ld: go.go:(.text+0x1b4d8): unresolvable R_PPC64_REL24 againstsyscall.Syscall6'
/usr/bin/ld: /tmp/go-link-742945850/go.o: In function local.golang.org/x/sys/unix.RawSyscall': go.go:(.text+0x1b4e8): call tosyscall.RawSyscall' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: go.go:(.text+0x1b4e8): unresolvable R_PPC64_REL24 against syscall.RawSyscall' /usr/bin/ld: /tmp/go-link-742945850/go.o: In functionlocal.golang.org/x/sys/unix.RawSyscall6':
go.go:(.text+0x1b4f8): call to syscall.RawSyscall6' lacks nop, can't restore toc; recompile with -fPIC /usr/bin/ld: go.go:(.text+0x1b4f8): unresolvable R_PPC64_REL24 againstsyscall.RawSyscall6'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
The text was updated successfully, but these errors were encountered:
I think there might be a problem with doing that, because the code in zsyscall_linux_ppc64le.go needs the LR to be correct, and if I change the BRs to BLs in asm_linux_ppc64x.s then the link register would have to be saved and restored in the asm, which would be unnecessary and bad for performance.
In looking further, I don't understand why zsyscall_linux_ppc64le.go has to call the syscall functions in asm_linux_ppc64x.s which then does a BR to the syscall.Syscall (or syscall.Syscall6, or syscall.RawSyscall, etc.). Couldn't the asm file be avoid altogether and just call syscall.Syscall directly from zsyscall_linux_ppc64le.go?
quentinmit
changed the title
sys/unix: go get -u -linkshared -buildmode=shared golang.org/x/sys/unix results in error: call to `syscall.Syscall' lacks nop, can't restore toc; recompile with -fPIC
x/sys/unix: go get -u -linkshared -buildmode=shared golang.org/x/sys/unix results in error: call to `syscall.Syscall' lacks nop, can't restore toc; recompile with -fPIC
Aug 26, 2016
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +ff37d0e Tue Aug 9 17:13:43 2016 +0000 linux/ppc64le
go env
)?ppc64le Ubuntu 16.04
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Set up a directory and set the GOPATH to it.
go install -buildmode=shared std
go get -u -linkshared -buildmode=shared golang.org/x/sys/unix
No output, correct shared library built for golang.org/x/sys/unix.
go get -u -linkshared -buildmode=shared golang.org/x/sys/unix
//# /tmp/go-build737614428/libgolang.org-x-sys-unix.so
/home/boger/golang/upstream/go/pkg/tool/linux_ppc64le/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-742945850/go.o: In function
local.golang.org/x/sys/unix.Syscall': go.go:(.text+0x1b4c8): call to
syscall.Syscall' lacks nop, can't restore toc; recompile with -fPIC/usr/bin/ld: go.go:(.text+0x1b4c8): unresolvable R_PPC64_REL24 against
syscall.Syscall' /usr/bin/ld: /tmp/go-link-742945850/go.o: In function
local.golang.org/x/sys/unix.Syscall6':go.go:(.text+0x1b4d8): call to
syscall.Syscall6' lacks nop, can't restore toc; recompile with -fPIC /usr/bin/ld: go.go:(.text+0x1b4d8): unresolvable R_PPC64_REL24 against
syscall.Syscall6'/usr/bin/ld: /tmp/go-link-742945850/go.o: In function
local.golang.org/x/sys/unix.RawSyscall': go.go:(.text+0x1b4e8): call to
syscall.RawSyscall' lacks nop, can't restore toc; recompile with -fPIC/usr/bin/ld: go.go:(.text+0x1b4e8): unresolvable R_PPC64_REL24 against
syscall.RawSyscall' /usr/bin/ld: /tmp/go-link-742945850/go.o: In function
local.golang.org/x/sys/unix.RawSyscall6':go.go:(.text+0x1b4f8): call to
syscall.RawSyscall6' lacks nop, can't restore toc; recompile with -fPIC /usr/bin/ld: go.go:(.text+0x1b4f8): unresolvable R_PPC64_REL24 against
syscall.RawSyscall6'/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
The text was updated successfully, but these errors were encountered: