From owner-freebsd-current@freebsd.org Mon Aug 17 19:50:02 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BCC83BAB08 for ; Mon, 17 Aug 2020 19:50:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BVl4p0QFwz48l8; Mon, 17 Aug 2020 19:50:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id D235A22AFB; Mon, 17 Aug 2020 19:50:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::a4a4:6252:6b98:209] (unknown [IPv6:2001:470:7a58:0:a4a4:6252:6b98:209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6F2FB63940; Mon, 17 Aug 2020 21:49:59 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_1529C6A4-08C1-49E7-AD79-13FCD66B077C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: ld: error: duplicate symbol: Date: Mon, 17 Aug 2020 21:49:52 +0200 In-Reply-To: <20200817154208.42d25b89@freyja> Cc: freebsd-current To: "O. Hartmann" References: <20200817154208.42d25b89@freyja> X-Mailer: Apple Mail (2.3445.104.15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2020 19:50:02 -0000 --Apple-Mail=_1529C6A4-08C1-49E7-AD79-13FCD66B077C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 17 Aug 2020, at 15:42, O. Hartmann 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 This is because clang 11 (and gcc 10) now default to -fno-common. The rationale is explained pretty well in = : "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+=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. For example, ports-mgmt/pkg already has such a patch: = https://github.com/freebsd/pkg/commit/7fbde60c4af4a1a07db7c5c36efbb2a495f7= b1a4 but I have no idea why it is not yet in the ports tree. -Dimitry --Apple-Mail=_1529C6A4-08C1-49E7-AD79-13FCD66B077C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXzrfYAAKCRCwXqMKLiCW o088AJwKKg9W9U6t6218YUAfeAHJD9rxDgCgnRZOpfw2fx0vWI3SBSJfpD64W/Q= =GhpO -----END PGP SIGNATURE----- --Apple-Mail=_1529C6A4-08C1-49E7-AD79-13FCD66B077C--