From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andreas Fuchs Newsgroups: gmane.emacs.bugs Subject: bug#42761: 28.0.50; [feature/native-comp] allow customizing command line/driver options? Date: Sat, 8 Aug 2020 15:13:53 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005222c505ac628612" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42761@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 08 21:56:12 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 1k4Uwt-0001Hv-MO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 21:56:11 +0200 Original-Received: from localhost ([::1]:41470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4Uws-00014K-NB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Aug 2020 15:56:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4Uwk-00013H-Lt for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 15:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k4Uwk-0007Oc-Ci for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 15:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k4Uwk-00039b-CD for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2020 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Fuchs Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Aug 2020 19:56:02 +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.159691653412075 (code B ref 42761); Sat, 08 Aug 2020 19:56:02 +0000 Original-Received: (at 42761) by debbugs.gnu.org; 8 Aug 2020 19:55:34 +0000 Original-Received: from localhost ([127.0.0.1]:59651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4UwI-00038c-2f for submit@debbugs.gnu.org; Sat, 08 Aug 2020 15:55:34 -0400 Original-Received: from mail-ed1-f45.google.com ([209.85.208.45]:36047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4UID-00028Z-SG for 42761@debbugs.gnu.org; Sat, 08 Aug 2020 15:14:10 -0400 Original-Received: by mail-ed1-f45.google.com with SMTP id ba10so3609785edb.3 for <42761@debbugs.gnu.org>; Sat, 08 Aug 2020 12:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boinkor-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=09qp25nI/CjKdeETqDIt3keGmN6p/mBsVoGou1EID+8=; b=AXAZHEfUeu+5tR2xlOL3yiOso4HpIHXM/40XEcU+Tt2XGbSzlAICgPdxrq2Yd4ieOS aiZvdOMvu3jJydxF/LE+kXoUSR3eXf+kWFUI5s9p5Na145SZLQXqOqRP8bblisMrWVT0 Q3y9DS6Bsw5Mn3TpyEiYmxO2BEANyV1+5NsCQM7ljC1y0QnzLCE+H5CLlQRDdlN2Kbjj F3VmAzLnbgQBm/EheQzPoLlCpq/uimSApHl3bMdfvp3GNUxYik8fXHuxcluMSZFbiWln TurhyUXApCcvOd9EvJNtBl4E0rW0sB2MJFakpu50+FecxhNbnu0phWhhZ0q4q7uLBoIv Pi2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=09qp25nI/CjKdeETqDIt3keGmN6p/mBsVoGou1EID+8=; b=IhsVWg3wZ3fNeaqeWgUMSZYiP9m4xNyzVoMxo2QCNyWTWOvofApMZh86btXum3rtQ7 gr2P7Cfs6wzDRGcxhI72MImJgGWJc4lvFGBF+FSgNZl3nLjrGPjZYzXx/ZJyaZVxkuCa SoejrN5E+SsQKvtfh6ejmoZsBYv5dGG6wE6UaPUXyQbNkjmHQ8p796nVjaFwUebrj+fg o8KaAbAvVuvlyqmesbnYgh3NUK14rODOOQV9cwE7yq65v8CIKgCcpghz15zJ5x0QwQQT ALYW5IDtigL5xvzowCoJ8D2IEw0GqxPen66SRZQFIBLU5/kDqARReYrg+nP0Icz5mMW3 1VUg== X-Gm-Message-State: AOAM533LEIsgLcd9JrW7EWavpgAh99Psr0dBKCLC8K1emhU9ikXQ13y+ Q9utINFKNtOqZ3Mjkt961tOkQLx/NHAZxsCuftXHLw== X-Google-Smtp-Source: ABdhPJyX7hxnkPMusBqBr+afjjWrG3+2p5B8KB8PT481kLbY0GX5Z/TvDoCBrL8antCoaVlJ3JptvIIkm2BJxqP3Uic= X-Received: by 2002:a05:6402:847:: with SMTP id b7mr14852387edz.39.1596914043846; Sat, 08 Aug 2020 12:14:03 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Sat, 08 Aug 2020 15:55:31 -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:184369 Archived-At: --0000000000005222c505ac628612 Content-Type: text/plain; charset="UTF-8" Hi Andrea, Thanks for the quick reply! On Sat, Aug 8, 2020 at 2:30 PM Andrea Corallo wrote: > > Andreas Fuchs writes: > > 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). That makes sense. Assuming that ~everyone would build the native-comp branch with a recent (>=9) gcc release, I cut a branch here that implements this (it does pass the driver options, too!): https://github.com/antifuchs/emacs/compare/allow-setting-driver-options I think this behavior could be made conditional on the presence of the correct libgccjit ABI version, by declaring the variable in C code, and then everyone on a newer gcc would be able to reap the benefits, and everyone else could still use the branch, but only with the standard linker flags as before (or passing LIBRARY_PATH if that's supported on their platform). > 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? LIBRARY_PATH does work on GNU binutils: the concern for my nixpkgs branch is for usage on Darwin, where that environment variable doesn't do anything. To get anywhere there, we have to have a way to pass command-line arguments... /-: Besides that though, I think it might be useful for folks who want to specify that other linkers should be used (like gold or lld), or passing a -specs argument... I don't know if that's supported at all yet, but adding this option would be an easy way of finding out how unsupported it is (-; Cheers, -- Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs --0000000000005222c505ac628612 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Andrea,

Thanks for the quick reply!

On S= at, Aug 8, 2020 at 2:30 PM Andrea Corallo <akrl@sdf.org> wrote:
>
> Andreas Fuchs <asf@boinkor.net> writes:
> > I fee= l 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_j= it_context_add_driver_option).
> >
> > That way, instead = of overriding environment variables which might get
> > reset in c= hild processes' wrapper scripts, an emacs installation
> > cou= ld
> > more directly influence the compilation step.
>
&g= t; Hi Andreas,
>
> I don't think should be too difficult to= expose the driver option.=C2=A0 The
> downside is that gcc_jit_conte= xt_add_driver_option is not available in
> all libgccjits (IIRC I add= ed it to GCC 9).

That makes sense. Assuming that ~everyone would bui= ld the native-comp
branch with a recent (>=3D9) gcc release, I cut a = branch here that
implements this (it does pass the driver options, too!)= :
https://github.com/antifuchs/emacs/compare/allow-setting-driv= er-options

I think this behavior could be made conditional on th= e presence of the
correct libgccjit ABI version, by declaring the variab= le in C code,
and then everyone on a newer gcc would be able to reap the= benefits,
and everyone else could still use the branch, but only with t= he
standard linker flags as before (or passing LIBRARY_PATH if that'= s
supported on their platform).

> Another option would be to s= et our self the LIBRARY_PATH before invoking
> the compiler only in t= he async process.=C2=A0 Have you already tried using
> `comp-async-en= v-modifier-form' for this?


LIBRARY_PATH does work on GNU bin= utils: the concern for my nixpkgs
branch is for usage on Darwin, where t= hat environment variable doesn't
do anything. To get anywhere there,= we have to have a way to pass
command-line arguments... /-:

Besi= des that though, I think it might be useful for folks who want to
specif= y that other linkers should be used (like gold or lld), or
passing a -sp= ecs argument... I don't know if that's supported at all
yet, but= adding this option would be an easy way of finding out how
unsupported = it is (-;

Cheers,
--
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs
--0000000000005222c505ac628612--