Bug 248701 - devel/binutils: Fails to link: ld: error: duplicate symbol: program_name
Summary: devel/binutils: Fails to link: ld: error: duplicate symbol: program_name
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords: needs-qa
: 248735 (view as bug list)
Depends on:
Blocks: 248756
  Show dependency treegraph
 
Reported: 2020-08-17 13:22 UTC by O. Hartmann
Modified: 2020-08-20 21:01 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (bapt)
koobs: merge-quarterly?


Attachments
fix binutils build with -fno-common (2.23 KB, patch)
2020-08-18 15:12 UTC, Niclas Zeising
zeising: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2020-08-17 13:22:58 UTC
On recent CURRENT (FreeBSD 13.0-CURRENT #15 r364297: Mon Aug 17 14:39:06 CEST 2020 amd64), rebuilding of port devel/binutils fails to build with a linker error shown below:
[...]
/bin/sh ./libtool  --tag=CC   --mode=link cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow  -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -fstack-protector-strong  -o coffdump coffdump.o coffgrok.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib
libtool: link: cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -o coffdump coffdump.o coffgrok.o bucomm.o version.o filemode.o /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  ../bfd/.libs/libbfd.a -L/usr/local/lib -lz ../libiberty/libiberty.a
ld: error: duplicate symbol: program_name
>>> defined at coffdump.c
>>>            coffdump.o:(program_name)
>>> defined at bucomm.c
>>>            bucomm.o:(.bss+0x0)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[6]: *** [Makefile:891: coffdump] Error 1
Comment 1 Niclas Zeising freebsd_committer 2020-08-18 15:12:35 UTC
Created attachment 217313 [details]
fix binutils build with -fno-common

O. Hartmann, can you try this patch for binutils?  It works for me.

bapt, does this look OK to commit?
Comment 2 Niclas Zeising freebsd_committer 2020-08-18 23:31:26 UTC
*** Bug 248735 has been marked as a duplicate of this bug. ***
Comment 3 commit-hook freebsd_committer 2020-08-19 17:11:07 UTC
A commit references this bug:

Author: zeising
Date: Wed Aug 19 17:11:00 UTC 2020
New revision: 545440
URL: https://svnweb.freebsd.org/changeset/ports/545440

Log:
  devel/binutils: fix build with -fno-common

  Add a patch from upstream to fix the build of devel/binutils when compiled
  with -fno-common, which is the default with llvm 11.

  PR:		248701
  MFH:		2020Q3

Changes:
  head/devel/binutils/files/patch-0b398d6.diff
Comment 4 Niclas Zeising freebsd_committer 2020-08-19 17:12:57 UTC
Committed.

Without fixing binutils, a lot of the ports tree was failing.
Comment 5 commit-hook freebsd_committer 2020-08-20 19:23:42 UTC
A commit references this bug:

Author: zeising
Date: Thu Aug 20 19:23:31 UTC 2020
New revision: 545552
URL: https://svnweb.freebsd.org/changeset/ports/545552

Log:
  MFH: r545440

  devel/binutils: fix build with -fno-common

  Add a patch from upstream to fix the build of devel/binutils when compiled
  with -fno-common, which is the default with llvm 11.

  PR:		248701

  Approved by:	ports-secteam (joenum)

Changes:
_U  branches/2020Q3/
  branches/2020Q3/devel/binutils/files/patch-0b398d6.diff
Comment 6 Niclas Zeising freebsd_committer 2020-08-20 21:01:57 UTC
All done and merged.