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: Eli Zaretskii
Subject: Re: Native compiler - passing command line options to C compiler
Date: Mon, 30 Aug 2021 18:50:39 +0300

> From: Andrea Corallo <akrl@sdf.org>
> Cc: arthur.miller@live.com, emacs-devel@gnu.org
> Date: Mon, 30 Aug 2021 14:28:18 +0000
> 
> > You cannot use a libgccjit.dll of a version for which Emacs was not
> > compiled, unless it is binary-compatible.  If Emacs was linked against
> > libgccjit.dll that didn't support
> > gcc_jit_context_add_command_line_option, then it would not work to
> > install a newer version of the DLL that does.
> 
> Okay, I thought on Windows worked differently and we could handle the
> case of a symbol not available at compile time but at runtime.

On Windows, we delay loading the libgccjit DLL until it is first
needed, but when it load it, we find the addresses of all the
functions we want to import from the library, and any function that is
not in the library will cause the initialization to fail.  See
init_gccjit_functions, and examine the definition of the LOAD_DLL_FN
macro.  So if someone has a libgccjit DLL without the
gcc_jit_context_add_command_line_option function, they will be unable
to use native-compilation.

Btw, since we already expect gcc_jit_context_add_command_line_option
to exist unconditionally on WINDOWSNT, I guess the test for
LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option is indeed not
needed on WINDOWSNT, because we implicitly assume it will always
succeed.  But I'd like to avoid tricky code if possible.



reply via email to

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