From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4Ev8LP5a5mDv+wAAgWs5BA (envelope-from ) for ; Thu, 08 Jul 2021 03:55:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CC2iKP5a5mCLAQAAbx9fmQ (envelope-from ) for ; Thu, 08 Jul 2021 01:55:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E61562A967 for ; Thu, 8 Jul 2021 03:55:09 +0200 (CEST) Received: from localhost ([::1]:54148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1JFs-0006oy-E3 for larch@yhetil.org; Wed, 07 Jul 2021 21:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1JFm-0006oq-Ne for bug-guix@gnu.org; Wed, 07 Jul 2021 21:55:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1JFm-0006d1-GW for bug-guix@gnu.org; Wed, 07 Jul 2021 21:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1JFm-0001r9-Ei for bug-guix@gnu.org; Wed, 07 Jul 2021 21:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#39400: Go retains a reference to GCC Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Jul 2021 01:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39400 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Tobias Geerinckx-Rice , 39400@debbugs.gnu.org Received: via spool by 39400-submit@debbugs.gnu.org id=B39400.16257092787101 (code B ref 39400); Thu, 08 Jul 2021 01:55:02 +0000 Received: (at 39400) by debbugs.gnu.org; 8 Jul 2021 01:54:38 +0000 Received: from localhost ([127.0.0.1]:53879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1JFN-0001qT-ON for submit@debbugs.gnu.org; Wed, 07 Jul 2021 21:54:37 -0400 Received: from out1.migadu.com ([91.121.223.63]:33491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1JFK-0001qI-4f for 39400@debbugs.gnu.org; Wed, 07 Jul 2021 21:54:36 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1625709272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jjKvwsLIj9QbEFrwLqor2d+QAP6+swBDeuVGdYjBOP0=; b=FmT7wnIv7lMPPVN3q8+tAMvVE0q/JMjNz4vR7zuR162x3voRbwY9zCpsnk1ndaxPlxBuEJ Dc+6TB0/G6y3rjn+qIJYpA3zZbIGeONr7bXg1x5H7L46cDm6WphfIU2FvqZKSPV8WCPmpp HI256+xfdF0KCnw63sYIl4ilvlvQa5o= References: <87v9oo391q.fsf@gnu.org> <86k0m6abn2.fsf@mgsn.dev> <87k0m1okv5.fsf@gnu.org> Date: Wed, 07 Jul 2021 18:54:29 -0700 In-Reply-To: <87k0m1okv5.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Wed, 07 Jul 2021 23:49:18 +0200") Message-ID: <86bl7dk1t6.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Sarah Morgensen From: Sarah Morgensen via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625709310; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jjKvwsLIj9QbEFrwLqor2d+QAP6+swBDeuVGdYjBOP0=; b=mujDqlwUssptpm9jKSVUDI+DEvSg5yw/sKZpEbM33rJuY2OIqOgleneLYK/3DOI6KHL27C IH4Wkhd2jgMJ/F//Yl93M1qmrPOpPMPmw2u9SVpYjNBXUnhM3vXzayqYWyd09fhEYK/341 JO+kAar0E7laFNvogWOal59cxtHBxeRWk5E/lerxmL3/Zw1URnWHOaDbTaQt3iqqYERAV9 ahRXhVfJsQG7NTQcyHVGQZv8vEQCt/oUTdcsjusSWyLYyuTmdCaPWf7STqFoib9MEA5n6k 4bilKFhrsSYQ4GFleveRhddYcCd3cSfrX+DdSzsTaAZfciiuJ7L53a8PNYBxlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625709310; a=rsa-sha256; cv=none; b=dNGrHe6yKLHoeERaLTvAM6ACRS5/3tONZK70wCuexYI2q53V0mPDNgUL6Xlpsd6xHT/ijc 0Vny1OPkFAQqYDBSbz58aIYjcB6XRl5muqqHXArbWQ5PCbovBvk8sqwo5clQsDPAJTt1Q5 0Gm/MKevzQa74BewF60qCpTA5/VnVoeV0PjhgMpAfS75l2VWqCVlEPdc1yDE+pPRwp44r7 oB7NqO7lE53jf4Ul9g4uU5cgfoi7PAPcx32W5XpclQxCW+egxI/1Lu28rCHlBVP14cAuFX cx0CcN051hGTTPZxrPin9/M2ue6Ia6XQnw8l1mqMtgpB8IJZfcYNrhbjdJPm6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=FmT7wnIv; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=FmT7wnIv; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: E61562A967 X-Spam-Score: -2.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: 3+ATuHdJ5Yvv Hi, Ludovic Court=C3=A8s writes: >> Go invokes gcc when compiling with cgo, and cgo (or at least the usage >> of standard libraries which use cgo) is getting fairly common. If we do >> not provide a default gcc with Go, a plain "go build" will produce an >> error if it encounters something which uses cgo and it can't find gcc: >> >> $ go build >> # runtime/cgo >> cgo: exec gcc: exec: "gcc": executable file not found in $PATH > > Ah, I didn=E2=80=99t know about cgo (a helper for C bindings, right?). Yes, cgo allows you to compile Go programs which interface with C, as well as straight .c files. > > I think it=E2=80=99s a case where =E2=80=9Cdynamic composition=E2=80=9D (= i.e., looking for gcc > in $PATH at run time) is preferable, because there are lots of > situations where gcc is not needed at all. > > [...] > >> I have experimented with a couple ways of removing the gcc-7.5.0 referen= ce: >> >> 1. Simply set CC=3Dgcc. This works to remove gcc-7.5.0 from references, >> but we still get a gcc-7.5.0-lib runpath. We can't remove this runpath >> completely, as anything using cgo-enabled parts of the standard library >> require it, and Go does not save the library location anywhere. > > Sounds good to me. (gcc-7.5.0-lib is always in the RUNPATH of > executables, we don=E2=80=99t have to worry about this one.) I recently discovered that there is actually an issue with this particular approach. If the user uses a newer gcc-toolchain, the always-added gcc-7.5.0-lib shadows the newer libraries and newer symbols are unavailable. See . > >> 2. Make Go require external linking for anything using cgo, which would >> remove the need to patch internal linking at all. Some platforms do not >> support internally linking cgo at all, so Go should have no trouble >> handling this. It does break some tests which expect to be able to >> internally link, but I have not yet found any actual packages it breaks. > > What do you mean by =E2=80=9Cexternal linking=E2=80=9D and =E2=80=9Cinter= nal linking=E2=80=9D in this > context? (I know very little about Go.) "external linking" =3D> Go invokes gcc to link object files together "internal linking" =3D> Go does the linking itself -- Sarah