mattn/go-sqlite3

cross compile error from mac to armv7

donknap opened this issue · 2 comments

compile command

CGO_ENABLED=1 GOARM=7 GOARCH=arm GOOS=linux CC=arm-none-eabi-gcc CXX=arm-none-eabi-g++ \
        go build -ldflags '-s -w' -o ./dpanel-arm ./*.go

download the arm toolchain from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

err message

# runtime/cgo
arm-none-eabi-gcc: error: unrecognized command-line option '-pthread'; did you mean '-fpthread'?

Thank you so much!

Your C compiler targets "bare metal" and thus is incompatible with cgo. You need one that targets Linux. (As I am not sure if such a toolchain exists for macos hosts, you may have better success compiling via a docker container.)

Your C compiler targets "bare metal" and thus is incompatible with cgo. You need one that targets Linux. (As I am not sure if such a toolchain exists for macos hosts, you may have better success compiling via a docker container.)

thanks,using arm-none-linux-gnueabihf compile successfully。

Why is there no hard float target in Mac?