BIND 9.16.0 fails to build on FreeBSD 12.1
...
making all in /root/bind9/lib/isc/tests
/bin/sh /root/bind9/libtool --mode=link cc -g -O2 -pthread -I/usr/local/include -I /usr/local/include -fPIC -Wl,-E -o aes_test aes_test.lo ../libisc.la -L/usr/lib -lcrypto -L/usr/local/lib -ljson-c -L/usr/local/lib -lxml2 -llmdb -L/usr/local/lib -luv -lrt -lpthread -ldl -L/usr/local/lib -L/usr/local/lib -lcmocka
libtool: link: cc -g -O2 -pthread -I/usr/local/include -I /usr/local/include -fPIC -Wl,-E -o .libs/aes_test .libs/aes_test.o ../.libs/libisc.so -L/usr/lib -L/usr/local/lib -lcrypto -ljson-c -lxml2 -llmdb -luv -lrt -lpthread -ldl -lcmocka -pthread -Wl,-rpath -Wl,/usr/local/lib
ld: error: ../.libs/libisc.so: undefined reference to deflate
ld: error: ../.libs/libisc.so: undefined reference to deflateEnd
ld: error: ../.libs/libisc.so: undefined reference to deflateInit_
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
The problem only affects libtool builds. Everything worked fine on FreeBSD 12.0.
Interestingly enough, the problem goes away on FreeBSD 12.1 when -ldl
is removed from the command line - which makes me think we only started hitting this problem now due to some recent change in FreeBSD's libdl (or in the C toolchain?). However, I do not think -ldl
can be removed from the command line because pkgconf --libs libuv
adds it and BIND 9.16+ cannot be built without libuv.