Bug 221811 - sysutils/safecat: avoid duplicating object files already in library
Summary: sysutils/safecat: avoid duplicating object files already in library
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: Ed Maste
URL:
Keywords:
Depends on:
Blocks: 214864
  Show dependency treegraph
 
Reported: 2017-08-25 17:44 UTC by Ed Maste
Modified: 2017-11-23 22:35 UTC (History)
0 users

See Also:


Attachments
fix sysutils/safecat linking with lld (1.92 KB, patch)
2017-08-25 17:44 UTC, Ed Maste
no flags Details | Diff

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:44:13 UTC
Created attachment 185760 [details]
fix sysutils/safecat linking with lld

Previously byte_copy.o and str_len.o were added to str.a, and then
specified as objects on the safecat link command line along with str.
When linking with lld this produces duplicate symbol errors like:

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

As these symbols are provided by str.a just avoid listing the object
files as well.
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-11-20 22:24:05 UTC
A commit references this bug:

Author: emaste
Date: Mon Nov 20 22:23:37 UTC 2017
New revision: 454582
URL: https://svnweb.freebsd.org/changeset/ports/454582

Log:
  sysutils/safecat: avoid duplicating object files in library

  Previously byte_copy.o and str_len.o were added to str.a, and then
  specified as objects on the safecat link command line along with str.
  When linking with lld this produces duplicate symbol errors like:

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

  As these symbols are provided by str.a just avoid listing the object
  files as well.

  PR:		221811
  Approved by:	matthew
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/sysutils/safecat/files/patch-Makefile