4 ms·
This is not a language problem, but a compiler problem also. gccgo uses registers like C.
by jen20 6y ago
This is not a language problem, but a compiler problem also. gccgo uses registers like C.
- uryga 6y agotrue, thanks for pointing that out!
- jeffbee 6y agoHow can that be true? Every assembly function in Go moves its arguments from memory relative to the stack pointer. If the arguments were in registers instead it would break every assembly function. Does gccgo not support asm?
- uryga 6y ago> In contrast to 6g (the original Go compiler) gccgo tries to mimic the native calling convention. https://dr-knz.net/go-calling-convention-x86-64.html#differences-with-gccgo https://dr-knz.net/go-calling-convention-x86-64.html#differe...
- jeffbee 6y agoI just tried it and it won't build my existing Go packages that include x86 assembly files. So I conclude that it does indeed break compatibility with asm, which certainly is one way to change the calling convention.
- millstone 6y agoIt's more than a compiler problem: Go modules contain assembly routines which assume the Go calling conventions, so changing the convention is now quite breaking. There's a lesson in there about success, or something...