Solve error with lzo compression library in golang on apple M2 arch

Job ID: 36342068

Budget: ₹600 – ₹1,500 INR

Build Error: go build -o /projectpath/__debug_bin -gcflags all=-N -l ./main.go
# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
ld: warning: ignoring file /usr/local/lib//liblzo2.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"___lzo_init_v2", referenced from:
_my_lzo_init in 000001.o
_my_lzo_init in 000003.o
"_lzo1z_decompress", referenced from:
__cgo_7f76bd9bcff1_Cfunc_lzo1z_decompress in 000001.o
__cgo_1fa636beacab_Cfunc_lzo1z_decompress in 000003.o
(maybe you meant: __cgo_1fa636beacab_Cfunc_lzo1z_decompress, __cgo_7f76bd9bcff1_Cfunc_lzo1z_decompress )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation) (exit status 1)

I have built lzo using make command after downloading source from http://www.oberhumer.com/opensource/lzo/

More specs:
I use apple macbook m2 pro
This project is in golang
I use lzo in golang using cgo
Related categories: C Programming Software Architecture Mac OS Golang UNIX