chai2010 / advanced-go-programming-book

:books: 《Go语言高级编程》开源图书,涵盖CGO、Go汇编语言、RPC实现、Protobuf插件实现、Web框架实现、分布式系统等高阶主题(完稿)
https://chai2010.cn/advanced-go-programming-book/
BSD 2-Clause "Simplified" License
19.34k stars 3.21k forks source link

ch3.1 问题 #465

Closed kongminhao closed 5 years ago

kongminhao commented 5 years ago

提示:哪一章节的问题,建议如何修改

main 函数定义的那一章节。

此代码在go 1.13无法运行,报错如下。

go build -o a.out && ./a.out
# chai2010.cn/gobook/examples/ch3.1/main-01
main.main: relocation target runtime.printstring not defined for ABI0 (but is defined for ABIInternal)
main.main: relocation target runtime.printnl not defined for ABI0 (but is defined for ABIInternal)
make: [default] Error 2 (ignored)
rm: a.out: No such file or directory
make: [default] Error 1 (ignored)
go version
go version go1.13 darwin/amd64
chai2010 commented 5 years ago

Go汇编函数的ABI发生了变化,可以参考这里的方案 https://github.com/chai2010/advanced-go-programming-book/issues/427

kongminhao commented 5 years ago

Thanks♪(・ω・)ノ