Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] LuaJIT: don't apply ppc64 patchset for ppc (breaks JIT)
Date: Fri, 11 Oct 2019 12:16:49 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15328@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages luajit-32
https://github.com/void-linux/void-packages/pull/15328

LuaJIT: don't apply ppc64 patchset for ppc (breaks JIT)
There is something in the ppc64 patch that breaks 32-bit ppc in some scenarios (it appears to work but segfaults e.g. when building neovim). So until that is investigated and fixed, conditionalize this.

A patch file from https://github.com/void-linux/void-packages/pull/15328.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-luajit-32-15328.patch --]
[-- Type: text/x-diff, Size: 3896 bytes --]

From 2bb3dd53600391f6329c3bbbdbb6980b0438a085 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 11 Oct 2019 12:07:41 +0200
Subject: [PATCH] LuaJIT: don't apply ppc64 patchset for ppc (breaks JIT)

There is something in the ppc64 patch that breaks 32-bit ppc in
some scenarios (it appears to work but segfaults e.g. when
building neovim). So until that is investigated and fixed,
conditionalize this.
---
 .../patches/ppc}/musl-ppc-secureplt.patch       | 16 ++++++----------
 .../patches/ppc64}/add-ppc64-support.patch      |  0
 .../patches/ppc64}/fix-vm-jit-ppc64.patch       |  0
 srcpkgs/LuaJIT/template                         | 17 +++++++++++++++++
 4 files changed, 23 insertions(+), 10 deletions(-)
 rename srcpkgs/LuaJIT/{patches => files/patches/ppc}/musl-ppc-secureplt.patch (89%)
 rename srcpkgs/LuaJIT/{patches => files/patches/ppc64}/add-ppc64-support.patch (100%)
 rename srcpkgs/LuaJIT/{patches => files/patches/ppc64}/fix-vm-jit-ppc64.patch (100%)

diff --git a/srcpkgs/LuaJIT/patches/musl-ppc-secureplt.patch b/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch
similarity index 89%
rename from srcpkgs/LuaJIT/patches/musl-ppc-secureplt.patch
rename to srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch
index 2b0578f9c58..b7304474f77 100644
--- a/srcpkgs/LuaJIT/patches/musl-ppc-secureplt.patch
+++ b/srcpkgs/LuaJIT/files/patches/ppc/musl-ppc-secureplt.patch
@@ -33,8 +33,6 @@ This fixes crashes on ppc-musl, as musl only supports secureplt.
  }
  
  #if LJ_HASJIT
-diff --git a/src/lj_dispatch.h b/src/lj_dispatch.h
-index 5bda51a..23f937f 100644
 --- src/lj_dispatch.h
 +++ src/lj_dispatch.h
 @@ -66,6 +66,21 @@ GOTDEF(GOTENUM)
@@ -68,14 +66,12 @@ index 5bda51a..23f937f 100644
    ASMFunction got[LJ_GOT__MAX];		/* Global offset table. */
  #endif
  #if LJ_HASJIT
-diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc
-index 14a35d2..c239006 100644
 --- src/vm_ppc.dasc
 +++ src/vm_ppc.dasc
-@@ -51,7 +51,12 @@
- |.macro blex, target; bl extern target; nop; .endmacro
- |.macro .toc, a, b; a, b; .endmacro
- |.else
+@@ -59,7 +59,12 @@
+ |.define ENV_OFS,	8
+ |.endif
+ |.else  // No TOC.
 -|.macro blex, target; bl extern target@plt; .endmacro
 +|.macro blex, target
 +|  lwz TMP0, DISPATCH_GOT(target)(DISPATCH)
@@ -85,8 +81,8 @@ index 14a35d2..c239006 100644
 +|.endmacro
  |.macro .toc, a, b; .endmacro
  |.endif
- |.if OPD
-@@ -540,6 +545,8 @@
+ |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro
+@@ -448,6 +453,8 @@
  |// Assumes DISPATCH is relative to GL.
  #define DISPATCH_GL(field)	(GG_DISP2G + (int)offsetof(global_State, field))
  #define DISPATCH_J(field)	(GG_DISP2J + (int)offsetof(jit_State, field))
diff --git a/srcpkgs/LuaJIT/patches/add-ppc64-support.patch b/srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch
similarity index 100%
rename from srcpkgs/LuaJIT/patches/add-ppc64-support.patch
rename to srcpkgs/LuaJIT/files/patches/ppc64/add-ppc64-support.patch
diff --git a/srcpkgs/LuaJIT/patches/fix-vm-jit-ppc64.patch b/srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch
similarity index 100%
rename from srcpkgs/LuaJIT/patches/fix-vm-jit-ppc64.patch
rename to srcpkgs/LuaJIT/files/patches/ppc64/fix-vm-jit-ppc64.patch
diff --git a/srcpkgs/LuaJIT/template b/srcpkgs/LuaJIT/template
index b204c21811f..313404defe1 100644
--- a/srcpkgs/LuaJIT/template
+++ b/srcpkgs/LuaJIT/template
@@ -47,6 +47,23 @@ if [ "$CROSS_BUILD" ]; then
 	esac
 fi
 
+# the ppc64 patchset subtly breaks ppc, needs investigation; for
+# now apply patches conditionally, separately for ppc64 and ppc
+post_patch() {
+	local patchdir
+
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) patchdir="ppc64";;
+		ppc*) patchdir="ppc";;
+		*) return;;
+	esac
+
+	for i in ${FILESDIR}/patches/${patchdir}/*.patch; do
+		msg_normal "patching: $i\n"
+		patch -sNp0 -i ${i}
+	done
+}
+
 do_build() {
 	local _cflags=$CFLAGS
 	local _ldflags=$LDFLAGS

             reply	other threads:[~2019-10-11 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 10:16 voidlinux-github [this message]
2019-10-11 10:29 ` voidlinux-github
2019-10-11 10:29 ` voidlinux-github
2019-10-12  8:51 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15328@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).