Created attachment 196438 [details] lftp build output Hi After Update to 4.8.4, lftp failed to build with freebsd10.4 &6 11.2
Created attachment 196470 [details] Add missing -pthread
Hi Pascal, Thanks for your report. I think your are trying to build lftp with GnuTLS (it builds fine with OpenSSL). Can you try the attached patch and tell me if it fixes your problem ? Best regards, Ganael.
(In reply to Ganael LAPLANCHE from comment #2) Hi No, I'm building with openssl (openssl-1.0.2p) too: ---Begin OPTIONS List--- ===> The following configuration options are available for lftp-4.8.4: DOCS=on: Build and/or install documentation NLS=on: Native Language Support ====> SSL protocol support: you can only select none or one of them OPENSSL=on: SSL/TLS support via OpenSSL GNUTLS=off: SSL/TLS support via GnuTLS ===> Use 'make config' to modify these settings ---End OPTIONS List--- --MAINTAINER-- martymac@FreeBSD.org --End MAINTAINER-- --CONFIGURE_ARGS-- --enable-nls --with-openssl --without-gnutls --prefix=/usr/local ${_LATE_CONFIGURE_ARGS} --End CONFIGURE_ARGS--
I can confirm that lftp builds with OpenSSL fail due to missing pthread. Poudriere log: https://poudriere.koumakan.jp/data/11amd64-default/2018-08-23_21h39m03s/logs/errors/lftp-4.8.4.log
Created attachment 196485 [details] Add missing -pthread (take 2)
Hi Kamigishi, Pascal, OK, you are using OpenSSL from *ports* while I was testing the build against OpenSSL from *base*. I can now reproduce the problem when using OpenSSL from ports (with 'DEFAULT_VERSIONS+= ssl=openssl' set in make.conf). Adding -pthread fixes the problem too. Can you try the more generic patch attached ? It now adds the missing -pthead flag unconditionally.
It builds fine for me with OpenSSL from ports. I wonder if there is a way to properly tell if OpenSSL was built with multi-threading enabled, since it is likely wrong to link libthr if it is not.
Seems “openssl version -f” will have -pthread for ports-built OpenSSL. The problem is that we would have to test for /usr/local/bin/openssl first, because base has PATH priority. Base OpenSSL's version -f shows just “clang”. The other, likely safer, option is to check “ldd /path/to/openssl” output for libthr.so.
Note: The build fails also when DEFAULT_VERSIONS+= ssl=libressl
(In reply to Ganael LAPLANCHE from comment #6) > Can you try the more generic patch attached ? It now adds the missing -pthead flag unconditionally. This one works for me
Hi, Thanks for your reports. I'll be working on a new version of the patch, stay tuned (ENOTIME right now, probably at the beginning of next week). Best regards, Ganael.
(In reply to Ganael LAPLANCHE from comment #6) It also fails with libressl from ports.
Libressl could be solved by adding: OPENSSL_CONFIGURE_ENV= LIBS=-pthread
A commit references this bug: Author: martymac Date: Mon Aug 27 10:16:03 UTC 2018 New revision: 478188 URL: https://svnweb.freebsd.org/changeset/ports/478188 Log: Fix build when selected SSL library is linked to libthr When a non-default SSL library is used (GnuTLS, OpenSSL or LibreSSL from ports) and if it is linked to libthr, compilation fails with the following error : /usr/bin/ld: undefined reference to symbol `pthread_mutexattr_gettype@@FBSD_1.0' (try adding -lthr) //lib/libthr.so.3: could not read symbols: Bad value As OpenSSL-like ports (OpenSSL from base, OpenSSL and OpenSSL-devel from ports, LibreSSL and LibreSSL-devel from ports) may or may not be linked to libthr, fix build by detecting if the selected library is linked to libthr or not. PR: 230813 Submitted by: Pascal Christen <pascal.christen@hostpoint.ch> Changes: head/ftp/lftp/Makefile
Should be fixed right now. Thanks for your report!