From owner-freebsd-current@freebsd.org Tue Aug 18 12:19:29 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 C9CB23BA0CC for ; Tue, 18 Aug 2020 12:19:29 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BW92R72qbz3yf6; Tue, 18 Aug 2020 12:19:27 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from amy (feu30-1-82-242-59-241.fbx.proxad.net [82.242.59.241]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 6e9005a8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 18 Aug 2020 12:19:22 +0000 (UTC) Date: Tue, 18 Aug 2020 14:19:21 +0200 From: Emmanuel Vadot To: Dimitry Andric Cc: "O. Hartmann" , freebsd-current Subject: Re: ld: error: duplicate symbol: Message-Id: <20200818141921.33fd8e03586789de0cdd913d@bidouilliste.com> In-Reply-To: References: <20200817154208.42d25b89@freyja> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BW92R72qbz3yf6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; REPLY(-4.00)[] 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: Tue, 18 Aug 2020 12:19:29 -0000 On Mon, 17 Aug 2020 21:49:52 +0200 Dimitry Andric wrote: > On 17 Aug 2020, at 15:42, O. Hartmann 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 > : > > "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