Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to compile go-sqlite3 in win7 x64 use arm-none-linux-gnueabihf-gcc for arm linux? #834

Closed
xzzh999 opened this issue Jul 21, 2020 · 4 comments

Comments

@xzzh999
Copy link

xzzh999 commented Jul 21, 2020

Hi~
nice work~

when i compile go-sqlite3 for the target arm linux on win7, i failed the building when use goland.
the env is CC=arm-none-linux-gnueabihf-gcc;GOOS=linux;GOARCH=arm;CGO_ENABLED=1

i download the gcc from this page, and use gcc-arm-9.2-2019.12-mingw-w64-i686-arm-none-linux-gnueabihf.tar.xz

the errors:

# runtime/cgo
collect2.exe: fatal error: CreateProcess: No such file or directory
compilation terminated.

and i tried restart goland, it failed the same.

need u help, thanks~

@xzzh999
Copy link
Author

xzzh999 commented Jul 22, 2020

finally i build it ok by follow steps:

1.  go to https://www.linaro.org/downloads/ to download arm-linux-gnueabihf, and select
     gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf.tar.xz

2.  set env to: 
     CC=arm-linux-gnueabihf-gcc;CXX=arm-linux-gnueabihf-g++;CGO_ENABLED=1;GOOS=linux;GOARCH=arm;GOARM=7

3. set go buld argments:
     -ldflags="-extldflags=-static"

@xzzh999 xzzh999 closed this as completed Jul 22, 2020
@xzzh999
Copy link
Author

xzzh999 commented Jul 22, 2020

relate:
#242
#504

@reski-rukmantiyo
Copy link

finally i build it ok by follow steps:

1.  go to https://www.linaro.org/downloads/ to download arm-linux-gnueabihf, and select
     gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf.tar.xz

2.  set env to: 
     CC=arm-linux-gnueabihf-gcc;CXX=arm-linux-gnueabihf-g++;CGO_ENABLED=1;GOOS=linux;GOARCH=arm;GOARM=7

3. set go buld argments:
     -ldflags="-extldflags=-static"

hi @xzzh999 , just wondering is it also aplicable for linux as well? i'm using ubuntu 18.04 . Thanks

@xzzh999
Copy link
Author

xzzh999 commented Apr 17, 2021

@reski-rukmantiyo u just need the right cross gcc, it should works.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants