<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.freebsd.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.freebsd.org/bugzilla/"
          
          maintainer="bugmeister@FreeBSD.org"
>

    <bug>
          <bug_id>230813</bug_id>
          
          <creation_ts>2018-08-22 08:07:35 +0000</creation_ts>
          <short_desc>ftp/lftp: 4.8.4 fails to build</short_desc>
          <delta_ts>2018-08-27 11:09:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Ports &amp; Packages</product>
          <component>Individual Port(s)</component>
          <version>Latest</version>
          <rep_platform>Any</rep_platform>
          <op_sys>Any</op_sys>
          <bug_status>Closed</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>Affects Some People</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pascal Christen">pascal.christen</reporter>
          <assigned_to name="Ganael LAPLANCHE">martymac</assigned_to>
          <cc>freebsd</cc>
    
    <cc>pascal.christen</cc>
    
    <cc>sgs</cc>
    
    <cc>simon.wright</cc>
    
    <cc>spambox</cc>
    
    <cc>w.schwarzenfeld</cc>
          

      

      

      <flag name="maintainer-feedback"
          id="31809"
          type_id="3"
          status="?"
          setter="bugzilla"
          requestee="martymac"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1007788</commentid>
    <comment_count>0</comment_count>
      <attachid>196438</attachid>
    <who name="Pascal Christen">pascal.christen</who>
    <bug_when>2018-08-22 08:07:35 +0000</bug_when>
    <thetext>Created attachment 196438
lftp build output

Hi

After Update to 4.8.4,  lftp failed to build with freebsd10.4 &amp;6 11.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007979</commentid>
    <comment_count>1</comment_count>
      <attachid>196470</attachid>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-23 10:16:38 +0000</bug_when>
    <thetext>Created attachment 196470
Add missing -pthread</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007981</commentid>
    <comment_count>2</comment_count>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-23 10:17:37 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007984</commentid>
    <comment_count>3</comment_count>
    <who name="Pascal Christen">pascal.christen</who>
    <bug_when>2018-08-23 10:31:08 +0000</bug_when>
    <thetext>(In reply to Ganael LAPLANCHE from comment #2)

Hi 

No, I&apos;m building with openssl (openssl-1.0.2p) too:


---Begin OPTIONS List---
===&gt; The following configuration options are available for lftp-4.8.4:
     DOCS=on: Build and/or install documentation
     NLS=on: Native Language Support
====&gt; 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
===&gt; Use &apos;make config&apos; 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--</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007998</commentid>
    <comment_count>4</comment_count>
    <who name="Kamigishi Rei">spambox</who>
    <bug_when>2018-08-23 12:54:36 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008054</commentid>
    <comment_count>5</comment_count>
      <attachid>196485</attachid>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-23 21:24:54 +0000</bug_when>
    <thetext>Created attachment 196485
Add missing -pthread (take 2)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008056</commentid>
    <comment_count>6</comment_count>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-23 21:30:59 +0000</bug_when>
    <thetext>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 &apos;DEFAULT_VERSIONS+= ssl=openssl&apos; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008057</commentid>
    <comment_count>7</comment_count>
    <who name="Kamigishi Rei">spambox</who>
    <bug_when>2018-08-23 21:39:44 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008060</commentid>
    <comment_count>8</comment_count>
    <who name="Kamigishi Rei">spambox</who>
    <bug_when>2018-08-23 21:45:39 +0000</bug_when>
    <thetext>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&apos;s version -f shows just “clang”.

The other, likely safer, option is to check “ldd /path/to/openssl” output for libthr.so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008086</commentid>
    <comment_count>9</comment_count>
    <who name="Simeon Simeonov">sgs</who>
    <bug_when>2018-08-24 06:41:48 +0000</bug_when>
    <thetext>Note: The build fails also when DEFAULT_VERSIONS+= ssl=libressl</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008088</commentid>
    <comment_count>10</comment_count>
    <who name="Pascal Christen">pascal.christen</who>
    <bug_when>2018-08-24 07:07:44 +0000</bug_when>
    <thetext>(In reply to Ganael LAPLANCHE from comment #6)

&gt; Can you try the more generic patch attached ? It now adds the missing -pthead flag unconditionally.

This one works for me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008115</commentid>
    <comment_count>11</comment_count>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-24 10:15:29 +0000</bug_when>
    <thetext>Hi,

Thanks for your reports.

I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008276</commentid>
    <comment_count>12</comment_count>
    <who name="Peter Putzer">freebsd</who>
    <bug_when>2018-08-25 08:35:46 +0000</bug_when>
    <thetext>(In reply to Ganael LAPLANCHE from comment #6)

It also fails with libressl from ports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008279</commentid>
    <comment_count>13</comment_count>
    <who name="Walter Schwarzenfeld">w.schwarzenfeld</who>
    <bug_when>2018-08-25 09:36:16 +0000</bug_when>
    <thetext>Libressl could be solved by adding:

OPENSSL_CONFIGURE_ENV=   LIBS=-pthread</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008595</commentid>
    <comment_count>14</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2018-08-27 10:16:22 +0000</bug_when>
    <thetext>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&apos; (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 &lt;pascal.christen@hostpoint.ch&gt;

Changes:
  head/ftp/lftp/Makefile</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1008601</commentid>
    <comment_count>15</comment_count>
    <who name="Ganael LAPLANCHE">martymac</who>
    <bug_when>2018-08-27 11:09:41 +0000</bug_when>
    <thetext>Should be fixed right now. Thanks for your report!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>196438</attachid>
            <date>2018-08-22 08:07:35 +0000</date>
            <delta_ts>2018-08-22 08:07:35 +0000</delta_ts>
            <desc>lftp build output</desc>
            <filename>lftp_build.txt</filename>
            <type>text/plain</type>
            <size>1085</size>
            <attacher name="Pascal Christen">pascal.christen</attacher>
            
              <data encoding="base64">L2Jpbi9zaCAuLi9saWJ0b29sIC0tc2lsZW50ICAtLXRhZz1DWFggICAgLS1tb2RlPWxpbmsgYysr
IC1zdGQ9Z251KysxMSAgIC1PMiAtcGlwZSAtZm5vLW9taXQtZnJhbWUtcG9pbnRlciAtRExJQklD
T05WX1BMVUcgLWZzdGFjay1wcm90ZWN0b3IgLWlzeXN0ZW0gL3Vzci9sb2NhbC9pbmNsdWRlIC1m
bm8tc3RyaWN0LWFsaWFzaW5nICAtRExJQklDT05WX1BMVUcgLWlzeXN0ZW0gL3Vzci9sb2NhbC9p
bmNsdWRlIC1XYWxsIC1Xd3JpdGUtc3RyaW5ncyAtV292ZXJsb2FkZWQtdmlydHVhbCAtZm5vLWV4
Y2VwdGlvbnMgLWZuby1ydHRpIC1leHBvcnQtZHluYW1pYyAtV2wsLXJwYXRoLC91c3IvbG9jYWwv
bGliIC1mc3RhY2stcHJvdGVjdG9yIC1vIGxmdHAgbGZ0cC1sZnRwLm8gbGZ0cC1jb21wbGV0ZS5v
ICBsZnRwLWxmdHBfcmwubyBsZnRwLWF0dGFjaC5vIGxpYmxmdHAtam9icy5sYSBsaWJsZnRwLXRh
c2tzLmxhIC1ML3Vzci9saWIgLWxyZWFkbGluZSAtbHV0aWwgLWx0aW5mbyAtTC91c3IvbG9jYWwv
bGliIC1saWRuMgovdXNyL2Jpbi9sZDogdW5kZWZpbmVkIHJlZmVyZW5jZSB0byBzeW1ib2wgYHB0
aHJlYWRfbXV0ZXhhdHRyX2dldHR5cGVAQEZCU0RfMS4wJyAodHJ5IGFkZGluZyAtbHRocikKLy9s
aWIvbGlidGhyLnNvLjM6IGNvdWxkIG5vdCByZWFkIHN5bWJvbHM6IEJhZCB2YWx1ZQpjKys6IGVy
cm9yOiBsaW5rZXIgY29tbWFuZCBmYWlsZWQgd2l0aCBleGl0IGNvZGUgMSAodXNlIC12IHRvIHNl
ZSBpbnZvY2F0aW9uKQoqKiogRXJyb3IgY29kZSAxCgpTdG9wLgptYWtlWzNdOiBzdG9wcGVkIGlu
IC93cmtkaXJzL3Vzci9wb3J0cy9mdHAvbGZ0cC93b3JrL2xmdHAtNC44LjQvc3JjCioqKiBFcnJv
ciBjb2RlIDEKClN0b3AuCm1ha2VbMl06IHN0b3BwZWQgaW4gL3dya2RpcnMvdXNyL3BvcnRzL2Z0
cC9sZnRwL3dvcmsvbGZ0cC00LjguNAoqKiogRXJyb3IgY29kZSAxCgpTdG9wLgptYWtlWzFdOiBz
dG9wcGVkIGluIC93cmtkaXJzL3Vzci9wb3J0cy9mdHAvbGZ0cC93b3JrL2xmdHAtNC44LjQKKioq
IEVycm9yIGNvZGUgMQoKU3RvcC4KbWFrZTogc3RvcHBlZCBpbiAvdXNyL3BvcnRzL2Z0cC9sZnRw
Cgo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>196470</attachid>
            <date>2018-08-23 10:16:38 +0000</date>
            <delta_ts>2018-08-23 21:24:54 +0000</delta_ts>
            <desc>Add missing -pthread</desc>
            <filename>patch-lftp.txt</filename>
            <type>text/plain</type>
            <size>387</size>
            <attacher name="Ganael LAPLANCHE">martymac</attacher>
            
              <data encoding="base64">ZGlmZiAtYXVyTiBmdHAvbGZ0cC5vcmlnL01ha2VmaWxlIGZ0cC9sZnRwL01ha2VmaWxlCi0tLSBm
dHAvbGZ0cC5vcmlnL01ha2VmaWxlCTIwMTgtMDgtMjEgMTI6MjU6MzEuMDM0OTU0MDAwICswMjAw
CisrKyBmdHAvbGZ0cC9NYWtlZmlsZQkyMDE4LTA4LTIzIDEyOjEwOjIyLjI5MTAwNDAwMCArMDIw
MApAQCAtNDMsNiArNDMsNyBAQAogT1BFTlNTTF9DT05GSUdVUkVfV0lUSD0Jb3BlbnNzbAogT1BF
TlNTTF9VU0VTPQlzc2wKIEdOVVRMU19DT05GSUdVUkVfV0lUSD0JZ251dGxzCitHTlVUTFNfQ09O
RklHVVJFX0VOVj0JTElCUz0tcHRocmVhZAogR05VVExTX0xJQl9ERVBFTkRTPQlsaWJnbnV0bHMu
c286c2VjdXJpdHkvZ251dGxzCiBHTlVUTFNfVVNFUz0JcGtnY29uZmlnCiAK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>196485</attachid>
            <date>2018-08-23 21:24:54 +0000</date>
            <delta_ts>2018-08-23 21:24:54 +0000</delta_ts>
            <desc>Add missing -pthread (take 2)</desc>
            <filename>patch-lftp.txt</filename>
            <type>text/plain</type>
            <size>415</size>
            <attacher name="Ganael LAPLANCHE">martymac</attacher>
            
              <data encoding="base64">ZGlmZiAtYXVyTiBmdHAvbGZ0cC5vcmlnL01ha2VmaWxlIGZ0cC9sZnRwL01ha2VmaWxlCi0tLSBm
dHAvbGZ0cC5vcmlnL01ha2VmaWxlCTIwMTgtMDgtMjEgMTI6MjU6MzEuMDM0OTU0MDAwICswMjAw
CisrKyBmdHAvbGZ0cC9NYWtlZmlsZQkyMDE4LTA4LTIzIDIzOjEyOjU1LjA4OTI5ODAwMCArMDIw
MApAQCAtMjQsNiArMjQsNyBAQAogCiBVU0VTPQkJY2hhcnNldGZpeCBpY29udiBsaWJ0b29sIGxv
Y2FsYmFzZSByZWFkbGluZSBzaGViYW5nZml4CiBHTlVfQ09ORklHVVJFPQl5ZXMKK0xERkxBR1Mr
PQktcHRocmVhZAogCiBQT1JURE9DUz0JQVVUSE9SUyBCVUdTIENoYW5nZUxvZyBGQVEgRkVBVFVS
RVMgSU5TVEFMTCBcCiAJCU1JUlJPUlMgTkVXUyBSRUFETUUgUkVBRE1FLmRlYnVnLWxldmVscyBS
RUFETUUubW9kdWxlcyBcCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>