Navigation Menu

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: FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 #13139

Closed
paulzhol opened this issue Nov 3, 2015 · 7 comments
Closed

cmd/link: FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 #13139

paulzhol opened this issue Nov 3, 2015 · 7 comments
Milestone

Comments

@paulzhol
Copy link
Member

paulzhol commented Nov 3, 2015

FreeBSD 11.0-CURRENT r288943 switched to clang 3.7 causing the build to fail:

cmd/go
cmd/compile/internal/amd64
cmd/compile/internal/arm
cmd/compile/internal/arm64
cmd/compile/internal/ppc64
cmd/compile/internal/x86
cmd/compile
# cmd/go
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#18: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#19: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#20: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#28: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#29: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#30: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#38: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#39: ignoring  in section 17 (type 0)
...
/tmp/goexp/pkg/tool/freebsd_arm/link: too many errors


cmd/trace
cmd/pprof/internal/commands
cmd/pprof/internal/driver
cmd/pprof
# cmd/trace
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#18: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#19: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#20: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#28: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#29: ignoring  in section 17 (type 0)
/tmp/goexp/pkg/freebsd_arm/net.a(_all.o): sym#30: ignoring  in section 17 (type 0)
...
/tmp/goexp/pkg/tool/freebsd_arm/link: too many errors

According to readelf, section 17 is .debug_str in _all.o obj file in net.a.

Building with CGO_ENABLE=0 succeeds.

@rakyll rakyll changed the title FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 cgo: FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 Nov 3, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 3, 2015
@ianlancetaylor ianlancetaylor changed the title cgo: FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 cmd/link: FreeBSD/ARM builder failing with cgo enabled on FreeBSD 11 Nov 3, 2015
@ianlancetaylor
Copy link
Contributor

Can you attach the _all.o file?

@paulzhol
Copy link
Member Author

paulzhol commented Nov 4, 2015

_all.o
net.a

@ianlancetaylor
Copy link
Contributor

That's weird, the _all.o file has unnamed symbols with no type. The readelf -s --wide output:

18: 00000000     0 NOTYPE  LOCAL  DEFAULT   17 
19: 00000045     0 NOTYPE  LOCAL  DEFAULT   17 
20: 00000073     0 NOTYPE  LOCAL  DEFAULT   17 

If you feel like it, you should report this as an LLVM bug.

Could you please see if the problem is fixed by https://golang.org/cl/16667 ? Thanks.

@gopherbot
Copy link

CL https://golang.org/cl/16667 mentions this issue.

@paulzhol
Copy link
Member Author

paulzhol commented Nov 5, 2015

# cmd/go
panic: runtime error: index out of range

goroutine 1 [running]:
bootstrap/link/internal/ld.genasmsym(0x2369cc)
        /tmp/goexp2/src/cmd/link/internal/ld/lib.go:1810 +0x19c
bootstrap/link/internal/ld.Asmelfsym()
        /tmp/goexp2/src/cmd/link/internal/ld/symtab.go:213 +0x78
bootstrap/link/internal/arm.asmb()
        /tmp/goexp2/src/cmd/link/internal/arm/asm.go:643 +0x1548
bootstrap/link/internal/ld.Ldmain()
        /tmp/goexp2/src/cmd/link/internal/ld/pobj.go:125 +0x2cc0
bootstrap/link/internal/arm.Main()
        /tmp/goexp2/src/cmd/link/internal/arm/obj.go:44 +0x20
main.main()
        /tmp/goexp2/src/cmd/link/main.go:28 +0x304

...

# cmd/trace
panic: runtime error: index out of range

goroutine 1 [running]:
bootstrap/link/internal/ld.genasmsym(0x2369cc)
        /tmp/goexp2/src/cmd/link/internal/ld/lib.go:1810 +0x19c
bootstrap/link/internal/ld.Asmelfsym()
        /tmp/goexp2/src/cmd/link/internal/ld/symtab.go:213 +0x78
bootstrap/link/internal/arm.asmb()
        /tmp/goexp2/src/cmd/link/internal/arm/asm.go:643 +0x1548
bootstrap/link/internal/ld.Ldmain()
        /tmp/goexp2/src/cmd/link/internal/ld/pobj.go:125 +0x2cc0
bootstrap/link/internal/arm.Main()
        /tmp/goexp2/src/cmd/link/internal/arm/obj.go:44 +0x20
main.main()
        /tmp/goexp2/src/cmd/link/main.go:28 +0x304
cmd/pprof/internal/symbolizer
cmd/pprof/internal/symbolz
cmd/vet/whitelist
cmd/pprof
cmd/vet
# cmd/pprof
panic: runtime error: index out of range

goroutine 1 [running]:
bootstrap/link/internal/ld.genasmsym(0x2369cc)
        /tmp/goexp2/src/cmd/link/internal/ld/lib.go:1810 +0x19c
bootstrap/link/internal/ld.Asmelfsym()
        /tmp/goexp2/src/cmd/link/internal/ld/symtab.go:213 +0x78
bootstrap/link/internal/arm.asmb()
        /tmp/goexp2/src/cmd/link/internal/arm/asm.go:643 +0x1548
bootstrap/link/internal/ld.Ldmain()
        /tmp/goexp2/src/cmd/link/internal/ld/pobj.go:125 +0x2cc0
bootstrap/link/internal/arm.Main()
        /tmp/goexp2/src/cmd/link/internal/arm/obj.go:44 +0x20
main.main()
        /tmp/goexp2/src/cmd/link/main.go:28 +0x304

/tmp/goexp2/src/cmd/link/internal/ld/lib.go:1810 tries to access s.Name[0], but it's an empty string.
if s.Hide != 0 || (s.Name[0] == '.' && s.Version == 0 && s.Name != ".rathole") {

@ianlancetaylor
Copy link
Contributor

Thanks for testing it. I've updated the CL to avoid that problem. Can you try it again?

@paulzhol
Copy link
Member Author

paulzhol commented Nov 6, 2015

It works! Thanks!

@golang golang locked and limited conversation to collaborators Nov 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants