FS#70280 - Enable jit in GCC

Attached to Project: Arch Linux
Opened by Sujith (sujith) - Saturday, 03 April 2021, 09:40 GMT
Last edited by freswa (frederik) - Monday, 28 February 2022, 15:02 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 35
Private No


Please enable jit in the gcc package. It is no longer tagged as alpha, which was the reason for closing  FS#61820 .

This task depends upon

Closed by  freswa (frederik)
Monday, 28 February 2022, 15:02 GMT
Reason for closing:  Implemented
Additional comments about closing:  gcc 11.2.0-4
Comment by Allan McRae (Allan) - Saturday, 03 April 2021, 22:24 GMT
Will enable in gcc-11
Comment by Famiu (Moonglade) - Tuesday, 27 April 2021, 16:19 GMT
I guess now that gcc-11 is finally out, it can be enabled now once gcc-11 is in the repos
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 12 May 2021, 11:34 GMT
I think we're going to release JIT as a separate package, after gcc 11 lands.
Comment by Famiu (Moonglade) - Thursday, 13 May 2021, 03:29 GMT
Sorry to ask but, is it possible to know how long it might take for GCC 11 to land on the Arch testing repos?
Comment by Allan McRae (Allan) - Thursday, 13 May 2021, 04:02 GMT
It is in the [staging] repo now. My guess is a day or two before [testing].
Comment by Famiu (Moonglade) - Friday, 14 May 2021, 00:47 GMT
I noticed that it's in the Testing repos now, does it have JIT?
Comment by Giancarlo Razzolini (grazzolini) - Friday, 14 May 2021, 00:49 GMT
It's worth noting that I haven't started working on a JIT package yet, so it might take some time.
Comment by Famiu (Moonglade) - Friday, 14 May 2021, 03:42 GMT
Again, sorry to ask but, approximately how long might it take?
Comment by Allan McRae (Allan) - Friday, 14 May 2021, 03:56 GMT
Maybe 3-5 years.
Comment by Famiu (Moonglade) - Friday, 14 May 2021, 06:53 GMT
I hope that's sarcastic
Comment by Allan McRae (Allan) - Friday, 14 May 2021, 09:18 GMT
It was, but I do note that no package for gcc-jit has appeared in the AUR. So, it is hard to justify there is a demand.
Comment by Famiu (Moonglade) - Friday, 14 May 2021, 16:53 GMT
Emacs 28 will require it for native compilation (it already requires it in the master branch). Also there is libgccjit in the AUR
Comment by Tassilo Horn (tsdh) - Monday, 17 May 2021, 05:16 GMT
There is a libgccjit package in the AUR as Famiu mentioned (outdated now by the new gcc-11 release): https://aur.archlinux.org/packages/libgccjit/
And there are several emacs-28 pre-release AUR packages depending on it. (Well, I guess the AUR package will be updated anytime soon so that those will be usable again, so no hurries. But of course it would be nice if one didn't have this breakage on gcc upgrades eventually.)
Comment by Famiu (Moonglade) - Monday, 17 May 2021, 14:26 GMT
Yup, the only reason I can't try out the Emacs nativecomp branch on my PC is cause my PC will turn into toast if I have to compile GCC from source, so I'm eagerly waiting for a gcc-jit package...
Comment by Tassilo Horn (tsdh) - Wednesday, 18 August 2021, 05:06 GMT
Is there any news on this issue?
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 18 August 2021, 14:56 GMT
I have started working on the latest toolchain rebuild and I'll try to tackle this as well.
Comment by Tassilo Horn (tsdh) - Wednesday, 18 August 2021, 15:32 GMT
Great, thanks for the status update.
Comment by Sujith (sujith) - Saturday, 04 December 2021, 05:11 GMT
A thread on emacs-devel about enabling native compilation by default with libgccjit:
Comment by Allan McRae (Allan) - Saturday, 04 December 2021, 08:37 GMT

Enabling language "jit" requires --enable-host-shared.

--enable-host-shared typically slows the rest of the compiler down by
a few %, so you must explicitly enable it.

If you want to build both the jit and the regular compiler, it is often
best to do this via two separate configure/builds, in separate
directories, to avoid imposing the performance cost of
--enable-host-shared on the regular compiler.

So this package should be built separated from the main toolchain.
Comment by Tassilo Horn (tsdh) - Sunday, 06 February 2022, 09:40 GMT
It's almost half a year later, so I dare to ask again: is there something new on this topic?

If there's some issue like lack of testing, I'd very much like to help. E.g., if you have some PKGBUILD available already, I'd build it and test-drive the result on my machine and report back.
Comment by Colin Woodbury (fosskers) - Sunday, 20 February 2022, 05:01 GMT
This would be very helpful to have, as all the versions of Emacs 28 on the AUR currently aren't building, and the issue is related to the recent gcc update.
Comment by freswa (frederik) - Friday, 25 February 2022, 13:28 GMT
Comment by Tassilo Horn (tsdh) - Friday, 25 February 2022, 20:19 GMT
Great to hear, Frederik. If you need testers, I'd be very happy to do so.

EDIT: I'm now using it and it seems to work fine. Thanks a lot!