Bug 221812 - mail/qmail-dk fails to link with lld due to duplicate symbols
Summary: mail/qmail-dk fails to link with lld due to duplicate symbols
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-25 17:56 UTC by Ed Maste
Modified: 2018-07-20 14:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2017-08-25 17:56:31 UTC
When attempting to link qmail-dk with lld as /usr/bin/ld the link fails with:

./load qmail-dk triggerpull.o fmtqfn.o now.o  date822fmt.o datetime.a seek.a ndelay.a open.a sig.a  substdio.a error.a fs.a auto_qmail.o  auto_split.o auto_uids.o  fd.a wait.a  /usr/local/lib/libdomainkeys.a -L/usr/lib -lcrypto env.a control.o open.a getln.a  stralloc.a alloc.a  scan_ulong.o str.a `cat dns.lib`
/usr/bin/ld: error: duplicate symbol: scan_ulong
>>> defined at scan_ulong.c
>>>            scan_ulong.o:(scan_ulong) in archive fs.a
>>> defined at scan_ulong.c
>>>            scan_ulong.o:(.text+0x0)

scan_ulong.o is added to fs.a and so appears twice in the link command line (via fs.a and listed explicitly) which resulted in a duplicate symbol error with lld.
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2018-07-20 14:17:31 UTC
Should be fixed now.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-07-20 14:18:16 UTC
A commit references this bug:

Author: tobik
Date: Fri Jul 20 14:17:26 UTC 2018
New revision: 475017
URL: https://svnweb.freebsd.org/changeset/ports/475017

Log:
  mail/qmail-dk: Fix build with lld

  /usr/bin/ld: error: duplicate symbol: scan_ulong
  >>> defined at scan_ulong.c
  >>>            scan_ulong.o:(scan_ulong) in archive fs.a
  >>> defined at scan_ulong.c
  >>>            scan_ulong.o:(.text+0x0)

  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p474767_s336359/logs/qmail-dk-0.54_1.log

  scan_ulong.o is added to fs.a and appears twice in the link command
  line (via fs.a and listed explicitly) which results in a duplicate
  symbol error with lld.  Removing scan_ulong.o from the link command
  line would result in an undefined reference error when linking
  auto-int with ld.bfd, so remove it from fs.a instead.

  Attempt to build on aarch64 again as the error message is the same.

  PR:		221812
  Reported by:	emaste, pkg-fallout

Changes:
  head/mail/qmail-dk/Makefile
  head/mail/qmail-dk/files/
  head/mail/qmail-dk/files/patch-Makefile