Bug 211025 - mail/dovecot2-pigeonhole requires addition to LDFLAGS on amd64 to build
Summary: mail/dovecot2-pigeonhole requires addition to LDFLAGS on amd64 to build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-12 04:39 UTC by dewayne
Modified: 2016-07-15 14:33 UTC (History)
3 users (show)

See Also:


Attachments
add GSSAPI options (1.11 KB, patch)
2016-07-13 15:57 UTC, Larry Rosenman
ler: maintainer-approval+
Details | Diff
Add gssapi LDFLAGS (855 bytes, patch)
2016-07-13 19:01 UTC, Adam Weinberger
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2016-07-12 04:39:27 UTC
There appears to be missing the location for the libkrb5 librarires, which is surprising as Mk/Uses/gssapi.mk seems to have what's required.  For the other ports that require libkrb5 do build successfully.

What was done:
cd /usr/ports/mail/dovecot2-pigeonhole && make -DBATCH clean package
...
libtool: link: /usr/local/libexec/ccache/cc -shared  -fPIC -DPIC  .libs/sieve-settings.o .libs/sieve-message.o .libs/sieve-smtp.o .libs/sieve-lexer.o .libs/sieve-script.o .libs/sieve-storage.o .libs/sieve-storage-sync.o .libs/sieve-ast.o .libs/sieve-binary.o .libs/sieve-binary-file.o .libs/sieve-binary-code.o .libs/sieve-binary-debug.o .libs/sieve-parser.o .libs/sieve-address.o .libs/sieve-validator.o .libs/sieve-generator.o .libs/sieve-interpreter.o .libs/sieve-runtime-trace.o .libs/sieve-code-dumper.o .libs/sieve-binary-dumper.o .libs/sieve-result.o .libs/sieve-error.o .libs/sieve-objects.o .libs/sieve-stringlist.o .libs/sieve-comparators.o .libs/sieve-match-types.o .libs/sieve-address-parts.o .libs/sieve-address-source.o .libs/sieve-match.o .libs/sieve-commands.o .libs/sieve-code.o .libs/sieve-actions.o .libs/sieve-extensions.o .libs/sieve-plugins.o .libs/cmp-i-octet.o .libs/cmp-i-ascii-casemap.o .libs/mcht-is.o .libs/mcht-contains.o .libs/mcht-matches.o .libs/tst-truefalse.o .libs/tst-not.o .libs/tst-anyof.o .libs/tst-allof.o .libs/tst-address.o .libs/tst-header.o .libs/tst-exists.o .libs/tst-size.o .libs/cmd-require.o .libs/cmd-stop.o .libs/cmd-if.o .libs/cmd-keep.o .libs/cmd-redirect.o .libs/cmd-discard.o .libs/ext-fileinto.o .libs/ext-reject.o .libs/ext-envelope.o .libs/ext-encoded-character.o .libs/sieve.o  -Wl,--whole-archive ../../src/lib-sieve/storage/file/.libs/libsieve_storage_file.a ../../src/lib-sieve/storage/dict/.libs/libsieve_storage_dict.a ../../src/lib-sieve/storage/ldap/.libs/libsieve_storage_ldap.a ../../src/lib-sieve/plugins/vacation/.libs/libsieve_ext_vacation.a ../../src/lib-sieve/plugins/subaddress/.libs/libsieve_ext_subaddress.a ../../src/lib-sieve/plugins/comparator-i-ascii-numeric/.libs/libsieve_ext_comparator-i-ascii-numeric.a ../../src/lib-sieve/plugins/relational/.libs/libsieve_ext_relational.a ../../src/lib-sieve/plugins/regex/.libs/libsieve_ext_regex.a ../../src/lib-sieve/plugins/copy/.libs/libsieve_ext_copy.a ../../src/lib-sieve/plugins/imap4flags/.libs/libsieve_ext_imap4flags.a ../../src/lib-sieve/plugins/include/.libs/libsieve_ext_include.a ../../src/lib-sieve/plugins/body/.libs/libsieve_ext_body.a ../../src/lib-sieve/plugins/variables/.libs/libsieve_ext_variables.a ../../src/lib-sieve/plugins/enotify/.libs/libsieve_ext_enotify.a ../../src/lib-sieve/plugins/notify/.libs/libsieve_ext_notify.a ../../src/lib-sieve/plugins/environment/.libs/libsieve_ext_environment.a ../../src/lib-sieve/plugins/mailbox/.libs/libsieve_ext_mailbox.a ../../src/lib-sieve/plugins/date/.libs/libsieve_ext_date.a ../../src/lib-sieve/plugins/spamvirustest/.libs/libsieve_ext_spamvirustest.a ../../src/lib-sieve/plugins/ihave/.libs/libsieve_ext_ihave.a ../../src/lib-sieve/plugins/editheader/.libs/libsieve_ext_editheader.a ../../src/lib-sieve/plugins/duplicate/.libs/libsieve_ext_duplicate.a ../../src/lib-sieve/plugins/index/.libs/libsieve_ext_index.a ../../src/lib-sieve/plugins/metadata/.libs/libsieve_ext_metadata.a ../../src/lib-sieve/plugins/mime/.libs/libsieve_ext_mime.a ../../src/lib-sieve/plugins/vnd.dovecot/debug/.libs/libsieve_ext_debug.a ../../src/lib-sieve/plugins/vnd.dovecot/environment/.libs/libsieve_ext_vnd_environment.a ../../src/lib-sieve/plugins/vnd.dovecot/report/.libs/libsieve_ext_vnd_report.a ../../src/lib-sieve/util/.libs/libsieve_util.a -Wl,--no-whole-archive  -L/usr/local/lib -ldovecot-lda -ldovecot-storage -L/usr/local/lib/dovecot -ldovecot -lkrb5 -lgssapi  -O2 -g0 -ggdb0 -march=core-avx-i -mtune=core-avx-i -Wl,-rpath -Wl,/usr/local/lib   -Wl,-soname -Wl,libdovecot-sieve.so.0 -o .libs/libdovecot-sieve.so.0.0.0
/usr/bin/ld: cannot find -lkrb5
cc: error: linker command failed with exit code 1 (use -v to see invocation)

adding to LDCONFIG to the Makefile, enabled the successful build.
-LDFLAGS+=      -L${LOCALBASE}/lib
+LDFLAGS+=      -L${LOCALBASE}/lib -L${LOCALBASE}/lib/heimdal
Comment 1 Larry Rosenman freebsd_committer freebsd_triage 2016-07-12 18:40:36 UTC
I'll look -- I assume this is with the new LDAP option set?
Comment 2 Larry Rosenman freebsd_committer freebsd_triage 2016-07-12 20:54:07 UTC
What version of dovecot2-pigeonhole? ( I assume 0.4.15).

What option(s) are set?

What other LDAP ports do you have installed?
Comment 3 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 00:33:44 UTC
I really need more info.  With just openldap installed, it installs just fine without these mods.
Comment 4 dewayne 2016-07-13 00:50:24 UTC
(In reply to Larry Rosenman from comment #3)
Larry,
I don't quite understand why you're looking at ldap.  The issue is with kerberos, specifically heimdal.  I needed to provide direction to the linker to seek libkrb5 which is under /usr/local/lib/heimdal.  

I have many other ports that link to heimdal (including samba, sasl, squid, ..) so the makefile /usr/ports/Mk/Uses/gssapi.mk appears to be doing its job.  Its VERY strange that I need to add that additional linker flag for dovecot2-pigeonhole.  

I haven't modified any options pertaining to dovecot or friends for many months. This is for dovecot2
# cd /usr/ports/mail/dovecot2 && make showconfig|grep =on
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
     KQUEUE=on: kqueue(2) support
     LZ4=on: LZ4 compression support
     SSL=on: SSL protocol support
     LDAP=on: LDAP protocol support
     GSSAPI_HEIMDAL=on: Use Heimdal GSSAPI from security/heimdal
I hope that helps.
PS I'm in GMT+10hrs
Comment 5 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 00:52:02 UTC
AFAIK pigeonhole has NO dependencies on Heimdal AT ALL. 

Exactly what are you trying to do? 

I can install pigeonhole without issue on my boxes.   The reason I bring up ldap is that was added recently.
Comment 6 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 00:54:37 UTC
Ah, so you have GSSAPU turned on IN DOVECOT, and I need a way to see that flag in mail/dovecot2-pigeonhole to pick up the libraries. 

Adam,
    Any ideas here?

Thanks!
Comment 7 Adam Weinberger freebsd_committer freebsd_triage 2016-07-13 01:02:44 UTC
You can try looking in /usr/local/lib/dovecot/dovecot-config.

My personal installation doesn't use kerberos and I'm not near a dev box right now. dewayne, do you have -lkrb5 in that file? If so, which line contains it?
Comment 8 dewayne 2016-07-13 01:09:51 UTC
(In reply to Adam Weinberger from comment #7)
hi Adam, yes. I've pasted the dovecot-config from an overnight build, where I have included the additional LDFLAGS directive.  Both krb5 and gssapi appear on line 3. 

# cat /usr/local/lib/dovecot/dovecot-config
DOVECOT_INSTALLED=yes
DOVECOT_CFLAGS="-std=gnu99 -I/usr/local/include/heimdal -O2 -pipe -DOPENSSL_NO_S                SL2 -DOPENSSL_NO_SSL3 -g0 -ggdb0 -DSTRIP_FBSDID -UDEBUGGING -UEBUGGING -UDEBUG -                march=prescott -mtune=prescott  -DLIBICONV_PLUG -DLDAP_DEPRECATED -fno-strict-al                iasing -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wch                ar-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstr                ict-aliasing=2 -I/usr/local/include   "
DOVECOT_LIBS="-lkrb5 -lgssapi "
DOVECOT_SSL_LIBS="-L/usr/local/lib -lssl -lcrypto  "
DOVECOT_SQL_LIBS="   "
DOVECOT_COMPRESS_LIBS=" -lz -lbz2 -llzma -llz4"

LIBDOVECOT='-L/usr/local/lib/dovecot -ldovecot'
LIBDOVECOT_LOGIN='-ldovecot-login -L/usr/local/lib -lssl -lcrypto'
LIBDOVECOT_SQL=-ldovecot-sql
LIBDOVECOT_COMPRESS=-ldovecot-compression
LIBDOVECOT_LDA=-ldovecot-lda
LIBDOVECOT_STORAGE='-ldovecot-storage '
LIBDOVECOT_DSYNC=-ldovecot-dsync
LIBDOVECOT_LIBFTS=-ldovecot-fts


LIBDOVECOT_INCLUDE=-I/usr/local/include/dovecot

dovecot_pkgincludedir=/usr/local/include/dovecot
dovecot_pkglibdir=/usr/local/lib/dovecot
dovecot_pkglibexecdir=/usr/local/libexec/dovecot
dovecot_docdir=/usr/local/share/doc/dovecot
dovecot_moduledir=/usr/local/lib/dovecot
Comment 9 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 01:12:04 UTC
Ok, I'm looking at enhancing the pigeonhole port to pick up uses=gssapi if it shows up in the dovecot-config.
Comment 10 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 15:57:16 UTC
Created attachment 172466 [details]
add GSSAPI options
Comment 11 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 15:58:36 UTC
Can the submitter try the attached patch?  

Adam, 
  I've done a test build with heimdal and it seems(!) to solve the issue.
Comment 12 Adam Weinberger freebsd_committer freebsd_triage 2016-07-13 19:01:45 UTC
Created attachment 172477 [details]
Add gssapi LDFLAGS

Try this. It's a dumb patch that just adds the path to libkrb5.so to the stored DOVECOT_LIBS.

dewayne, on your system, does anything installed by dovecot2-pigeonhole link directly to libkrb5?
Comment 13 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 19:04:00 UTC
Comment on attachment 172477 [details]
Add gssapi LDFLAGS

I'd rather use my patch
Comment 14 Adam Weinberger freebsd_committer freebsd_triage 2016-07-13 19:23:43 UTC
I know. Your patch *is* cleaner. My concern is that the actual problem is coming from dovecot.
Comment 15 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 19:25:29 UTC
Ah, ok.
Comment 16 Adam Weinberger freebsd_committer freebsd_triage 2016-07-13 19:28:34 UTC
Also, antispam-plugin builds fine without patching dovecot2. What are they doing differently?
Comment 17 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 19:31:46 UTC
(In reply to Adam Weinberger from comment #16)
My suspicion is it uses less of the dovecot libraries. 
vs pigeonhole which hooks more places.
Comment 18 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 19:50:02 UTC
I also misunderstood that your patch was to mail/dovecot2 vs mail/dovecot2-pigeonhole.
Comment 19 Adam Weinberger freebsd_committer freebsd_triage 2016-07-13 19:51:07 UTC
I can't reproduce this build failure against the unmodified pigeonhole already in the the ports tree.

I enabled the GSSAPI_HEIMDAL option in dovecot2, and no matter what I set LDAP to in either port, I can't get pigeonhole build to fail.

What version of FreeBSD are you running? Is your ports tree completely up-to-date?
Comment 20 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 19:52:11 UTC
I think LDAP is a red herring. FWIW
Comment 21 Larry Rosenman freebsd_committer freebsd_triage 2016-07-13 20:16:20 UTC
I also can *NOT* reproduce a build failure with GSSAPI_HEIMDAL set for dovecot2. 

SO, what EXACTLY is your FreeBSD release? Ports Tree Version? 
/etc/make.conf?
Comment 22 dewayne 2016-07-15 00:56:05 UTC
(In reply to Larry Rosenman from comment #21)
Larry,
This is what we're using:
FreeBSD b1.hs 10.3-STABLE FreeBSD 10.3-STABLE #0 r302710M: Thu Jul 14 00:20:08 AEST 2016 root@hathor:/100301/D/K8/custom  i386

/usr/src
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 302710
Node Kind: directory
Schedule: normal
Last Changed Author: ngie
Last Changed Rev: 302705
Last Changed Date: 2016-07-13 16:09:34 +1000 (Wed, 13 Jul 2016)
(The develop/build platforms are automatically rebuilt and installed weekly)

/usr/ports
Relative URL: ^/head
Repository Root: https://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 418411
Node Kind: directory
Schedule: normal
Last Changed Author: novel
Last Changed Rev: 418411
Last Changed Date: 2016-07-12 10:48:07 +1000 (Tue, 12 Jul 2016)

I suspect that you're able to build because you aren't (really) using the heimdal port.  By this I mean that we actually delete heimdal base from our build systems to ensure that the linking phase is consistent.  Why? Because at some point in time the  heimdal port will be updated and become out of sync with the heimdal base, and hence there may become inconsistencies.  Best way to check is to look at ldd of the produced files.  (We chose this course when the base was using heimdal 0.6.? and the port was 1.0.0.  We've retained this practice since).

For reference on the i386 build system:
# ldd usr/local/bin/sieve-filter
usr/local/bin/sieve-filter:
        libdovecot-sieve.so.0 => /usr/local/lib/dovecot-2.2-pigeonhole/libdovecot-sieve.so.0 (0x28072000)
        libdovecot-storage.so.0 => /usr/local/lib/dovecot/libdovecot-storage.so.0 (0x28102000)
        libdovecot-lda.so.0 => /usr/local/lib/dovecot/libdovecot-lda.so.0 (0x2820c000)
        libdovecot.so.0 => /usr/local/lib/dovecot/libdovecot.so.0 (0x28218000)
        libkrb5.so.26 => /usr/local/lib/heimdal/libkrb5.so.26 (0x28307000)
        libgssapi.so.3 => /usr/local/lib/heimdal/libgssapi.so.3 (0x28371000)
        libc.so.7 => /lib/libc.so.7 (0x283a3000)
        libasn1.so.8 => /usr/local/lib/heimdal/libasn1.so.8 (0x2851f000)
        libheimbase.so.1 => /usr/local/lib/heimdal/libheimbase.so.1 (0x285b3000)
        libwind.so.0 => /usr/local/lib/heimdal/libwind.so.0 (0x285b7000)
        libhx509.so.5 => /usr/local/lib/heimdal/libhx509.so.5 (0x285df000)
        libcom_err.so.1 => /usr/local/lib/heimdal/libcom_err.so.1 (0x2861e000)
        libroken.so.18 => /usr/local/lib/heimdal/libroken.so.18 (0x28621000)
        libcrypto.so.8 => /usr/local/lib/libcrypto.so.8 (0x28630000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x287c1000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x287ca000)
        libthr.so.3 => /lib/libthr.so.3 (0x287ee000)
        libheimntlm.so.0 => /usr/local/lib/heimdal/libheimntlm.so.0 (0x2880f000)

Please note: 
libkrb5.so.26 => /usr/local/lib/heimdal/libkrb5.so.26 (0x28307000)

The only difference between the i386 and amd64 is that we use openssl on i386 (for padlock engine) and libressl on amd64.
Comment 23 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 00:59:18 UTC
(In reply to dewayne from comment #22)
try my patch please.
Comment 24 dewayne 2016-07-15 01:30:18 UTC
(In reply to Larry Rosenman from comment #23)
Patch applied.  Modified options to enable heimdal: 
cd /usr/ports/mail/dovecot2-pigeonhole && make showconfig
===> The following configuration options are available for dovecot-pigeonhole-0.4.15_1:
     DOCS=on: Build and/or install documentation
     LDAP=off: LDAP protocol support
     MANAGESIEVE=on: ManageSieve support
====> GSSAPI Support (must match mail/dovecot2): you have to select exactly one of them
     GSSAPI_NONE=off: Build without GSSAPI support
     GSSAPI_BASE=off: Use GSSAPI from base
     GSSAPI_HEIMDAL=on: Use Heimdal GSSAPI from security/heimdal
     GSSAPI_MIT=off: Use MIT GSSAPI from security/krb5

Unfortunately libkrb5 isn't found. The library locations are correctly stated in the libtool command (below) however I suspect the ordering is incorrect? The brute-force method that I used (see LDFLAGS) forced the inclusion of -L /usr/local/lib/heimdal in the right sequence (but that seems wrong).


libtool: link: /usr/local/libexec/ccache/cc -shared  -fPIC -DPIC  .libs/sieve-settings.o .libs/sieve-message.o .libs/sieve-smtp.o .libs/sieve-lexer.o .libs/sieve-script.o .libs/sieve-storage.o .libs/sieve-storage-sync.o .libs/sieve-ast.o .libs/sieve-binary.o .libs/sieve-binary-file.o .libs/sieve-binary-code.o .libs/sieve-binary-debug.o .libs/sieve-parser.o .libs/sieve-address.o .libs/sieve-validator.o .libs/sieve-generator.o .libs/sieve-interpreter.o .libs/sieve-runtime-trace.o .libs/sieve-code-dumper.o .libs/sieve-binary-dumper.o .libs/sieve-result.o .libs/sieve-error.o .libs/sieve-objects.o .libs/sieve-stringlist.o .libs/sieve-comparators.o .libs/sieve-match-types.o .libs/sieve-address-parts.o .libs/sieve-address-source.o .libs/sieve-match.o .libs/sieve-commands.o .libs/sieve-code.o .libs/sieve-actions.o .libs/sieve-extensions.o .libs/sieve-plugins.o .libs/cmp-i-octet.o .libs/cmp-i-ascii-casemap.o .libs/mcht-is.o .libs/mcht-contains.o .libs/mcht-matches.o .libs/tst-truefalse.o .libs/tst-not.o .libs/tst-anyof.o .libs/tst-allof.o .libs/tst-address.o .libs/tst-header.o .libs/tst-exists.o .libs/tst-size.o .libs/cmd-require.o .libs/cmd-stop.o .libs/cmd-if.o .libs/cmd-keep.o .libs/cmd-redirect.o .libs/cmd-discard.o .libs/ext-fileinto.o .libs/ext-reject.o .libs/ext-envelope.o .libs/ext-encoded-character.o .libs/sieve.o  -Wl,--whole-archive ../../src/lib-sieve/storage/file/.libs/libsieve_storage_file.a ../../src/lib-sieve/storage/dict/.libs/libsieve_storage_dict.a ../../src/lib-sieve/storage/ldap/.libs/libsieve_storage_ldap.a ../../src/lib-sieve/plugins/vacation/.libs/libsieve_ext_vacation.a ../../src/lib-sieve/plugins/subaddress/.libs/libsieve_ext_subaddress.a ../../src/lib-sieve/plugins/comparator-i-ascii-numeric/.libs/libsieve_ext_comparator-i-ascii-numeric.a ../../src/lib-sieve/plugins/relational/.libs/libsieve_ext_relational.a ../../src/lib-sieve/plugins/regex/.libs/libsieve_ext_regex.a ../../src/lib-sieve/plugins/copy/.libs/libsieve_ext_copy.a ../../src/lib-sieve/plugins/imap4flags/.libs/libsieve_ext_imap4flags.a ../../src/lib-sieve/plugins/include/.libs/libsieve_ext_include.a ../../src/lib-sieve/plugins/body/.libs/libsieve_ext_body.a ../../src/lib-sieve/plugins/variables/.libs/libsieve_ext_variables.a ../../src/lib-sieve/plugins/enotify/.libs/libsieve_ext_enotify.a ../../src/lib-sieve/plugins/notify/.libs/libsieve_ext_notify.a ../../src/lib-sieve/plugins/environment/.libs/libsieve_ext_environment.a ../../src/lib-sieve/plugins/mailbox/.libs/libsieve_ext_mailbox.a ../../src/lib-sieve/plugins/date/.libs/libsieve_ext_date.a ../../src/lib-sieve/plugins/spamvirustest/.libs/libsieve_ext_spamvirustest.a ../../src/lib-sieve/plugins/ihave/.libs/libsieve_ext_ihave.a ../../src/lib-sieve/plugins/editheader/.libs/libsieve_ext_editheader.a ../../src/lib-sieve/plugins/duplicate/.libs/libsieve_ext_duplicate.a ../../src/lib-sieve/plugins/index/.libs/libsieve_ext_index.a ../../src/lib-sieve/plugins/metadata/.libs/libsieve_ext_metadata.a ../../src/lib-sieve/plugins/mime/.libs/libsieve_ext_mime.a ../../src/lib-sieve/plugins/vnd.dovecot/debug/.libs/libsieve_ext_debug.a ../../src/lib-sieve/plugins/vnd.dovecot/environment/.libs/libsieve_ext_vnd_environment.a ../../src/lib-sieve/plugins/vnd.dovecot/report/.libs/libsieve_ext_vnd_report.a ../../src/lib-sieve/util/.libs/libsieve_util.a -Wl,--no-whole-archive  -L/usr/local/lib -ldovecot-lda -ldovecot-storage -L/usr/local/lib/dovecot -ldovecot -lkrb5 -lgssapi  -O2 -g0 -ggdb0 -march=prescott -mtune=prescott -Wl,-rpath -Wl,/usr/local/lib/heimdal:/usr/local/lib   -Wl,-soname -Wl,libdovecot-sieve.so.0 -o .libs/libdovecot-sieve.so.0.0.0
/usr/bin/ld: cannot find -lkrb5

Maybe relevant?
# clang -v ; echo "--------";pkg info -x binutils
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: i386-unknown-freebsd10.3
Thread model: posix
Selected GCC installation:
--------
binutils-2.25.1_3,1
Comment 25 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 01:33:51 UTC
(In reply to dewayne from comment #24)
Hrm.  Can you also try Adam's patch for mail/dovecot2?
Comment 26 Adam Weinberger freebsd_committer freebsd_triage 2016-07-15 01:50:38 UTC
(In reply to Larry Rosenman from comment #25)

Might also try adding this to Larry's patch:

GSSAPI_NONE_CONFIGURE_OFF= ${GSSAPI_CONFIGURE_ARGS}
Comment 27 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 02:07:17 UTC
(In reply to Adam Weinberger from comment #26)
there is no gssapi configure option(s) for pigeonhole :(
Comment 28 Adam Weinberger freebsd_committer freebsd_triage 2016-07-15 02:10:52 UTC
(In reply to Larry Rosenman from comment #27)

Should be. It gets defined by Mk/Uses/gssapi.mk.
Comment 29 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 02:16:09 UTC
(In reply to Adam Weinberger from comment #28)
I'm talking pigeonhols's configure script.  The args may be generated by uses=gssapi, but...
Comment 30 Adam Weinberger freebsd_committer freebsd_triage 2016-07-15 02:18:31 UTC
(In reply to Larry Rosenman from comment #29)

GSSAPI_CONFIGURE_ARGS sets CFLAGS, LDFLAGS, LIBS, and KRB5CONFIG as needed for gssapi.
Comment 31 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 02:28:20 UTC
(In reply to Adam Weinberger from comment #30)
Ah. SO I get schooled again.
Comment 32 dewayne 2016-07-15 03:32:17 UTC
(In reply to Adam Weinberger from comment #30)
Apologies.  I'd assumed that a 
cd /usr/ports/mail/dovecot2-pigeonhole &&  make clean deinstall package ; 
would rebuild dovecot2.  

When I
cd /usr/ports/mail/dovecot2-pigeonhole && make clean deinstall
cd /usr/ports/mail/dovecot2 && make -DBATCH clean deinstall package
cd /usr/ports/mail/dovecot2-pigeonhole && make -DBATCH package

The package build was successfull. I then ran the above three lines in the amd64 build environment which was also clean.  Patches for dovecot2 and dovecot2-pigeonhold were applied and my earlier LDFLAGS was removed.

Thank-you for your efforts and providing a successful outcome.
Comment 33 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 13:41:29 UTC
The final upshot is BOTH patches?  Did my patch need any additions?
Comment 34 Adam Weinberger freebsd_committer freebsd_triage 2016-07-15 14:18:14 UTC
(In reply to Larry Rosenman from comment #33)

Okay. I've replicated his failure by waiting for the build to start, and then from another terminal, rm /poudriere/data/.m/10amd64-default/ref/usr/{lib,lib32}/libkrb5*

I can confirm that your patch, Larry, plus the GSSAPI_CONFIGURE_ARGS, fixes it.

Larry, do you want me to commit that? Also, I'd suggest setting BUILD_FAIL_MESSAGE to "Ensure that ${PORTNAME}'s GSSAPI backend is the same as dovecot2 (make config)" or something like that. That message gets printed out if the build fails.

dewayne: I highly recommend that your company look into ports-mgmt/poudriere. It builds things in a clean environment, knows when to rebuild dependencies, produces packages that you can deploy, and takes all the guess-work out. You would not have hit this problem if you were using poudriere.
Comment 35 Larry Rosenman freebsd_committer freebsd_triage 2016-07-15 14:21:08 UTC
(In reply to Adam Weinberger from comment #34)
Please do, with whatever changes you recommend.
Comment 36 commit-hook freebsd_committer freebsd_triage 2016-07-15 14:31:53 UTC
A commit references this bug:

Author: adamw
Date: Fri Jul 15 14:31:18 UTC 2016
New revision: 418580
URL: https://svnweb.freebsd.org/changeset/ports/418580

Log:
  If base was built WITHOUT_KERBEROS and dovecot2 was built with kerberos
  from ports, pigeonhole's build will fail because it can't find libkrb5.so.

  To fix this, introduce the usual GSSAPI option block. Also, add a
  BUILD_FAIL_MESSAGE asking you to make sure that the GSSAPI option here
  matches the GSSAPI option from dovecot2.

  PR:		211025
  Submitted by:	dewayne heuristicsystems com au
  Patch by:	maintainer (Larry Rosenman)

Changes:
  head/mail/dovecot2-pigeonhole/Makefile