On 2018-03-04, Brad Smith brad@comstyle.com wrote:
Trying to build Dovecot 2.2.34 on OpenBSD fails.
This seems to have been introduced by this commit.. https://github.com/dovecot/core/commit/4a9020ed888caf03fd3132a30a7818b01daa4...
This is libtool-related. GNU libtool prints a warning but is able to link:
$ /usr/local/bin/libtool --tag=CC --mode=link cc -I../../src/lib -I../../src/lib-test -DMODULE_DIR=\""/usr/local/lib/dovecot"\" -std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -L/usr/local/lib -o test-ssl-iostream test_ssl_iostream-test-ssl-iostream.o libssl_iostream_openssl.la libssl_iostream.la ../lib-test/libtest.la ../lib/liblib.la -export-dynamic *** Warning: Linking the executable test-ssl-iostream against the loadable module *** libssl_iostream_openssl.so is not portable! libtool: link: cc -I../../src/lib -I../../src/lib-test -DMODULE_DIR=\"/usr/local/lib/dovecot\" -std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -o .libs/test-ssl-iostream test_ssl_iostream-test-ssl-iostream.o -Wl,-E -L/usr/local/lib -L./.libs -lssl_iostream_openssl -lssl -lcrypto ./.libs/libssl_iostream.a ../lib-test/.libs/libtest.a ../lib/.libs/liblib.a -Wl,-rpath,/usr/local/lib/dovecot ../lib/.libs/liblib.a(net.o): In function `net_connect_unix_with_retries': net.c:(.text+0x852): warning: rand() may return deterministic values, is that what you want?
But it fails with OpenBSD libtool:
$ /usr/bin/libtool --tag=CC --mode=link cc -I../../src/lib -I../../src/lib-test -DMODULE_DIR=\""/usr/local/lib/dovecot"\" -std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -L/usr/local/lib -o test-ssl-iostream test_ssl_iostream-test-ssl-iostream.o libssl_iostream_openssl.la libssl_iostream.la ../lib-test/libtest.la ../lib/liblib.la -export-dynamic
warning: library filename /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream_openssl.so has no version number
libtool: link: cc -o .libs/test-ssl-iostream -I../../src/lib -I../../src/lib-test -DMODULE_DIR="/usr/local/lib/dovecot" -std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -Wl,-E test_ssl_iostream-test-ssl-iostream.o /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream.a /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib-test/.libs/libtest.a /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib/.libs/liblib.a -L.libs -lssl_iostream_openssl -lssl -lcrypto -Wl,-rpath,/usr/local/lib/dovecot
/usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib/.libs/liblib.a(net.o): In function net_connect_unix_with_retries': net.c:(.text+0x852): warning: rand() may return deterministic values, is that what you want? .libs/libssl_iostream_openssl.so: undefined reference to
ssl_iostream_cert_match_name'
.libs/libssl_iostream_openssl.so: undefined reference to ssl_iostream_context_deinit' .libs/libssl_iostream_openssl.so: undefined reference to
ssl_iostream_handshake'
.libs/libssl_iostream_openssl.so: undefined reference to ssl_iostream_unref' .libs/libssl_iostream_openssl.so: undefined reference to
iostream_ssl_module_init'
.libs/libssl_iostream_openssl.so: undefined reference to `ssl_iostream_has_valid_client_cert'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Error while executing cc -o .libs/test-ssl-iostream -I../../src/lib -I../../src/lib-test -DMODULE_DIR="/usr/local/lib/dovecot" -std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -Wl,-E test_ssl_iostream-test-ssl-iostream.o /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream.a /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib-test/.libs/libtest.a /usr/obj/ports/dovecot-2.2.34/dovecot-2.2.34/src/lib/.libs/liblib.a -L.libs -lssl_iostream_openssl -lssl -lcrypto -Wl,-rpath,/usr/local/lib/dovecot
Clearly OpenBSD libtool isn't handling something that GNU libtool can cope with, but given the warning from GNU libtool it doesn't seem entirely legit in the first place.