From owner-freebsd-ports@freebsd.org Wed Sep 2 14:45:15 2020 Return-Path: Delivered-To: freebsd-ports@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 45BC43D9367 for ; Wed, 2 Sep 2020 14:45:15 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BhRYk3ctWz4pNN for ; Wed, 2 Sep 2020 14:45:13 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mips.inka.de (news@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1kDU0Y-004Inh-Ej; Wed, 02 Sep 2020 16:45:06 +0200 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.16.1/8.16.1) with ESMTP id 082EiafA002304 for ; Wed, 2 Sep 2020 16:44:36 +0200 (CEST) (envelope-from news@lorvorc.mips.inka.de) Received: (from news@localhost) by lorvorc.mips.inka.de (8.16.1/8.16.1/Submit) id 082EiaTx002303 for freebsd-ports@freebsd.org; Wed, 2 Sep 2020 16:44:36 +0200 (CEST) (envelope-from news) To: freebsd-ports@freebsd.org From: Christian Weisgerber Newsgroups: list.freebsd.ports Subject: Re: pkg-fallout: duplicate symbols? Date: Wed, 2 Sep 2020 14:44:36 -0000 (UTC) Message-ID: References: <9A44A7E3-B911-4D40-B34F-FC1A9E844D31@FreeBSD.org> User-Agent: slrn/1.0.3 (FreeBSD) X-Rspamd-Queue-Id: 4BhRYk3ctWz4pNN X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of news@mips.inka.de has no SPF policy when checking 2a04:c9c7:0:1073:217:a4ff:fe3b:e77c) smtp.mailfrom=news@mips.inka.de X-Spamd-Result: default: False [2.90 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[news]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.53)[-0.529]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_SHORT(0.62)[0.620]; NEURAL_SPAM_MEDIUM(0.61)[0.609]; DMARC_NA(0.00)[inka.de]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[naddy@mips.inka.de,news@mips.inka.de]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:202113, ipnet:2a04:c9c7::/32, country:DE]; FROM_NEQ_ENVFROM(0.00)[naddy@mips.inka.de,news@mips.inka.de]; MAILMAN_DEST(0.00)[freebsd-ports] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 14:45:15 -0000 On 2020-08-22, Dimitry Andric wrote: > It can be worked around by adding -fcommon to the compilation flags, but > in most cases it should not be too difficult to get rid of the multiply > defined symbols. Right. In C, a global is _defined_ in one object file and _declared_ when it is referenced from elsewhere. See Kernighan & Ritchie. Commons are a linker artifact that was never part of the C language, as far as I can tell. Most instances turned up by -fno-common are accidental double definitions of the same global, so you only need to turn the extra definitions into declarations. However, in some cases they were actually intended as separate variables and have been merged by accident. In those cases, they should be renamed or made local with "static". -- Christian "naddy" Weisgerber naddy@mips.inka.de