reddit / emacs

‘Error: junk at end of line’ with native-comp

brdrcn · 2022-04-20 01:38
(Cross-posted from https://emacs.stackexchange.com/questions/71321/error-junk-at-end-of-line-with-native-comp. This issue is almost totally preventing me from using native-comp; any help would be much appreciated!) I recently switched to Emacs 28.1 hoping to use the new native-comp support. Being on Windows, I followed [these instructions](https://www.reddit.com/r/emacs/comments/skyr49/alphagnuorg_has_shiny_new_emacs_28091_windows/hvpgq5f/?utm_source=reddit&utm_medium=web2x&context=3) to install libgccjit, copying the resulting `libgccjit.dll` library to Emacs’s `bin` folder. However, upon doing so, I received the following warning whenever Emacs attempted to compile any file: Warning (comp): C:\Users\<omitted>\AppData\Local\Temp\\libgccjit-554575/fake.s:4: Error: junk at end of line, first unrecognized character is `"' Disable showing Disable logging Warning (comp): C:\Users\<omitted>\AppData\Local\Temp\\libgccjit-554575/fake.s:4: Error: file number less than one Disable showing Disable logging Warning (comp): c:\emacs\bin\libgccjit-0.dll: error: error invoking gcc driver Disable showing Disable logging Warning (comp): <filename>: Error: Internal native compiler error failed to compile Disable showing Disable logging (Where `<filename>` is the name of each file Emacs attempted to compile, of course.) Curiously, when I launch Emacs from MSYS2 MinGW (64-bit), the errors disappear, and Emacs is successfully able to compile all files. What is going on here, and how may I fix it? All I know at this point is that the problem is probably unrelated to the dependencies to `libgccjit.dll`: using `dumpbin libgccjit.dll /dependents` revealed that Emacs’s `bin` folder already contains all dependencies of `libgccjit.dll`.
mplscorwin · 2022-04-20 04:54
Howdy. Sorry that you are having trouble. I'm fairly confident that copying `libgccjit.dll` into your Emacs bin path isn't sufficient to get native compilation working. My approach has been to add MinGW64's bin folder on my path. On my system folder is `C:\msys2\mingw64\bin` Please let me know if that helps (or if you find a better solution)!
brdrcn · 2022-04-20 07:25
I am sure that everything would work if I add the MinGW bin folder to PATH — as I understand it, this is basically what the MinGW command prompt does already. However, I would prefer to find a solution which does not make any global modifications, which could possibly interfere with the other tools I use regularly.
worthless-trash · 2022-04-20 08:58
What does fake.s look like ?
brdrcn · 2022-04-20 09:08
Hmm, the relevant directories seem to be deleted as soon as Emacs runs into an error. But I managed to get an example: https://gist.github.com/bradrn/13fd63fe891ee030a04e7aac7e0d172e.
worthless-trash · 2022-04-20 09:19
Is your name "ommitted" something odd, have any special characters ? UTF8 ?
worthless-trash · 2022-04-20 09:30
"c:/Program Files/MiKTeX 2.9/tex/latex/qcircuit" <-- this is weird, I dont know what this is.. &#x200B; Is it emacs lisp code ? Maybe the native comp compiler is trying to compile it ?
brdrcn · 2022-04-20 10:36
No, it isn’t; just lowercase English letters.
brdrcn · 2022-04-20 10:38
`qcircuit` is just the name of the file I opened. I needed to do *something* to trigger native compilation, and I happened to have opened that file recently. It’s a LaTeX file — no elisp code whatsoever.