Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 685010

Summary: =dev-lang/luajit-2.1.0_beta3 : add USE flag for GC64 mode
Product: Gentoo Linux Reporter: Red <redblade7>
Component: Current packagesAssignee: William Hubbs <williamh>
Status: UNCONFIRMED ---    
Severity: major CC: jstein, redblade7, vilhelm.gray
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=678404
https://bugs.gentoo.org/show_bug.cgi?id=682990
https://github.com/gentoo/gentoo/pull/13548
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 682990    
Attachments: Enable GC64 in LuaJIT-2.1.0-beta3

Description Red 2019-05-03 22:39:35 UTC
LuaJIT v2.1.0_beta3 offers GC64 mode.

This is needed for certain things such as multiplayer Minetest servers (games-action/minetest and games-action/minetest_game) which require more than 2 GB RAM. Older versions of LuaJIT will crash the game, as will LuaJIT 2.1.0_beta3 without GC64 mode enabled.

This usually only happens when running multiplayer servers with lots of mods and where lots of players have built things on the server over an extended period of time. This happened to me on a mod-heavy server I run on a Slackware VPS ("THE CREATIVE GARDENS" in the public server list) after the first two years of its existence.

The maintainer of games-action/minetest (William Breathitt Gray) has offered to add this fix as a USE flag if =dev-lang/luajit-2.1.0_beta3 was to add a USE flag for GC64.

Enabling GC64 also requires a tweak to the LuaJIT Makefile.

More info:

* https://forum.minetest.net/viewtopic.php?f=3&t=18263
* https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/Makefile#L114
* Bug 678404
* Bug 682990
Comment 1 Red 2019-09-22 20:32:40 UTC
Created attachment 590662 [details, diff]
Enable GC64 in LuaJIT-2.1.0-beta3

Hi,

I've attached a patch file which enables GC64 mode in LuaJIT-2.1.0-beta3.

All it does is uncomment a single line in src/Makefile.

I don't know how to write ebuild files, but I hope to see this USE flag added soon, so that bug 682990 may be fixed.

Thank you!
Comment 2 William Breathitt Gray 2019-09-25 22:52:51 UTC
(In reply to Red from comment #1)
> Created attachment 590662 [details, diff] [details, diff]
> Enable GC64 in LuaJIT-2.1.0-beta3
> 
> Hi,
> 
> I've attached a patch file which enables GC64 mode in LuaJIT-2.1.0-beta3.
> 
> All it does is uncomment a single line in src/Makefile.
> 
> I don't know how to write ebuild files, but I hope to see this USE flag
> added soon, so that bug 682990 may be fixed.
> 
> Thank you!

Unfortunately, this patch unconditionally enables GC64 mode, which is not really what we want for a USE flag. Since USE flags conditionally enable features, we should conditionally enable GC64 mode by checking the USE flag and passing in "-DLUAJIT_ENABLE_GC64" if enabled.
Comment 3 Red 2019-09-26 01:32:54 UTC
(In reply to William Breathitt Gray from comment #2)
> (In reply to Red from comment #1)
> > Created attachment 590662 [details, diff] [details, diff] [details, diff]
> > Enable GC64 in LuaJIT-2.1.0-beta3
> > 
> > Hi,
> > 
> > I've attached a patch file which enables GC64 mode in LuaJIT-2.1.0-beta3.
> > 
> > All it does is uncomment a single line in src/Makefile.
> > 
> > I don't know how to write ebuild files, but I hope to see this USE flag
> > added soon, so that bug 682990 may be fixed.
> > 
> > Thank you!
> 
> Unfortunately, this patch unconditionally enables GC64 mode, which is not
> really what we want for a USE flag. Since USE flags conditionally enable
> features, we should conditionally enable GC64 mode by checking the USE flag
> and passing in "-DLUAJIT_ENABLE_GC64" if enabled.

Again I don't know how portage/ebuilds work, though I hope to learn someday. I just wanted to show that enabling GC64 mode is just about uncommenting a single line.
Comment 4 William Breathitt Gray 2019-11-02 17:52:34 UTC
Is there an opposition to this? If not, I can submit a patch introducing USE flag; it looks like a simple define enables the feature, so nothing complicated here.
Comment 5 Red 2019-11-02 22:07:52 UTC
(In reply to William Breathitt Gray from comment #4)
> Is there an opposition to this? If not, I can submit a patch introducing USE
> flag; it looks like a simple define enables the feature, so nothing
> complicated here.

I'm all for it. The reason I am being a nag about it is because I might want to switch said VPS to Gentoo at some point in the future, though I'd imagine running a Gentoo VPS would be quite a commitment.
Comment 6 Red 2020-01-12 03:08:26 UTC
Recent commits to the LuaJIT repository automatically enables GC64 mode by default on 64-bit systems:

https://github.com/LuaJIT/LuaJIT/commit/bd00094c3b50e193fb32aad79b7ea8ea6b78ed25