Bug 255706 - [PATCH] editors/emacs-devel: add option to enable native compilation
Summary: [PATCH] editors/emacs-devel: add option to enable native compilation
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: emacs@FreeBSD.org (Nobody)
Depends on:
Reported: 2021-05-08 13:33 UTC by Maciej Pasternacki
Modified: 2021-06-02 22:32 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emacs)

emacs-devel-native-compilation.patch (3.45 KB, text/plain)
2021-05-08 13:33 UTC, Maciej Pasternacki
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pasternacki 2021-05-08 13:33:31 UTC
Created attachment 224771 [details]

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