From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0JrkCutr7GKR1AAAbAwnHQ (envelope-from ) for ; Fri, 05 Aug 2022 03:01:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2OoOC+tr7GIk9AAA9RJhRA (envelope-from ) for ; Fri, 05 Aug 2022 03:01:31 +0200 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 B8FD21652E for ; Fri, 5 Aug 2022 03:01:30 +0200 (CEST) Received: from localhost ([::1]:37800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJliT-000820-FJ for larch@yhetil.org; Thu, 04 Aug 2022 21:01:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJli2-0007zG-KY for bug-guix@gnu.org; Thu, 04 Aug 2022 21:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJli2-0003SN-Ay for bug-guix@gnu.org; Thu, 04 Aug 2022 21:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJli2-00026k-5D for bug-guix@gnu.org; Thu, 04 Aug 2022 21:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55657: libgccjit is unusable Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 Aug 2022 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55657 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Liliana Marie Prikler Cc: John Kehayias , Tobias Geerinckx-Rice , "remco@remworks.net" , "55657@debbugs.gnu.org" <55657@debbugs.gnu.org> Received: via spool by 55657-submit@debbugs.gnu.org id=B55657.16596612168020 (code B ref 55657); Fri, 05 Aug 2022 01:01:02 +0000 Received: (at 55657) by debbugs.gnu.org; 5 Aug 2022 01:00:16 +0000 Received: from localhost ([127.0.0.1]:55359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJlhH-00025H-Tf for submit@debbugs.gnu.org; Thu, 04 Aug 2022 21:00:16 -0400 Received: from mail-vs1-f50.google.com ([209.85.217.50]:35468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJlhG-00024z-HJ for 55657@debbugs.gnu.org; Thu, 04 Aug 2022 21:00:15 -0400 Received: by mail-vs1-f50.google.com with SMTP id k129so1155313vsk.2 for <55657@debbugs.gnu.org>; Thu, 04 Aug 2022 18:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hkwUGWUsDg+0yGN8G+5tTauZepdfqNMUBjm/1QtJlCc=; b=TFqY+e4mGRH+TfYvfY+HUet2M0zSms9ZUhnWitlNlZhWWunR/EzlkBez1t3hw+TDE0 J7Eio762zepFr4SoE4Ud3VUO1PlK2yQfpHTzoBaodb88nAy41zdvuTTpZI8RoIlHb7nW le/ReFSn7guFlYbtvE7xF7m/d39m3SyZjsytTM3VHvrux7OcEmS2yIurgcvZmeWzU+4l JvOMotH7+biPSbQzawjDZA22JnWXFKvyU6KtXdVwHiyqXAnYs2fxEo7qizByTUBQELXG YISyEbZC/+ih4IceqaC9yU7eRTl5NLyV6cqCoYyuT8VHjTCOc4LueAfLjT1EpHRydZ4L xTlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hkwUGWUsDg+0yGN8G+5tTauZepdfqNMUBjm/1QtJlCc=; b=obwjMgyJklMSkJm+GAA5TQM/2lrMRpaG/l2Ci74IX8oNwp20eg3sh+woLbo8GZrepE FfMJHGJDu9jJIKtrUEN74qSA6glCGlZcKk5vgFMo/SVC7PFv+8ZUZHlhiRPd4MuHHrL0 BdNh09S4Q+cM5GUaU0eamNK5c0VM1iQxVExG/94j4z02wxg23lwUGOdxqnet1QwHWwIR +techeuxpgSKJTuIcppzsSHz2dbfVtwu/M7OJfKocqGHwsJPN4zyyrM/M5ukRBu8C3d7 entU54bmxFlY3B9S8RSlzxpOJvwXXat92HGWcBQ8cS71MB2ZBYsSI4mR73jMu4n0kkXp eRJw== X-Gm-Message-State: ACgBeo0ubkfPM819j1nhdODPvbCuGCrGlWcnOjnYRTjC4xedA1Fi9+Qw PqFKsMLNyJxIZQiOMy8UArkjiopSxLW/ogku3Ks= X-Google-Smtp-Source: AA6agR7/C1YlCjqD8He7nWs48+kUOzLoc+bwC8P2h+03qwKKyPJfFf6rVpjNr3M0pzpc26rOBv+IWcnbUcNH043fM8U= X-Received: by 2002:a67:efd6:0:b0:388:4860:9bda with SMTP id s22-20020a67efd6000000b0038848609bdamr2191275vsp.46.1659661208899; Thu, 04 Aug 2022 18:00:08 -0700 (PDT) MIME-Version: 1.0 References: <-WzfXRgBunfV6CTG4v5TA24Vk7Vty4mGqGpQdTTU2OkJpt-i1gM2iOOEDl9ODBZd1xuARNui4gnp1gZfkPtmHwlSwMmdagPc2fEXJyCWRJI=@protonmail.com> <67ca146d031c320b484979c6aa5a89b9c9b8472d.camel@gmail.com> In-Reply-To: From: Andrew Whatson Date: Fri, 5 Aug 2022 00:59:57 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659661290; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=hkwUGWUsDg+0yGN8G+5tTauZepdfqNMUBjm/1QtJlCc=; b=lqxnOiXiXnrLn6CAuf5Jmg2zbtilc0RG8ibJpNvUjAG+mBauCbjo3uxDxMXA9pcCpn9dcJ YtvaT86iGcv/eN0Qfy8HCnug2da32g+dEZCTkcpH5O2pG5UW8MEU1mH2gvOjwzT8LqBZp7 rk/nAc7bVxsU6MPDzWTTXS9ECJ8DTjoTWdlZsv3JL1GLwrGVuWxEgoFyJ2v5JhT0ptZNk7 eYNyXmXCgErt8zuwhetfaw50/p1dE8lRKY5/pCO38peXP43aHrEN3gSpBFChU9I4EvJ360 VVVFaMoPT+STX3XRDTaJVKh4JakheO5OWUakx52SxOw7ulhiKjg2DJFOBn0dWA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659661290; a=rsa-sha256; cv=none; b=h08Ookq9/wKCW0S9Bso8D9S2rA97Bx34S2Deb0HOWOMVDU4/eVywr1g1iRwhHB8ayyTkjf EZJBgo+L7i7LCIijMqubPLP+1kxm/HI9/9O0VKiHiVre6wWKaXZ66LY6kPcSqtT3XmqLAM 4cOA9VqyeDhJ+2vETh8fI9vJ9xx1wEbSnQ7x/RKLpDYorCgrVTliUNa9EUXBKhjv5HeaiX om7KJVIzS/MqOjqNXisuTxeFJ37fTxSA/IOZtDWUynIjnBkGguzuaeXr/Kgp+obcbO7X0x KiCtZeuRvRUfg7c6LDcVPu+23flCWOwmVuFdE4qeKE9cJf/HjzJrsyLJja9Z6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=TFqY+e4m; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.49 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=TFqY+e4m; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B8FD21652E X-Spam-Score: 6.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: Mv9jkT1TWILC On Thu, 4 Aug 2022 at 16:52, Liliana Marie Prikler wrote: > > > The solution used in the package-definition in my channel is to patch > > `comp.el` to directly reference the necessary gcc/glibc paths instead > > of relying on the environment. This occurs in the > > "patch-driver-options" step immediately after the "set-libgccjit- > > path" step mentioned earlier. This makes gcc-toolchain part of emacs > > closure, without requiring it to be propagated into the profile. > > > > If I understand the problem correctly, that should suffice? > > But if I read your recipe correctly, you're not resolving %host-type in > those options. Does that really suffice? Ah, yes that is a little confusing. This is a quirk of the different behaviour of the LIBRARY_PATH environment variable and the -B flag to gcc. I recommend reading about "-Bprefix" in `man gcc`, but in short it tries those paths with and without "machine/version" appended for the target machine and compiler version. We *could* hard-code those, but it isn't necessary, and it seemed like that might cause problems if someone's brave enough to attempt cross-compilation of native-comp emacs. A major benefit of patching "comp.el" directly is that it avoids leaking gcc into the user's environment. It's possible that someone is running emacs in a profile with a specific version of gcc, maybe without libgccjit support (eg. while hacking on some legacy code), so having emacs insist on a libgccjit-compatible gcc present in the environment at runtime would cause lots of problems. The other important bit is the libgccjit package. The one in guix mainline works fine, it should be possible to get a working libgccjit as-is. I updated the package definition on my channel for the following reasons: a) Support newer gcc versions While developing native-comp support for emacs, Andrea found and fixed some libgccjit bugs which made their way into subsequent releases of gcc. The native-comp library includes work-arounds for these problems, but produces faster/smaller code with a fresher libgccjit. b) Reduce compilation time The definition in guix is basically the standard gcc build, but with libgccjit also enabled. This results in an arduous double-bootstrap and building a bunch of compilers and libraries that are completely unnecessary and unused by libgccjit. I've disabled all the unnecessary stuff and depend on the main gcc package to build libgccjit, relying on the fact that it's already properly bootstrapped. It's much quicker to build, which is important if you don't have substitutes. Hope this helps, Andrew