emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native compiler - passing command line options to C compiler


From: Andrea Corallo
Subject: Re: Native compiler - passing command line options to C compiler
Date: Mon, 30 Aug 2021 12:59:45 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Date: Sun, 29 Aug 2021 23:47:56 +0200
>> 
>> after the few mails the other day, I wasn't really sure if Andrea is going to
>> implement it and when. I thought it was rather a tedious manual labour and 
>> maybe
>> not so important, so I took me a liberty to implement this myself in my own, 
>> so
>> called, personal copy of Eamcs sources.
>
> Thanks.
>
>> I am not sure if I have done it correctly though, I appreciate if Andrea have
>> time to take a look; I have just mainly copied your code for backend 
>> options. It
>> seems to work for me, with a minor remark: When I pass a valid option, 
>> "native",
>> in place where it should go, I get an invalid option error. Gcc even lists 
>> it in
>> the error message as a valid option. Another option "skylake" works just 
>> fine. This seems to vary between flags. I am not sure if this is some 
>> encoding
>> error from Emacs to libgccjit, or if it is some bug in libgccjit, or is it 
>> just
>> my brain having dumps.
>
> I guess -march=native is something handled by GCC itself, and here we
> don't have it?  If you want to be sure, ask this question on the GCC
> list, or report as a bug to their Bugzilla.
>
>> +break your code. Use at own risk.
>                   ^^
> Two spaces between sentences.
>
>> +DEFUN ("comp-native-compiler-options-effective-p",
>> +       Fcomp_native_compiler_options_effective_p,
>> +       Scomp_native_compiler_options_effective_p,
>> +       0, 0, 0,
>> +       doc: /* Return t if `comp-native-compiler-options' is effective.  */)
>> +  (void)
>> +{
>> +#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option)  \
>> +  || defined (WINDOWSNT)  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>> +  if (gcc_jit_context_add_command_line_option)
>> +    return Qt;
>> +#endif
>
> The emphasized part doesn't look right: we did that elsewhere because
> the options we pass there work around bugs that happen also in
> versions that don't report libgccjit version.  But here this is not
> needed, and the version check isn't present anyway.  So the WINDOWSNT
> special handling should be removed, I think.

I think this "defined (WINDOWSNT)" should be there so that compiling on
Windows the check over "gcc_jit_context_add_command_line_option" it is
always compiled even in case the libgccjit.h provided at compile time
does not define
'LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option'.

A newer version of the shared library including the entry point might be
provided later on and will be used at runtime.

This should explain also the other mentioned points.

Regards

  Andrea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]