build-emacs icon indicating copy to clipboard operation
build-emacs copied to clipboard

--with-native-compilation

Open borkdude opened this issue 3 years ago • 9 comments

Thanks a lot for providing emacs for osx!

Any change we can get builds with --with-native-compilation enabled?

borkdude avatar Apr 30 '21 16:04 borkdude

AFAIK this is default in Emacs master branch? So any nightly will have it.

mdbergmann avatar Nov 19 '21 15:11 mdbergmann

Apparently not.

error: Emacs was not compiled with native compiler support (--with-native-compilation)

Downloaded Emacs-pretest-28.0.92-universal.dmg, got error, came here, downloaded Emacs-2022-03-20_00-09-17-9b34005…-universal.dmg same error. So that was fun...

sfdc-slumos avatar Apr 01 '22 23:04 sfdc-slumos

👍

maikol-solis avatar May 13 '22 12:05 maikol-solis

I've worked on it a little so far but it's harder than you'd expect to actually ship it:

  1. Native comp requires libgccjit, which means compiling all of gcc.
  2. The resulting binary expects ld and as to be there when it runs, and complains loudly when they are not. So that means either emacs suddenly needs xcode installed, or I have to figure out if I can ship gas and gnu ld.

I've done 1, it wasn't terribly difficult. But I need to figure out 2.

caldwell avatar May 13 '22 17:05 caldwell

I anticipate the feature very much!

ditdb avatar Aug 22 '22 05:08 ditdb

Asking w/ no knowledge of what is actually involved...

@caldwell Is it an option to disable native comp support by default, but then enable it at runtime if the host system has xcode/ld/as/etc installed? Not an ideal solution, but might it be a way forward until a better solution is found?

claytonrcarter avatar Oct 01 '22 10:10 claytonrcarter

I've worked on it a little so far but it's harder than you'd expect to actually ship it:

1. Native comp requires libgccjit, which means compiling all of gcc.

2. The resulting binary expects `ld` and `as` to be there when it runs, and complains loudly when they are not. So that means either emacs suddenly needs xcode installed, or I have to figure out if I can ship gas and gnu ld.

I've done 1, it wasn't terribly difficult. But I need to figure out 2.

What about requiring the Command Line xcode tools to be installed? That would remove the responsibility from your side... just a thought.

e40 avatar Oct 31 '22 17:10 e40

Has this become easier to accomplish now that the build is performed using Nix (https://emacsformacosx.com/about)?

denisw avatar Apr 13 '23 08:04 denisw

speaking of Nix, the emacsPgtk package (and possibly others) at nix-community/emacs-overlay comes with native-comp and is working great for me on macOS 10.14. perhaps something to take inspiration from? :)

ahihi avatar Apr 13 '23 10:04 ahihi