```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
50 lines
2.1 KiB
Diff
50 lines
2.1 KiB
Diff
Have texluajit recognize ppc64 ELFv2 ABI and therefore emit correct dynasm
|
|
stuff.
|
|
|
|
Also, fix luajittex crashing on non-x86 64-bit systems (MAP_32BIT only exists
|
|
on x86 and defining it on other systems will activate a codepath in luajit
|
|
that segfaults).
|
|
|
|
Author: q66 <daniel@octaforge.org>
|
|
|
|
--- a/libs/luajit/configure
|
|
+++ b/libs/luajit/configure
|
|
@@ -14243,7 +14243,7 @@ else
|
|
fi
|
|
if grep 'LJ_ARCH_BITS 64' conftest.i >/dev/null 2>&1; then :
|
|
echo '-D P64' >>dynasm_flags
|
|
- if test "x$LJHOST" = xLinux; then :
|
|
+ if test "x$LJHOST" = xLinux -a "x$LJARCH" = xx64; then :
|
|
LUAJIT_DEFINES="$LUAJIT_DEFINES -DMAP_32BIT=0x40"
|
|
fi
|
|
fi
|
|
@@ -14294,6 +14294,9 @@ fi
|
|
fi
|
|
if grep 'LJ_ARCH_PPC32ON64 1' conftest.i >/dev/null 2>&1; then :
|
|
echo '-D GPR64' >>dynasm_flags
|
|
+fi
|
|
+ if grep 'LJ_ARCH_PPC_ELFV2 1' conftest.i >/dev/null 2>&1; then :
|
|
+ echo '-D ELFV2' >>dynasm_flags
|
|
fi
|
|
if grep 'LJ_ARCH_PPC64 ' conftest.i >/dev/null 2>&1; then :
|
|
DASM_ARCH=ppc64
|
|
--- a/libs/luajit/m4/lj-system.m4
|
|
+++ b/libs/luajit/m4/lj-system.m4
|
|
@@ -52,7 +52,7 @@ AS_IF([grep 'LJ_LE' conftest.i >/dev/null 2>&1],
|
|
[echo '-D ENDIAN_BE' >>dynasm_flags])
|
|
AS_IF([grep 'LJ_ARCH_BITS 64' conftest.i >/dev/null 2>&1],
|
|
[echo '-D P64' >>dynasm_flags
|
|
- AS_IF([test "x$LJHOST" = xLinux],
|
|
+ AS_IF([test "x$LJHOST" = xLinux -a "x$LJARCH" = xx64],
|
|
[LUAJIT_DEFINES="$LUAJIT_DEFINES -DMAP_32BIT=0x40"])])
|
|
AS_IF([grep 'LJ_HASJIT 1' conftest.i >/dev/null 2>&1],
|
|
[echo '-D JIT' >>dynasm_flags])
|
|
@@ -84,6 +84,8 @@ AS_CASE([$LJARCH],
|
|
[echo '-D ROUND' >>dynasm_flags])
|
|
AS_IF([grep 'LJ_ARCH_PPC32ON64 1' conftest.i >/dev/null 2>&1],
|
|
[echo '-D GPR64' >>dynasm_flags])
|
|
+ AS_IF([grep 'LJ_ARCH_PPC_ELFV2 1' conftest.i >/dev/null 2>&1],
|
|
+ [echo '-D ELFV2' >>dynasm_flags])
|
|
AS_IF([grep 'LJ_ARCH_PPC64 ' conftest.i >/dev/null 2>&1],
|
|
[DASM_ARCH=ppc64])
|
|
AS_IF([test "x$LJHOST" = xPS3],
|