Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 751286

Summary: mail-filter/opendkim-2.10.3-r18 fails to compile
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Michael Orlitzky <mjo>
Status: RESOLVED FIXED    
Severity: normal CC: klondike, mjo, proxy-maint, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/trusteddomainproject/OpenDKIM/issues/105
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Successful build (Gentoo VM with ld.gold)

Description Agostino Sarubbo gentoo-dev 2020-10-26 07:10:10 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: mail-filter/opendkim-2.10.3-r18 fails to compile.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This machine uses a gold linker (ld.gold).
If you think that this issue is strictly related to ld.gold please block bug 269315.
Comment 1 Agostino Sarubbo gentoo-dev 2020-10-26 07:10:12 UTC
Created attachment 668585 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-10-26 07:10:13 UTC
Possible context of error(s):

/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: error: cannot open /usr/lib/libdb.so: No such file or directory
opendkim-opendkim-db.o:opendkim-db.c:function dkimf_db_open: error: undefined reference to 'db_create'
opendkim-opendkim-db.o:opendkim-db.c:function dkimf_db_open: error: undefined reference to 'db_strerror'
opendkim-opendkim-db.o:opendkim-db.c:function dkimf_db_strerror: error: undefined reference to 'db_strerror'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: error: cannot open /usr/lib/libdb.so: No such file or directory
Comment 3 Ralph Seichter 2020-10-26 07:40:25 UTC
Looks like the linker cannot find libdb.so although USE=berkdb was specified and the ebuild contains the dependency

  berkdb? ( >=sys-libs/db-3.2:* )

On my machine (profile: amd64/17.1/no-multilib) the necessary library is provided by sys-libs/db-5.3.28-r4:

  # equery belongs /usr/lib64/libdb-5.3.so
   * Searching for /usr/lib64/libdb-5.3.so ...
  sys-libs/db-5.3.28-r4 (/usr/lib64/libdb-5.3.so)
Comment 4 Agostino Sarubbo gentoo-dev 2020-10-26 07:50:25 UTC
can you try with gold? That's the big difference here, as stated in comment 0
Comment 5 Conrad Kostecki gentoo-dev 2020-10-26 13:48:41 UTC
Isn't that a problem with the linker path?

> libtool: link: x86_64-pc-linux-gnu-gcc -pthread -O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color -pthread -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -fuse-ld=gold -o .libs/opendkim opendkim-opendkim.o opendkim-opendkim-ar.o opendkim-opendkim-arf.o opendkim-opendkim-crypto.o opendkim-opendkim-db.o opendkim-opendkim-dns.o opendkim-opendkim-lua.o opendkim-config.o opendkim-flowrate.o opendkim-reputation.o opendkim-stats.o opendkim-test.o opendkim-util.o  -L/usr/lib -L/usr/local/BerkeleyDB/lib -Wl,--as-needed ../libopendkim/.libs/libopendkim.so -lmilter -lssl -lcrypto -ldb ../libvbr/.libs/libvbr.so -lresolv -lbsd -pthread

-L/usr/lib, which will fail on 64-bit and gold, a classic :P

It should be look from where does -L/usr/lib come from. This could be also from another included lib.
Comment 6 Ralph Seichter 2020-10-27 07:34:21 UTC
Created attachment 668771 [details]
Successful build (Gentoo VM with ld.gold)
Comment 7 Ralph Seichter 2020-10-27 07:35:45 UTC
I still cannot reproduce the build error. Builds with both ld.bfd and ld.gold succeed on my test VM.
Comment 8 Michael Orlitzky gentoo-dev 2020-11-05 12:49:46 UTC
Reported upstream at $URL. Junk -L<foo> flags can get added throughout configure.ac, since the tests all assume that *something* has to be appended to the library search path, and that's generally not the case.
Comment 9 Ralph Seichter 2020-11-07 12:00:49 UTC
Thank you, Michael. Based on your work, I suggest to close this issue as RESOLVED/UPSTREAM.
Comment 10 Michael Orlitzky gentoo-dev 2020-11-11 14:07:01 UTC
I'll eventually add the patch to our pile of existing patches in Gentoo, if for no other reason than to convince upstream (and myself) that it works. I've just been reluctant to rock the boat lately because my time to fix things is limited if I break them.
Comment 11 Ralph Seichter 2020-11-11 14:27:22 UTC
I understand. I hope you won't mind me assigning this issue to you, then.
Comment 12 Larry the Git Cow gentoo-dev 2020-12-09 15:05:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e5aca07ddfbd0e6578698a24390b006897e941a

commit 8e5aca07ddfbd0e6578698a24390b006897e941a
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2020-12-09 13:37:45 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2020-12-09 15:01:46 +0000

    mail-filter/opendkim: new revision to fix lib/lib64 mixup.
    
    Includes a patch that I've sent upstream to prevent ./configure from
    "detecting" /usr/lib as the correct library path when -lfoo works
    regardless of whether or not you're looking in /usr/lib.
    
    Closes: https://bugs.gentoo.org/751286
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 .../opendkim-2.10.3-fix-libmilter-search.patch     | 223 +++++++++++++++++++++
 ....10.3-r18.ebuild => opendkim-2.10.3-r19.ebuild} |   2 +
 2 files changed, 225 insertions(+)