GNU bug report logs -
#42761
28.0.50; [feature/native-comp] allow customizing command line/driver options?
Previous Next
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 #26 received at 42761 <at> debbugs.gnu.org (full text, mbox):
Andreas Fuchs <asf <at> boinkor.net> writes:
> On Sun, Aug 9, 2020 at 3:58 AM Andrea Corallo <akrl <at> 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 <at> sdf.org
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.