Skip to content

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

@laboger

Description

@laboger

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version devel +ff37d0e Tue Aug 9 17:13:43 2016 +0000 linux/ppc64le
  2. What operating system and processor architecture are you using (go env)?
    ppc64le Ubuntu 16.04
  3. 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
  4. What did you expect to see?
    No output, correct shared library built for golang.org/x/sys/unix.
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions