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
{{ message }}
Repository navigation
x/sys: x/sys/unix doesn't work with gccgo on arm #23361
Tried to use golang.org/x/sys/unix in a simple test program. go builded it.
What did you expect to see?
Nothing, because it should build
What did you see instead?
/tmp/go-build003625631/golang.org/x/sys/libunix.a(go.o): In function golang_org_x_sys_unix.Seek': /home/chri/go/src/golang.org/x/sys/unix/syscall_linux_arm.go:51: undefined reference to golang_org_x_sys_unix.seek'
collect2: error: ld returned 1 exit status
The problem is that seek syscall (and a bunch of others) are implemented through a function defined in asm_linux_arm.s which calls into the runtime. I think the problem is that the assembler code is not compatible with gccgo (i.e. binutils) and also I doubt the function is implemented in the gccgo runtime because of the strange name syscall·seek(SB)
A quick fix is attached, I reimplemented the syscall in a gccgo friendly way. I doubt the allocation is a big performance problem (as noted in syscall_linux_arm.go). But I didn't want to touch existing files, so I just prepared the drop-in file I am attaching. If you think this is the right way to fix the problem, I can prepare a patch for review.
@chripell Would you be willing to send in your change through Gerrit, as described at https://golang.org/doc/contribute.html? Otherwise someone can produce a new change; in general we can't look at your change if you haven't signed the CLA. Thanks.
Activity
tklauser commentedon Jan 8, 2018
/cc @ianlancetaylor
gopherbot commentedon Jan 8, 2018
Change https://golang.org/cl/86755 mentions this issue:
unix: restore gccgo supportianlancetaylor commentedon Jan 9, 2018
CL 86755 was a good change, but I don't actually think it fixed this specific problem.
ianlancetaylor commentedon Feb 2, 2018
@chripell Would you be willing to send in your change through Gerrit, as described at https://golang.org/doc/contribute.html? Otherwise someone can produce a new change; in general we can't look at your change if you haven't signed the CLA. Thanks.
gopherbot commentedon Mar 11, 2018
Change https://golang.org/cl/100076 mentions this issue:
x/sys/unix: fix seek while compiling with gccgo under ARMunix: restore gccgo support
unix: fix seek while compiling with gccgo under arm and 386