Libpthread missing in 21.02-RC3

root@ultra:~# opkg files libpthread 
Package libpthread (1.1.24-3) is installed on root and has the following files:
root@ultra:~# locate libpthread
/rom/usr/lib/opkg/info/libpthread.control
/rom/usr/lib/opkg/info/libpthread.list
/rom/usr/lib/opkg/info/libpthread.prerm
/usr/lib/opkg/info/libpthread.control
/usr/lib/opkg/info/libpthread.list
/usr/lib/opkg/info/libpthread.postinst
/usr/lib/opkg/info/libpthread.prerm

The library libpthread is missing from the pakage and rootfs 21.02-RC3 on MVEBU for EspressoBinBoard-Ultra

So, when compiling GO, get errors !

...
# runtime/cgo
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:20: build] Error 2
...

There are no separate libpthread binaries with the default musl libc.
https://wiki.musl-libc.org/faq.html

1 Like

Thanks...

So I am trying a fix found here :
» https://github.com/openwrt/packages/issues/12642

> ...
> runtime/cgo
> # runtime/cgo
> /usr/bin/ld: cannot find -lpthread
> /usr/bin/ld: cannot find -lpthread
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:20: build] Error 2
> make: *** [Makefile:89: crowdsec] Error 2
> ...
root@ultra:~/crowdsec# ar -rc /usr/lib/libpthread.a
> ...
> go test -v ./...
> # plugin
> /usr/bin/ld: cannot find -ldl
> collect2: error: ld returned 1 exit status
> ...
root@ultra:~/crowdsec# ar -rc /usr/lib/libdl.a