Securing-DevOps/invoicer-chapter2

Invoicer compiling issue on mac arm64

Opened this issue · 0 comments

I installed the arm based version of go on my mac, when trying to compile the source code for invoicer 2.4 i get the following error.

$ go install --ldflags '-extldflags "-static"' -v github.com/Securing-Devops/invoicer-chapter2@latest
go: finding module for package go.mozilla.org/mozlog
go: finding module for package github.com/gorilla/mux
go: finding module for package github.com/jinzhu/gorm/dialects/sqlite
go: finding module for package github.com/jinzhu/gorm
go: finding module for package github.com/wader/gormstore
go: finding module for package github.com/jinzhu/gorm/dialects/postgres
go: found github.com/gorilla/mux in github.com/gorilla/mux v1.8.0
go: found github.com/jinzhu/gorm in github.com/jinzhu/gorm v1.9.16
go: found github.com/jinzhu/gorm/dialects/postgres in github.com/jinzhu/gorm v1.9.16
go: found github.com/jinzhu/gorm/dialects/sqlite in github.com/jinzhu/gorm v1.9.16
go: found github.com/wader/gormstore in github.com/wader/gormstore v0.0.0-20220402164052-db5a9afbfd30
go: found go.mozilla.org/mozlog in go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403
# github.com/Securing-Devops/invoicer-chapter2
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

clang version

$ clang --version                                                                                    
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Please let me know if you need anything else to reproduce, any guidance on how to fix error would be appreciated.