Skip to content

cmd/link: external linking can fail on Solaris 11.2+ #14957

@jtsylve

Description

@jtsylve
  1. What version of Go are you using (go version)?
    go version devel +ba333a3 Fri Mar 25 01:09:28 2016 +0000 solaris/amd64
  2. What operating system and processor architecture are you using (go env)?
    SunOS solaris 5.11 11.3 i86pc i386 i86pc
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="solaris"
GOOS="solaris"
GOPATH=""
GORACE=""
GOROOT="/export/home/joe/src/go"
GOTOOLDIR="/export/home/joe/src/go/pkg/tool/solaris_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build162816245=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

GCC:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/lto-wrapper
Target: i386-pc-solaris2.11
Configured with: /builds/hudson/workspace/nightly-update/build/i386/components/gcc48/gcc-4.8.2/configure CC=/usr/gcc/4.7/bin/gcc CXX=/usr/gcc/4.7/bin/g++ --prefix=/usr/gcc/4.8 --mandir=/usr/gcc/4.8/share/man --bindir=/usr/gcc/4.8/bin --libdir=/usr/gcc/4.8/lib --sbindir=/usr/gcc/4.8/sbin --infodir=/usr/gcc/4.8/share/info --libexecdir=/usr/gcc/4.8/lib --enable-languages=c,c++,fortran,objc --enable-shared --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as CFLAGS='-g -O2  -mtune=opteron -march=opteron' CXXFLAGS='-g -O2 -mtune=opteron -march=opteron'
Thread model: posix
gcc version 4.8.2 (GCC) 
  1. What did you do?

Bootstrapping with Go 1.4.3

##### Testing packages.
ok      archive/tar 0.023s
ok      archive/zip 0.074s
ok      bufio   0.044s
ok      bytes   0.062s
ok      compress/bzip2  0.062s
ok      compress/flate  0.851s
ok      compress/gzip   0.013s
ok      compress/lzw    0.008s
ok      compress/zlib   0.021s
ok      container/heap  0.006s
ok      container/list  0.006s
ok      container/ring  0.013s
ok      crypto/aes  0.024s
ok      crypto/cipher   0.006s
ok      crypto/des  0.013s
ok      crypto/dsa  0.007s
ok      crypto/ecdsa    0.018s
ok      crypto/elliptic 0.027s
ok      crypto/hmac 0.006s
ok      crypto/md5  0.006s
ok      crypto/rand 0.012s
ok      crypto/rc4  0.055s
ok      crypto/rsa  0.058s
ok      crypto/sha1 0.006s
ok      crypto/sha256   0.006s
ok      crypto/sha512   0.006s
ok      crypto/subtle   0.007s
ok      crypto/tls  0.471s
ok      crypto/x509 0.658s
ok      database/sql    0.035s
ok      database/sql/driver 0.006s
ok      debug/dwarf 0.015s
ok      debug/elf   0.025s
ok      debug/gosym 0.220s
ok      debug/macho 0.008s
ok      debug/pe    0.025s
ok      debug/plan9obj  0.006s
ok      encoding/ascii85    0.006s
ok      encoding/asn1   0.007s
ok      encoding/base32 0.011s
ok      encoding/base64 0.007s
ok      encoding/binary 0.006s
ok      encoding/csv    0.007s
ok      encoding/gob    0.033s
ok      encoding/hex    0.006s
ok      encoding/json   0.105s
ok      encoding/pem    0.013s
ok      encoding/xml    0.012s
ok      errors  0.007s
ok      expvar  0.008s
ok      flag    0.008s
ok      fmt 0.073s
ok      go/ast  0.011s
ok      go/build    0.153s
ok      go/constant 0.007s
ok      go/doc  0.034s
ok      go/format   0.009s
ok      go/internal/gccgoimporter   0.007s
ok      go/internal/gcimporter  0.354s
ok      go/parser   0.028s
ok      go/printer  0.185s
ok      go/scanner  0.006s
ok      go/token    0.016s
ok      go/types    0.317s
ok      hash/adler32    0.011s
ok      hash/crc32  0.006s
ok      hash/crc64  0.007s
ok      hash/fnv    0.005s
ok      html    0.007s
ok      html/template   0.026s
ok      image   0.076s
ok      image/color 0.038s
ok      image/draw  0.042s
ok      image/gif   0.053s
ok      image/jpeg  0.095s
ok      image/png   0.028s
ok      index/suffixarray   0.014s
ok      internal/singleflight   0.017s
ok      internal/trace  0.006s
ok      io  0.025s
ok      io/ioutil   0.006s
ok      log 0.008s
ok      log/syslog  2.029s
ok      math    0.007s
ok      math/big    0.181s
ok      math/cmplx  0.006s
ok      math/rand   0.055s
ok      mime    0.009s
ok      mime/multipart  0.171s
ok      mime/quotedprintable    0.077s
ok      net 3.225s
ok      net/http    9.887s
ok      net/http/cgi    0.226s
ok      net/http/cookiejar  0.010s
ok      net/http/fcgi   0.009s
ok      net/http/httptest   0.011s
ok      net/http/httputil   0.032s
ok      net/http/internal   0.006s
ok      net/internal/socktest   0.006s
ok      net/mail    0.007s
ok      net/rpc 0.015s
ok      net/rpc/jsonrpc 0.012s
ok      net/smtp    0.027s
ok      net/textproto   0.007s
ok      net/url 0.010s
ok      os  0.306s
ok      os/exec 0.595s
ok      os/signal   4.398s
ok      os/user 0.006s
ok      path    0.007s
ok      path/filepath   0.044s
ok      reflect 0.045s
ok      regexp  0.077s
ok      regexp/syntax   0.224s
--- FAIL: TestCgoCrashHandler (1.40s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoSignalDeadlock (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoTraceback (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoCallbackGC (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoExternalThreadPanic (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoExternalThreadSIGPROF (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoExternalThreadSignal (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoExecSignalMask (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestEnsureDropM (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoCheckBytes (0.00s)
    crash_cgo_test.go:162: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoPanicDeadlock (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


--- FAIL: TestCgoCCodeSIGPROF (0.00s)
    crash_test.go:66: building testprogcgo: exit status 2
        # _/export/home/joe/src/go/src/runtime/testdata/testprogcgo
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


FAIL
FAIL    runtime 7.737s
ok      runtime/debug   0.008s
ok      runtime/internal/atomic 0.055s
ok      runtime/pprof   1.285s
ok      runtime/trace   3.394s
ok      sort    0.044s
ok      strconv 0.298s
ok      strings 0.069s
ok      sync    0.104s
ok      sync/atomic 0.016s
ok      syscall 0.024s
ok      testing 2.330s
ok      testing/quick   0.110s
ok      text/scanner    0.007s
ok      text/tabwriter  0.007s
ok      text/template   0.020s
ok      text/template/parse 0.008s
ok      time    2.319s
ok      unicode 0.007s
ok      unicode/utf16   0.006s
ok      unicode/utf8    0.008s
ok      vendor/golang.org/x/net/http2/hpack 0.008s
ok      cmd/addr2line   0.603s
ok      cmd/api 0.012s
ok      cmd/asm/internal/asm    0.144s
ok      cmd/asm/internal/lex    0.007s
ok      cmd/compile/internal/big    0.436s
ok      cmd/compile/internal/gc 12.885s
ok      cmd/compile/internal/ssa    0.151s
ok      cmd/cover   1.121s
ok      cmd/doc 0.023s
ok      cmd/fix 0.012s
--- FAIL: TestCoverageWithCgo (0.64s)
    go_test.go:244: running testgo [test -short -cover ./testdata/cgocover]
    go_test.go:259: standard output:
    go_test.go:260: FAIL    _/export/home/joe/src/go/src/cmd/go/testdata/cgocover [build failed]

    go_test.go:263: standard error:
    go_test.go:264: # testmain
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


    go_test.go:273: go [test -short -cover ./testdata/cgocover] failed unexpectedly: exit status 2
--- FAIL: TestNoteReading (0.33s)
    go_test.go:244: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -o /tmp/gotest401197282/hello.exe /tmp/gotest401197282/hello.go]
    go_test.go:244: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest401197282/hello.exe /tmp/gotest401197282/hello.go]
    go_test.go:263: standard error:
    go_test.go:264: # command-line-arguments
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


    go_test.go:273: go [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest401197282/hello.exe /tmp/gotest401197282/hello.go] failed unexpectedly: exit status 2
--- FAIL: TestNoteReading2K (0.36s)
    go_test.go:244: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -o /tmp/gotest764207321/hello.exe /tmp/gotest764207321/hello.go]
    go_test.go:244: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest764207321/hello.exe /tmp/gotest764207321/hello.go]
    go_test.go:263: standard error:
    go_test.go:264: # command-line-arguments
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status


    go_test.go:273: go [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest764207321/hello.exe /tmp/gotest764207321/hello.go] failed unexpectedly: exit status 2
FAIL
FAIL    cmd/go  42.164s
ok      cmd/gofmt   0.031s
ok      cmd/internal/goobj  0.006s
ok      cmd/internal/obj    0.006s
ok      cmd/internal/obj/x86    0.007s
ok      cmd/internal/unvendor/golang.org/x/arch/arm/armasm  0.008s
ok      cmd/internal/unvendor/golang.org/x/arch/x86/x86asm  0.124s
ok      cmd/nm  0.551s
--- FAIL: TestDisasmExtld (0.76s)
    objdump_test.go:71: go build fmthello.go: exit status 2
        # command-line-arguments
        /export/home/joe/src/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
        ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym
        collect2: error: ld returned 1 exit status

FAIL
FAIL    cmd/objdump 1.516s
ok      cmd/pack    1.345s
ok      cmd/pprof/internal/profile  0.006s
ok      cmd/vet 2.004s
2016/03/24 21:25:34 Failed: exit status 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions