GNU bug report logs - #42761
28.0.50; [feature/native-comp] allow customizing command line/driver options?

Previous Next

Package: emacs;

Reported by: Andreas Fuchs <asf <at> boinkor.net>

Date: Sat, 8 Aug 2020 14:51:01 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 42761 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Fuchs <asf <at> boinkor.net>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 42761 <at> debbugs.gnu.org
Subject: Re: bug#42761: 28.0.50; [feature/native-comp] allow customizing
 command line/driver options?
Date: Sat, 8 Aug 2020 15:13:53 -0400
[Message part 1 (text/plain, inline)]
Hi Andrea,

Thanks for the quick reply!

On Sat, Aug 8, 2020 at 2:30 PM Andrea Corallo <akrl <at> sdf.org> wrote:
>
> Andreas Fuchs <asf <at> boinkor.net> 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
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.