From 02afff3663773ca079de63877aeeb336729f0940 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 29 Jul 2021 18:33:03 +0200 Subject: [PATCH] LuaJIT: switch ppc patches to -p1 (fixes texlive build) --- .../patches/ppc/musl-ppc-secureplt.patch | 12 ++--- .../patches/ppc64/add-ppc64-support.patch | 48 +++++++++---------- .../patches/ppc64/fix-vm-jit-ppc64.patch | 4 +- srcpkgs/LuaJIT/template | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch b/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch index b7304474f7..3000ca0ed3 100644 --- a/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch +++ b/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch @@ -2,8 +2,8 @@ Imported from https://github.com/LuaJIT/LuaJIT/pull/486. This fixes crashes on ppc-musl, as musl only supports secureplt. ---- src/lj_dispatch.c -+++ src/lj_dispatch.c +--- a/src/lj_dispatch.c ++++ b/src/lj_dispatch.c @@ -56,6 +56,18 @@ static const ASMFunction dispatch_got[] = { #undef GOTFUNC #endif @@ -33,8 +33,8 @@ This fixes crashes on ppc-musl, as musl only supports secureplt. } #if LJ_HASJIT ---- src/lj_dispatch.h -+++ src/lj_dispatch.h +--- a/src/lj_dispatch.h ++++ b/src/lj_dispatch.h @@ -66,6 +66,21 @@ GOTDEF(GOTENUM) }; #endif @@ -66,8 +66,8 @@ This fixes crashes on ppc-musl, as musl only supports secureplt. ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */ #endif #if LJ_HASJIT ---- src/vm_ppc.dasc -+++ src/vm_ppc.dasc +--- a/src/vm_ppc.dasc ++++ b/src/vm_ppc.dasc @@ -59,7 +59,12 @@ |.define ENV_OFS, 8 |.endif diff --git a/srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch b/srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch index 8feb60601d..7c865859da 100644 --- a/srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch +++ b/srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch @@ -26,8 +26,8 @@ Author: Rodrigo R. Galvao diff --git dynasm/dasm_ppc.lua dynasm/dasm_ppc.lua index f73974d..a4ad70b 100644 ---- dynasm/dasm_ppc.lua -+++ dynasm/dasm_ppc.lua +--- a/dynasm/dasm_ppc.lua ++++ b/dynasm/dasm_ppc.lua @@ -257,9 +257,11 @@ map_op = { addic_3 = "30000000RRI", ["addic._3"] = "34000000RRI", @@ -52,8 +52,8 @@ index f73974d..a4ad70b 100644 end), diff --git src/Makefile src/Makefile index 6b73a89..cc50bae 100644 ---- src/Makefile -+++ src/Makefile +--- a/src/Makefile ++++ b/src/Makefile @@ -453,7 +453,16 @@ ifeq (ppc,$(TARGET_LJARCH)) DASM_AFLAGS+= -D GPR64 endif @@ -74,8 +74,8 @@ index 6b73a89..cc50bae 100644 DASM_ARCH= ppc64 diff --git src/host/buildvm_asm.c src/host/buildvm_asm.c index ffd1490..6bb995e 100644 ---- src/host/buildvm_asm.c -+++ src/host/buildvm_asm.c +--- a/src/host/buildvm_asm.c ++++ b/src/host/buildvm_asm.c @@ -140,18 +140,14 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, #else #define TOCPREFIX "" @@ -111,8 +111,8 @@ index ffd1490..6bb995e 100644 fprintf(ctx->fp, "\t.text\n"); diff --git src/lj_arch.h src/lj_arch.h index d609b37..53bc651 100644 ---- src/lj_arch.h -+++ src/lj_arch.h +--- a/src/lj_arch.h ++++ b/src/lj_arch.h @@ -269,10 +269,18 @@ #if LJ_TARGET_CONSOLE #define LJ_ARCH_PPC32ON64 1 @@ -149,8 +149,8 @@ index d609b37..53bc651 100644 #endif diff --git src/lj_ccall.c src/lj_ccall.c index 5c252e5..b891591 100644 ---- src/lj_ccall.c -+++ src/lj_ccall.c +--- a/src/lj_ccall.c ++++ b/src/lj_ccall.c @@ -369,21 +369,97 @@ #elif LJ_TARGET_PPC /* -- PPC calling conventions --------------------------------------------- */ @@ -376,8 +376,8 @@ index 5c252e5..b891591 100644 #if LJ_TARGET_MIPS64 diff --git src/lj_ccall.h src/lj_ccall.h index 59f6648..bbf309f 100644 ---- src/lj_ccall.h -+++ src/lj_ccall.h +--- a/src/lj_ccall.h ++++ b/src/lj_ccall.h @@ -86,10 +86,23 @@ typedef union FPRArg { #elif LJ_TARGET_PPC @@ -404,8 +404,8 @@ index 59f6648..bbf309f 100644 typedef intptr_t GPRArg; diff --git src/lj_ccallback.c src/lj_ccallback.c index 846827b..eb7f445 100644 ---- src/lj_ccallback.c -+++ src/lj_ccallback.c +--- a/src/lj_ccallback.c ++++ b/src/lj_ccallback.c @@ -61,8 +61,24 @@ static MSize CALLBACK_OFS2SLOT(MSize ofs) #elif LJ_TARGET_PPC @@ -513,8 +513,8 @@ index 846827b..eb7f445 100644 if (ctr->size <= 4 && diff --git src/lj_ctype.h src/lj_ctype.h index 0c220a8..105865b 100644 ---- src/lj_ctype.h -+++ src/lj_ctype.h +--- a/src/lj_ctype.h ++++ b/src/lj_ctype.h @@ -153,7 +153,7 @@ typedef struct CType { /* Simplify target-specific configuration. Checked in lj_ccall.h. */ @@ -526,8 +526,8 @@ index 0c220a8..105865b 100644 diff --git src/lj_def.h src/lj_def.h index 2d8fff6..381d6f5 100644 ---- src/lj_def.h -+++ src/lj_def.h +--- a/src/lj_def.h ++++ b/src/lj_def.h @@ -71,7 +71,11 @@ typedef unsigned int uintptr_t; #define LJ_MAX_IDXCHAIN 100 /* __index/__newindex chain limit. */ #define LJ_STACK_EXTRA (5+2*LJ_FR2) /* Extra stack space (metamethods). */ @@ -542,8 +542,8 @@ index 2d8fff6..381d6f5 100644 #define LJ_MIN_GLOBAL 6 /* Min. global table size (hbits). */ diff --git src/lj_frame.h src/lj_frame.h index 19c49a4..c666418 100644 ---- src/lj_frame.h -+++ src/lj_frame.h +--- a/src/lj_frame.h ++++ b/src/lj_frame.h @@ -210,6 +210,15 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */ #define CFRAME_OFS_MULTRES 408 #define CFRAME_SIZE 384 @@ -562,8 +562,8 @@ index 19c49a4..c666418 100644 #define CFRAME_OFS_NRES 468 diff --git src/lj_target_ppc.h src/lj_target_ppc.h index c5c991a..f0c8c94 100644 ---- src/lj_target_ppc.h -+++ src/lj_target_ppc.h +--- a/src/lj_target_ppc.h ++++ b/src/lj_target_ppc.h @@ -30,8 +30,13 @@ enum { /* Calling conventions. */ @@ -603,8 +603,8 @@ index c5c991a..f0c8c94 100644 PPCI_BC = 0x40800000, diff --git src/vm_ppc.dasc src/vm_ppc.dasc index b4260eb..abb381e 100644 ---- src/vm_ppc.dasc -+++ src/vm_ppc.dasc +--- a/src/vm_ppc.dasc ++++ b/src/vm_ppc.dasc @@ -22,35 +22,40 @@ |// GPR64 64 bit registers (but possibly 32 bit pointers, e.g. PS3). |// Affects reg saves, stack layout, carry/overflow/dot flags etc. diff --git a/srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch b/srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch index ab6771110f..f4e760b738 100644 --- a/srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch +++ b/srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch @@ -1,5 +1,5 @@ ---- src/vm_ppc.dasc 2019-06-03 19:41:50.214671731 +0200 -+++ src/vm_ppc.dasc 2019-06-03 19:44:40.229686143 +0200 +--- a/src/vm_ppc.dasc 2019-06-03 19:41:50.214671731 +0200 ++++ b/src/vm_ppc.dasc 2019-06-03 19:44:40.229686143 +0200 @@ -2774,7 +2774,7 @@ | |->vm_exit_handler: diff --git a/srcpkgs/LuaJIT/template b/srcpkgs/LuaJIT/template index 9fbc72cbe4..5b8ab1beda 100644 --- a/srcpkgs/LuaJIT/template +++ b/srcpkgs/LuaJIT/template @@ -38,7 +38,7 @@ post_patch() { for i in ${FILESDIR}/patches/${patchdir}/*.patch; do msg_normal "patching: $i\n" - patch -sNp0 -i ${i} + patch -sNp1 -i ${i} done }