pacman-packages icon indicating copy to clipboard operation
pacman-packages copied to clipboard

3ds: add luajit

Open TSnake41 opened this issue 4 years ago • 3 comments

This is a cleaned up version of https://github.com/devkitPro/pacman-packages/pull/85 that got too complicated.

I also added few notable changes from original pull-request :

  • there is no longer need of libdl (that required a slight source code hack while building) so I added a luajit.pc patch to remove the link to libdl (see luajit.pc.patch), LuaJIT will use default "console" behavior and throw and error when attempting to use ffi.load and few other functions (which is the expected behavior).
    • this will prevent potential breaking if some change in the source code affect this hack
    • as it is recognized as a "console" platform, libdl is not used

notes : JIT is working with various optimization (ARMv6, VFPv2, and standard JIT optimizations) but assumes that XN-bit is not set on malloc-ed memory (this has to be verified).

In case of issues with JIT we can still set -DLUAJIT_DISABLE_JIT to disable JIT and still have FFI plus a significant performance boost compared to original Lua 5.1. Note that this setting is required for a LuaJIT Switch port.

Used in LovePotion LuaJIT port

TSnake41 avatar Apr 14 '20 14:04 TSnake41

Would be simpler to just sed the .pc file in place like we've done in some of the other PKGBUILDS. See https://github.com/devkitPro/pacman-packages/blob/master/3ds/SDL_mixer/PKGBUILD#L33 for instance. Saves adding a patch file & another checksum for such a small change.

The -Wl,-E should also be removed.

WinterMute avatar Apr 14 '20 15:04 WinterMute

I am not a master of sed, but still made something working.

TSnake41 avatar Apr 14 '20 16:04 TSnake41

echo -n (string) is non-POSIX. I would recommend you use printf '%s' (string) instead.

uyjulian avatar Apr 18 '20 20:04 uyjulian