Subject: Re: bug#46256: [feature/native-comp] AOT eln files ignored if run from build tree

From: Eli Zaretskii <[email-masked]>
Date: Sun, 07 Mar 2021 07:55:46 +0200

> From: Andrea Corallo <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> Date: Sat, 06 Mar 2021 21:02:17 +0000
> 
> > Btw, do we have a way to force non-default compilation conditions for
> > a particular .el file, via file-local variables?  I'm thinking about
> > setting comp-speed and comp-native-driver-options.  That would help
> > users who cannot change the C code and/or don't want to customize
> > these variables globally for all compilations.
> 
> Not ATM.  I guess should be easy to implement if we have a draft of
> interface we like to expose.  Perhaps we should have a feature bug for
> this?

Done.

Another idea I had related to this: since there seem to be stability
issues with even the recent versions of libgccjit, we should perhaps
automatically add a .el file whose native-compilation failed to the
list in comp-deferred-compilation-deny-list, so that the same Emacs
session won't try native-compilation of the same .el file again.
WDYT?

(Btw, the "deferred" part in the name of the variable sounds redundant
to me, since we always compile asynchronously, except during
bootstrap, which has a separate variable anyway.)

> > Btw2, why are the *.eln files so big? do they include debug info, and
> > if so, how to request a compilation that doesn't emit debug info?
> 
> If they were compiled with comp-debug 0 they should have no debug symbol
> (should be easy to verify with objdump tho).

I didn't change comp-debug from its default, so it should be 0.

> IME even if it can vary they are often like ~2-3x the size of a .elc,
> but thinking about on a different architecture and with wide this might
> change measurably.

A data point: subr-x.elc is 16247 bytes, whereas the corresponding
.eln file (for 32-bit wide-int architecture) is 90631 bytes, a 5.5
factor.

If I look at the file with 'size', I get the following numbers:

   text    data     bss     dec     hex filename
  63951     788   24784   89523   15db3 subr-x-02dfef32-17faeb1d.eln