caldwell / build-emacs

Build scripts for www.emacsformacosx.com
http://www.emacsformacosx.com/about
GNU General Public License v3.0
364 stars 61 forks source link

--with-native-compilation #107

Open borkdude opened 3 years ago

borkdude commented 3 years ago

Thanks a lot for providing emacs for osx!

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

mdbergmann commented 2 years ago

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

sfdc-slumos commented 2 years ago

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...

maikol-solis commented 2 years ago

👍

caldwell commented 2 years ago

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.

ditdb commented 2 years ago

I anticipate the feature very much!

claytonrcarter commented 1 year ago

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?

e40 commented 1 year ago

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.

denisw commented 1 year ago

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

ahihi commented 1 year ago

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? :)