void-packages/srcpkgs/LuaJIT/patches/fix-bcsave-ppc64.patch

34 lines
1.3 KiB
Diff

--- src/jit/bcsave.lua.orig 2018-12-17 19:06:27.215042417 +0100
+++ src/jit/bcsave.lua 2018-12-17 19:17:12.982477945 +0100
@@ -64,7 +64,7 @@
local map_arch = {
x86 = true, x64 = true, arm = true, arm64 = true, arm64be = true,
- ppc = true, mips = true, mipsel = true,
+ ppc = true, ppc64 = true, ppc64le = true, mips = true, mipsel = true,
}
local map_os = {
@@ -200,9 +200,10 @@
]]
local symname = LJBC_PREFIX..ctx.modname
local is64, isbe = false, false
- if ctx.arch == "x64" or ctx.arch == "arm64" or ctx.arch == "arm64be" then
+ if ctx.arch == "x64" or ctx.arch == "arm64" or ctx.arch == "arm64be" or ctx.arch == "ppc64" or ctx.arch == "ppc64le" then
is64 = true
- elseif ctx.arch == "ppc" or ctx.arch == "mips" then
+ end
+ if ctx.arch == "ppc" or ctx.arch == "ppc64" or ctx.arch == "mips" then
isbe = true
end
@@ -237,7 +238,7 @@
hdr.eendian = isbe and 2 or 1
hdr.eversion = 1
hdr.type = f16(1)
- hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, arm64be=183, ppc=20, mips=8, mipsel=8 })[ctx.arch])
+ hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, arm64be=183, ppc=20, ppc64=21, ppc64le=21, mips=8, mipsel=8 })[ctx.arch])
if ctx.arch == "mips" or ctx.arch == "mipsel" then
hdr.flags = f32(0x50001006)
end