emacs-devel
[Top][All Lists]
Advanced

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

Native compiler - passing command line options to C compiler


From: Arthur Miller
Subject: Native compiler - passing command line options to C compiler
Date: Sun, 29 Aug 2021 23:47:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi again,

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.

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 have looked into a diff of currently only one compiled file; I took the
biggest I say by size in Dired on the screen, allout.el in top lisp dir in
emacs. I have seen some nops being replaced with instructions in version where
code was emitted for skylake compared to generic but summa summarum, Eli is
probably correct that this won't give much, if any noticable, performance in
speed. I haen't had time to do benchmarks.

Attached are patch and diff for dissasembled

The error I got is pasted below.
allout.eln.

("-march=skylake" "-mtune=native")
Loading 
/home/arthur/.emacs.d/eln-cache/28.0.50-b3774752/allout-54433bcc-f338f47c.eln 
(native compiled elisp)...done
("-march=native" "-mtune=native")
comp--native-compile: Native compiler error: 
"/home/arthur/repos/emacs-tests/emacs/lisp/allout.el", "Compiling 
/home/arthur/.emacs.d/eln-cache/28.0.50-b3774752/allout-54433bcc-f338f47c.eln...
libgccjit.so: fel: felaktigt värde (”native”) till flaggan ”-march=”
libgccjit.so: anm: giltiga argument till flaggan ”-march=” är: nocona core2 
nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell 
core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake 
icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake 
bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 
x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 
nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 
athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 
btver1 btver2 native
Assemblermeddelanden:
Fel: kan inte öppna /tmp/libgccjit-gxYuPM/fake.s för läsning: Filen eller 
katalogen finns inte
libgccjit.so: error: error invoking gcc driver
Debugger entered--Lisp error: (native-ice \"failed to compile\" 
\"/home/arthur/.emacs.d/eln-cache/28.0.50-b3774752/a...\" \"error invoking gcc 
driver\")
  
comp--compile-ctxt-to-file(\"/home/arthur/.emacs.d/eln-cache/28.0.50-b3774752/a...\")
  
comp-compile-ctxt-to-file(\"/home/arthur/.emacs.d/eln-cache/28.0.50-b3774752/a...\")
  comp-final1()
  
load-with-code-conversion(\"/tmp/emacs-int-comp-allout-54433bcc-f338f47c-YRzJM...\"
 \"/tmp/emacs-int-comp-allout-54433bcc-f338f47c-YRzJM...\" nil t)
  command-line-1((\"-l\" 
\"/tmp/emacs-int-comp-allout-54433bcc-f338f47c-YRzJM...\"))
  command-line()
  normal-top-level()

"
Mark set

Attachment: ncomp-opts.patch
Description: Text Data

Attachment: allout.diff
Description: Text Data


reply via email to

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