ld: error: duplicate symbol:
Emmanuel Vadot
manu at bidouilliste.com
Tue Aug 18 12:19:29 UTC 2020
On Mon, 17 Aug 2020 21:49:52 +0200
Dimitry Andric <dim at FreeBSD.org> wrote:
> On 17 Aug 2020, at 15:42, O. Hartmann <ohartmann at walstatt.org> wrote:
> >
> > On CURRENT 9not necessarily most recent with LLVM11, but since noon of today it
> > is FreeBSD 13.0-CURRENT #15 r364297: Mon Aug 17 14:39:06 CEST 2020 amd64) I'm
> > faced with some very sticky and nasty micompilations in several essential
> > ports, for instance
> >
> > ports-mgmt/pkg
> > devel/libunwind
> > devel/binutils
> >
> > In most cases somewhere in the (parallel) build the process fails with the error
> >
> > ld: error: duplicate symbol: xxxxxxxx
>
> This is because clang 11 (and gcc 10) now default to -fno-common. The
> rationale is explained pretty well in
> <https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6271dd984d7f920d4fb17ad37af6a1f8e6b796dc>:
>
> "GCC currently defaults to -fcommon. As discussed in the PR, this is an ancient
> C feature which is not conforming with the latest C standards. On many targets
> this means global variable accesses have a codesize and performance penalty.
> This applies to C code only, C++ code is not affected by -fcommon. It is about
> time to change the default."
>
> A quick fix is to add CFLAGS+=-fcommon to your make.conf, but that is
> rather a big hammer. It is better to add it to just the ports that show
> problems due to duplicated symbols. And ideally, those duplicated
> symbols should be patched out of the ports.
>
> For example, ports-mgmt/pkg already has such a patch:
> https://github.com/freebsd/pkg/commit/7fbde60c4af4a1a07db7c5c36efbb2a495f7b1a4
> but I have no idea why it is not yet in the ports tree.
I was sure it was at least in pkg-devel but no, I guess I forgot to
update svn.
It's now unbroke in both pkg and pkg-devel.
> -Dimitry
>
--
Emmanuel Vadot <manu at bidouilliste.com>
More information about the freebsd-current
mailing list