Previous: , Up: Compilation of Lisp to Native Code   [Contents][Index]

18.2 Native-Compilation Variables

This section documents the variables that control native-compilation.

User Option: native-comp-speed

This variable specifies the optimization level for native compilation. Its value should be a number between -1 and 3. Values between 0 and 3 specify the optimization levels equivalent to the corresponding compiler -O0, -O1, etc. command-line options of the compiler. The value -1 means disable native-compilation; functions and files will be only byte-compiled. The default value is 2.

User Option: native-comp-debug

This variable specifies the level of debugging information produced by native-compilation. Its value should be a number between zero and 3, with the following meaning:


No debugging output. This is the default.


Emit debugging symbols with the native code. This allows easier debugging of the native code with debuggers such as gdb.


Like 1, and in addition dump pseudo-C code.


Like 2, and in addition dump the GCC intermediate passes and libgccjit log file.

User Option: native-comp-verbose

This variable controls the verbosity of native-compilation by suppressing some or all of the log messages emitted by it. If its value is zero, the default, all of the log messages are suppressed. Setting it to a value between 1 and 3 will allow logging of the messages whose level is above the value. The values have the following interpretations:


No logging. This is the default.


Log the final LIMPLE representation of the code.


Log the LAP, the final LIMPLE, and some additional pass info.


Maximum verbosity: log everything.

User Option: native-comp-async-jobs-number

This variable determines the maximum number of native-compilation subprocesses that will be started simultaneously. It should be a non-negative number. The default value is zero, which means use half the number of the CPU execution units, or 1 if the CPU has only one execution unit.

User Option: native-comp-async-report-warnings-errors

If this variable’s value is non-nil, warnings and errors from asynchronous native-compilation subprocesses are reported in the main Emacs session in a buffer named *Warnings*. The default value t means display the resulting buffer. To log warnings without popping up the *Warnings* buffer, set this variable to silent.

A common cause for asynchronous native-compilation to produce warnings is compiling a file that is missing some require of a necessary feature. The feature may be loaded into the main emacs, but because native compilation always starts from a subprocess with a pristine environment, that may not be true for the subprocess.

User Option: native-comp-async-query-on-exit

If this variable’s value is non-nil, Emacs will query upon exiting whether to exit and kill any asynchronous native-compilation subprocesses that are still running, thus preventing the corresponding .eln files from being written. If the value is nil, the default, Emacs will kill these subprocesses without querying.

Previous: Native-Compilation Functions, Up: Compilation of Lisp to Native Code   [Contents][Index]