Bug 255706

Summary: [PATCH] editors/emacs-devel: add option to enable native compilation
Product: Ports & Packages Reporter: Maciej Pasternacki <maciej>
Component: Individual Port(s)Assignee: emacs (Nobody) <emacs>
Status: Closed FIXED    
Severity: Affects Some People CC: ashish, jrm
Priority: --- Flags: bugzilla: maintainer-feedback? (emacs)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
emacs-devel-native-compilation.patch none

Description Maciej Pasternacki 2021-05-08 13:33:31 UTC
Created attachment 224771 [details]
emacs-devel-native-compilation.patch

Emacs 28 supports native compilation of elisp using libgccjit.

This patch adds an option to enable native compilation. This uses a GCC feature, so the option switches build to use GCC 11+ (if it's possible to make it use libgccjit and keep "main" build on clang, I couldn't find it).

Patch includes an unrelated minor fix to pkg-plist found by check-plist.
Comment 1 Ashish SHUKLA freebsd_committer freebsd_triage 2021-05-10 05:02:33 UTC
Thanks for the patch.

We had a similar-ish patch in works. Although unlike we were not using USE_GCC, and instead just adding libgccjit.so:lang/gcc11-devel to LIB_DEPENDS, and 
-I${LOCALBASE}/include, and -L${LOCALBASE}/lib/gcc11 added to CFLAGS, and LDFLAGS respectively. That got us building with system's C compiler, instead of building with GCC.

The bigger problem here for us is to incorporate the .eln files generated when compiling dependent ports. We're working on it, and we'll keep you updated.
Comment 2 Joseph Mingrone freebsd_committer freebsd_triage 2021-06-02 21:22:45 UTC
Thank you for submitting Maciej.

I attempted to give you credit by doing:

git commit --amend --author="Maciej Pasternacki <maciej@pasternacki.net>

however, I then tried to update the date, since I had been testing on different upstream commits over the past week, so I used my usual command to reset and didn't notice that it wiped out your author credit.  My apologies.
Comment 3 Maciej Pasternacki 2021-06-02 22:32:10 UTC
Thank you for merging the feature!