Bug 247480 - devel/binutils can't be built with lang/gcc?
Summary: devel/binutils can't be built with lang/gcc?
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-22 15:35 UTC by gja822
Modified: 2022-01-22 00:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gja822 2020-06-22 15:35:20 UTC
I'm not sure if this is a bug really, but rather strange that GNU binutils cannot be build with GBU compiler.
Well, I've tried gcc7, gcc8, gcc10. Only very old gcc-4.8 can conpile it without the error:

/bin/sh ./libtool  --tag=CC   --mode=link gcc10 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144  -O2 -pipe -march=bdver2  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -fno-strict-aliasing   -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10  -o coffdump coffdump.o coffgrok.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a  -L/usr/local/lib
libtool: link: gcc10 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -O2 -pipe -march=bdver2 -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc10 -o coffdump coffdump.o coffgrok.o bucomm.o version.o filemode.o  -L/usr/local/lib/gcc10 ../bfd/.libs/libbfd.a -L/usr/local/lib -lz ../libiberty/libiberty.a
/usr/local/bin/ld: bucomm.o:(.bss+0x0): multiple definition of `program_name'; coffdump.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
gmake[6]: *** [Makefile:891: coffdump] Error 1
gmake[6]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1/binutils'
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2022-01-22 00:19:53 UTC
I believe this should have been addressed by

  commit a0e752df801309c38f6ccd64a25ae064db870ed9
  Author: Yasuhiro Kimura <yasu@utahime.org>
  Date:   Thu Aug 5 09:14:21 2021 +0200

    devel/binutils: Update to 2.37

at the latest. 

The behavior you have seen probably is GCC 10 becoming stricter wrt.
variable definitions, cf.

  "GCC now defaults to -fno-common. As a result, global variable
  accesses are more efficient on various targets. In C, global
  variables with multiple tentative definitions now result in 
  linker errors. With -fcommon such definitions are silently 
  merged during linking."

from http://gcc.gnu.org/gcc-10/changes.html and the details in
https://gcc.gnu.org/gcc-10/porting_to.html .

(That does not explain why you also saw this apparently using older
versions.)


Thank you for the report, and sorry you did not get an earlier answer
from the project.

I'm resetting the assignee of this PR and copying the new maintainer
of the port.