英文:
golang: CGO / clang with sqlite3.c
问题
我想在OSX上编译为ARM架构。使用以下命令:
GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -o foo main.go
但是我得到了以下错误:
runtime/cgo
clang: error: argument unused during compilation: '-mno-thumb'
我使用了这个包:https://github.com/mattn/go-sqlite3
我尝试了这些提示:https://github.com/mattn/go-sqlite3/issues/106
谢谢你的帮助
英文:
I would like to compile to arm on osx.
With the following command:
GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -o foo main.go
But I get:
runtime/cgo
clang: error: argument unused during compilation: '-mno-thumb'
I use this package: https://github.com/mattn/go-sqlite3
I tried the hints: https://github.com/mattn/go-sqlite3/issues/106
Thanks for every help
答案1
得分: 1
根据你提供的内容,我给出以下翻译:
"正如你提供的错误报告所说,你需要一个能够针对ARM Linux进行编译的C编译器。虽然Go工具链已经包含了用于交叉编译纯Go代码所需的一切,但它并不包括用于交叉编译使用cgo的包的C组件所需的工具。" - James Henstridge
结果是,我在ARM设备(树莓派)上编译了它。
英文:
"As the bug report you linked to says, you will need a C compiler that targets ARM Linux. While the Go toolchain comes with everything you need to cross compile pure Go code, it doesn't include the tools needed to cross compile the C components of packages that use cgo." – James Henstridge
The result, I compiled it on the arm device (raspberrypi).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论