I’m trying to leverage the Go STDLIB support for developing plugins for a Go based app. I am aware that Go plugins are only supported on Linux due to the plugin being built as an ‘.so’ file. So, since I’m on an Apple Silicon Mac, I created a Debian 13 VM via VMWare Fusion and doing development on that VM. However, and i’ll caveat that I’m not sure if this is due to the VM being an arm64 VM instead of an amd64, but I keep getting this error when trying to go build -buildmode=plugin
go build -buildmode=plugin -o go_logger.so go_logger.go
command-line-arguments
/usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
/usr/bin/gcc -Wl,-z,relro -shared -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -Wl,–build-id=0x3d68bb49a9069536da12026baf611cadbd260c4f -o a.out.so -rdynamic /tmp/go-link-2814085267/go.o /tmp/go-link-2814085267/000000.o /tmp/go-link-2814085267/000001.o /tmp/go-link-2814085267/000002.o /tmp/go-link-2814085267/000003.o /tmp/go-link-2814085267/000004.o /tmp/go-link-2814085267/000005.o /tmp/go-link-2814085267/000006.o /tmp/go-link-2814085267/000007.o /tmp/go-link-2814085267/000008.o /tmp/go-link-2814085267/000009.o /tmp/go-link-2814085267/000010.o /tmp/go-link-2814085267/000011.o /tmp/go-link-2814085267/000012.o /tmp/go-link-2814085267/000013.o /tmp/go-link-2814085267/000014.o /tmp/go-link-2814085267/000015.o /tmp/go-link-2814085267/000016.o /tmp/go-link-2814085267/000017.o /tmp/go-link-2814085267/000018.o /tmp/go-link-2814085267/000019.o -O2 -g -lresolv -O2 -g -lpthread
collect2: fatal error: cannot find ‘ld’
compilation terminated.
I do have bintools installed and I do see ‘ld’ in the path:
randalc@golang:~/work/gorchestrator/log-plugin$ which ld
/usr/bin/ld
randalc@golang:~/work/gorchestrator/log-plugin$ file which ld
/usr/bin/ld: symbolic link to aarch64-linux-gnu-ld
randalc@golang:~/work/gorchestrator/log-plugin$ ll which ld
lrwxrwxrwx 1 root root 20 Mar 3 2025 /usr/bin/ld → aarch64-linux-gnu-ld
Can anyone offer any other insights into where I should look next, or how I can get this working?