From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42761: 28.0.50; [feature/native-comp] allow customizing command line/driver options? Date: Sat, 08 Aug 2020 18:30:08 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17318"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 42761@debbugs.gnu.org To: Andreas Fuchs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 08 20:31:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4Tcf-0004PX-Q7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 20:31:13 +0200 Original-Received: from localhost ([::1]:51952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4Tce-0001Li-SU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 14:31:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4TcV-0001LC-2K for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 14:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k4TcU-0007QZ-1J for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 14:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k4TcT-000158-S2 for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 14:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Aug 2020 18:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42761 X-GNU-PR-Package: emacs Original-Received: via spool by 42761-submit@debbugs.gnu.org id=B42761.15969114174106 (code B ref 42761); Sat, 08 Aug 2020 18:31:01 +0000 Original-Received: (at 42761) by debbugs.gnu.org; 8 Aug 2020 18:30:17 +0000 Original-Received: from localhost ([127.0.0.1]:59590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4Tbl-00014A-4P for submit@debbugs.gnu.org; Sat, 08 Aug 2020 14:30:17 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:60957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4Tbh-000140-Vq for 42761@debbugs.gnu.org; Sat, 08 Aug 2020 14:30:16 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 078IU83f011030; Sat, 8 Aug 2020 18:30:09 GMT In-Reply-To: (Andreas Fuchs's message of "Fri, 7 Aug 2020 22:51:47 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184367 Archived-At: Andreas Fuchs writes: > I'm trying out emacs with native-comp on nix (working on this branch > here: https://github.com/NixOS/nixpkgs/pull/94637), and am stumbling > over a problem that is pretty specific to nix, it seems: As nix > isolates > each package to a "store" directory, you have to set specific linker > flags so that gcc-jit can find -lgccjit and -lgcc_ext. This is > currently > done via the $LIBRARY_PATH environment variable, which works but > seems > pretty hackish to me (least of all because it isn't a thing that's > supported on the darwin cctools linker - there, you have to pass the > linker path as command-line arguments). > > I feel like it would be much better if users could specify the gcc > driver flags directly, via gcc_jit_context_add_driver_option > (https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html# > c.gcc_jit_context_add_driver_option). > > That way, instead of overriding environment variables which might get > reset in child processes' wrapper scripts, an emacs installation > could > more directly influence the compilation step. Hi Andreas, I don't think should be too difficult to expose the driver option. The downside is that gcc_jit_context_add_driver_option is not available in all libgccjits (IIRC I added it to GCC 9). Another option would be to set our self the LIBRARY_PATH before invoking the compiler only in the async process. Have you already tried using `comp-async-env-modifier-form' for this? Thanks Andrea -- akrl@sdf.org