/usr/bin/ld: cannot find -ldl

root@BORNE3:~/crowdsec/crowdsec# make release
rm -f crowdsec
go build -ldflags "-s -w -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version="v1.0.9" -X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=2021-03-12_07:49:12 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Codename=alphaga -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Tag="f2d14c8ca2f597d843340d9aca0a949e6cc0e9d1" -X github.com/crowdsecurity/crowdsec/pkg/cwversion.GoVersion="1.13.15"" -o crowdsec -v
plugin
github.com/mattn/go-sqlite3
# plugin
/usr/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
# github.com/mattn/go-sqlite3
/usr/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:20: build] Error 2
make: *** [Makefile:83: crowdsec] Error 2

Hello @Gandalf !

on which platform / distribution are you trying to build crowdsec ?

Héllo @thibault !
I try a host build on OpenWrt
on an MVEBU arm64 (aarch64_cortex-a53, espressobin board, OpenWrt 19.07)

If working, I want to package it (crossbuilding) and upstream it for the next 21.02 OpenWrt release.

I have open a subject on OpenWrt forum; /usr/bin/ld: cannot find -ldl - For Developers - OpenWrt Forum

root@BORNE3:~/crowdsec/crowdsec# uname -ar
Linux BORNE3 4.14.221 #0 SMP Mon Feb 15 15:22:37 2021 aarch64 GNU/Linux

any verbose/debug mode available ?

Hello,

for the build it would be related to the make command debug itself, with --debug and the appropriate modifier, like basic, verbose, implicit, jobs, all, or makefile.

Sorry for the quick answer, but I will try to look into it more seriously next week hopefully :slightly_smiling_face:

(note: if it’s related to this issue, solution might be to cross-compile it)