3 ms·
I'd love to know how this works behind the scenes. In the article, a file called chello.c and a file called gohello.go are created - do the filenames have any
by voltagex_ 12y ago
I'd love to know how this works behind the scenes.
In the article, a file called chello.c and a file called gohello.go are created - do the filenames have any significance? How does the go compiler and linker know what to do here?
- shanemhansen 12y agoRun strace -f -eexecve go build to see whats going on under the covers. The filenames are because 6c and 6g both produced an object file named hello.6. 6g,6c, and 6a produce object files on amd64. 6l is the linker which combines them. Honestly I had a little trouble running the commands individually so I just used go build.
- 4ad 12y agoRun go build -x There's no need for strace.