Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 2020 14:13:11 +0200
From:      "Hartmann, O." <o.hartmann@walstatt.org>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        "O. Hartmann" <ohartmann@walstatt.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: ld: error: duplicate symbol:
Message-ID:  <20200818141311.557eff8b@hermann.fritz.box>
In-Reply-To: <B7F9F85B-60A4-4A87-9911-BDE1CBC7BC91@FreeBSD.org>
References:  <20200817154208.42d25b89@freyja> <B7F9F85B-60A4-4A87-9911-BDE1CBC7BC91@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/V+KXbExAILuTz3WJu219sIv
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Mon, 17 Aug 2020 21:49:52 +0200
Dimitry Andric <dim@FreeBSD.org> wrote:

> On 17 Aug 2020, at 15:42, O. Hartmann <ohartmann@walstatt.org> wrote:
> >=20
> > 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
> >=20
> > ports-mgmt/pkg
> > devel/libunwind
> > devel/binutils
> >=20
> > In most cases somewhere in the (parallel) build the process fails
> > with the error
> >=20
> > ld: error: duplicate symbol: xxxxxxxx =20
>=20
> 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=3Dgcc.git;a=3Dcommitdiff;h=3D6271dd984d7f920d=
4fb17ad37af6a1f8e6b796dc>:
>=20
> "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."
>=20
> A quick fix is to add CFLAGS+=3D-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.
>=20
> For example, ports-mgmt/pkg already has such a patch:
> https://github.com/freebsd/pkg/commit/7fbde60c4af4a1a07db7c5c36efbb2a495f=
7b1a4
> but I have no idea why it is not yet in the ports tree.
>=20
> -Dimitry
>=20

Thank you for the fast response and thorough explanation.

oh

--Sig_/V+KXbExAILuTz3WJu219sIv
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXzvF1wAKCRA4N1ZZPba5
R/fvAQDdYX8jrecBjnld3L7/Tb9oeEGkkQtahR+YFLqGiq5IoQD/fgWDuzPNKaY1
OZA+Lo2D5wcs3D6WEgJbKpotXr0zYAo=
=65HO
-----END PGP SIGNATURE-----

--Sig_/V+KXbExAILuTz3WJu219sIv--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200818141311.557eff8b>