all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Andreas Fuchs <asf@boinkor.net>
Cc: 42761@debbugs.gnu.org
Subject: bug#42761: 28.0.50; [feature/native-comp] allow customizing command line/driver options?
Date: Thu, 13 Aug 2020 18:46:25 +0000	[thread overview]
Message-ID: <xjf5z9mbczi.fsf@sdf.org> (raw)
In-Reply-To: <CAOHxn7ziejh3dsLeosythkLG_L34vG0szyB7OVhavQoLasLKKA@mail.gmail.com> (Andreas Fuchs's message of "Mon, 10 Aug 2020 22:34:03 -0400")

Andreas Fuchs <asf@boinkor.net> writes:

> On Sun, Aug 9, 2020 at 3:58 AM Andrea Corallo <akrl@sdf.org> wrote:
>> From the patch:
>> > + #ifdef LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option
>> > + DEF_DLL_FN (void, gcc_jit_context_add_driver_option,
>> > +             (gcc_jit_context *ctxt, const char *optname));
>> > + #endif
>> [...]
>> > + #ifdef LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option
>> > +   LOAD_DLL_FN (library, gcc_jit_context_add_driver_option);
>> > + #endif
>>
>> The above should not be ifdef'd as they allow the function to be
> used
>> only if present in the library in use at runtime on Windows
> systems.
>>
>> Unfortunatelly we do not have such system for Linux where the
> decision
>> to include the call is done at compile time.  So unless we
> implement
>> that too also the call site has to be a little changed to handle
> this.
>>
>> Please have a look for that into in Fcomp_libgccjit_version where
> we use
>> gcc_jit_version_*.  These are the only "optional" libgccjit entry
> point
>> we used so far.
>
> Ah, I misread the #ifdef condition above those. Makes sense, I've
> adjusted
> the branch and added one more commit that should ensure we pass the
> `comp-native-driver-options' to async compilation child processes
> correctly.
>
> This patch builds on my system, builds on darwin under nix (with
> some 
> additional changes to emit "-L" library path entries), and
> asynchronously 
> compiles code, too!

Sounds great.

Some small notes:

> + static void
> + add_driver_options ()
> + {
> +   Lisp_Object options = Fsymbol_value (Qcomp_native_driver_options);
> + 
> + #ifdef LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option

I think here would be better to use something like

#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) || defined (WINDOWSNT)

plus the pragma to cleanup the warning as we do in Fcomp_libgccjit_version.

> +   while (CONSP (options))
> +     {
> +       gcc_jit_context_add_driver_option (comp.ctxt, SSDATA (XCAR (options)));
> +       options = XCDR (options);
> +     }
> + #else
> +   if (CONSP (options))
> +     {
> +       xsignal1 (Qnative_compiler_error,
> +                 build_string ("Customizing native compiler options via `comp-native-driver-options' is only available on libgccjit version 9 and above."));

We should break this line to be max 80 columns wide.

> +     }
> + #endif
> + }

[...]

With those changes looks good to me once the paperwork is completed.

Thanks!

  Andrea
  
-- 
akrl@sdf.org





  reply	other threads:[~2020-08-13 18:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08  2:51 bug#42761: 28.0.50; [feature/native-comp] allow customizing command line/driver options? Andreas Fuchs
2020-08-08 18:30 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-08 19:13   ` Andreas Fuchs
2020-08-08 19:31     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-08 20:29       ` Andreas Fuchs
2020-08-09  7:58         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-11  2:34           ` Andreas Fuchs
2020-08-13 18:46             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-08-19 14:37               ` Andreas Fuchs
2020-08-19 15:41                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-20 14:12                   ` Andreas Fuchs
2020-08-20 16:43                     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-22  4:14                       ` Andreas Fuchs
2020-08-24  8:49                         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-26 19:07                           ` Andreas Fuchs
2020-08-26 19:56                             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjf5z9mbczi.fsf@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=42761@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=asf@boinkor.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.