Skip to content

Commit

Permalink
deps src: Automatic update
Browse files Browse the repository at this point in the history
  • Loading branch information
marvim committed Apr 20, 2024
1 parent e5fa9a4 commit 4d5049a
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 192 deletions.
30 changes: 15 additions & 15 deletions src/luajit-stamp/download-luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ function(check_file_hash has_hash hash_is_good)
set("${has_hash}" TRUE PARENT_SCOPE)

message(STATUS "verifying file...
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz'")
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz'")

file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz" actual_value)
file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz" actual_value)

if(NOT "${actual_value}" STREQUAL "6abd146a1dfa240a965748f63221633446affa2a715e3eb03879136e3efb95f4")
if(NOT "${actual_value}" STREQUAL "0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2")
set("${hash_is_good}" FALSE PARENT_SCOPE)
message(STATUS "SHA256 hash of
/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz
/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz
does not match expected value
expected: '6abd146a1dfa240a965748f63221633446affa2a715e3eb03879136e3efb95f4'
expected: '0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2'
actual: '${actual_value}'")
else()
set("${hash_is_good}" TRUE PARENT_SCOPE)
Expand Down Expand Up @@ -71,32 +71,32 @@ function(sleep_before_download attempt)
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
endfunction()

if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz")
if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz")
check_file_hash(has_hash hash_is_good)
if(has_hash)
if(hash_is_good)
message(STATUS "File already exists and hash match (skip download):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz'
SHA256='6abd146a1dfa240a965748f63221633446affa2a715e3eb03879136e3efb95f4'"
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz'
SHA256='0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2'"
)
return()
else()
message(STATUS "File already exists but hash mismatch. Removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz")
endif()
else()
message(STATUS "File already exists but no hash specified (use URL_HASH):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz'
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz'
Old file will be removed and new file downloaded from URL."
)
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz")
endif()
endif()

set(retry_number 5)

message(STATUS "Downloading...
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz'
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz'
timeout='none'
inactivity timeout='none'"
)
Expand All @@ -107,7 +107,7 @@ foreach(i RANGE ${retry_number})
if(status_code IN_LIST download_retry_codes)
sleep_before_download(${i})
endif()
foreach(url IN ITEMS [====[https://github.com/LuaJIT/LuaJIT/archive/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz]====])
foreach(url IN ITEMS [====[https://github.com/LuaJIT/LuaJIT/archive/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz]====])
if(NOT url IN_LIST skip_url_list)
message(STATUS "Using src='${url}'")

Expand All @@ -118,7 +118,7 @@ foreach(i RANGE ${retry_number})

file(
DOWNLOAD
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz"
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz"

# no TIMEOUT
# no INACTIVITY_TIMEOUT
Expand All @@ -135,7 +135,7 @@ foreach(i RANGE ${retry_number})
check_file_hash(has_hash hash_is_good)
if(has_hash AND NOT hash_is_good)
message(STATUS "Hash mismatch, removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz")
else()
message(STATUS "Downloading... done")
return()
Expand Down
2 changes: 1 addition & 1 deletion src/luajit-stamp/extract-luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5)

# Make file names absolute:
#
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz" ABSOLUTE)
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/luajit/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz" ABSOLUTE)
get_filename_component(directory "/home/runner/work/deps/deps/neovim/deps/build/src/luajit" ABSOLUTE)

message(STATUS "extracting...
Expand Down
4 changes: 2 additions & 2 deletions src/luajit-stamp/luajit-urlinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ method=url
command=/usr/local/bin/cmake;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/download-luajit.cmake;COMMAND;/usr/local/bin/cmake;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/verify-luajit.cmake;COMMAND;/usr/local/bin/cmake;-P;/home/runner/work/deps/deps/neovim/deps/build/src/luajit-stamp/extract-luajit.cmake
source_dir=/home/runner/work/deps/deps/neovim/deps/build/src/luajit
work_dir=/home/runner/work/deps/deps/neovim/deps/build/src
url(s)=https://github.com/LuaJIT/LuaJIT/archive/d06beb0480c5d1eb53b3343e78063950275aa281.tar.gz
hash=SHA256=6abd146a1dfa240a965748f63221633446affa2a715e3eb03879136e3efb95f4
url(s)=https://github.com/LuaJIT/LuaJIT/archive/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz
hash=SHA256=0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2
no_extract=

2 changes: 1 addition & 1 deletion src/luajit/.relver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1710088188
1713484068
4 changes: 2 additions & 2 deletions src/luajit/doc/ext_buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,9 @@ <h3 id="serialize_format">Serialization Format Specification</h3>
tab → 0x08 // Empty table
| 0x09 h.U h*{object object} // Key/value hash
| 0x0a a.U a*object // 0-based array
| 0x0b a.U a*object h.U h*{object object} // Mixed
| 0x0b a.U h.U a*object h*{object object} // Mixed
| 0x0c a.U (a-1)*object // 1-based array
| 0x0d a.U (a-1)*object h.U h*{object object} // Mixed
| 0x0d a.U h.U (a-1)*object h*{object object} // Mixed
tab_mt → 0x0e (index-1).U tab // Metatable dict entry

int64 → 0x10 int.L // FFI int64_t
Expand Down
155 changes: 34 additions & 121 deletions src/luajit/src/jit/bcsave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,24 +439,12 @@ typedef struct
{
mach_header; uint32_t reserved;
} mach_header_64;
typedef struct {
uint32_t cmd, cmdsize;
char segname[16];
uint32_t vmaddr, vmsize, fileoff, filesize;
uint32_t maxprot, initprot, nsects, flags;
} mach_segment_command;
typedef struct {
uint32_t cmd, cmdsize;
char segname[16];
uint64_t vmaddr, vmsize, fileoff, filesize;
uint32_t maxprot, initprot, nsects, flags;
} mach_segment_command_64;
typedef struct {
char sectname[16], segname[16];
uint32_t addr, size;
uint32_t offset, align, reloff, nreloc, flags;
uint32_t reserved1, reserved2;
} mach_section;
typedef struct {
char sectname[16], segname[16];
uint64_t addr, size;
Expand All @@ -466,133 +454,58 @@ typedef struct {
typedef struct {
uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize;
} mach_symtab_command;
typedef struct {
int32_t strx;
uint8_t type, sect;
int16_t desc;
uint32_t value;
} mach_nlist;
typedef struct {
int32_t strx;
uint8_t type, sect;
uint16_t desc;
uint64_t value;
} mach_nlist_64;
typedef struct
{
int32_t magic, nfat_arch;
} mach_fat_header;
typedef struct
{
int32_t cputype, cpusubtype, offset, size, align;
} mach_fat_arch;
typedef struct {
struct {
mach_header hdr;
mach_segment_command seg;
mach_section sec;
mach_symtab_command sym;
} arch[1];
mach_nlist sym_entry;
uint8_t space[4096];
} mach_obj;
typedef struct {
struct {
mach_header_64 hdr;
mach_segment_command_64 seg;
mach_section_64 sec;
mach_symtab_command sym;
} arch[1];
mach_header_64 hdr;
mach_segment_command_64 seg;
mach_section_64 sec;
mach_symtab_command sym;
mach_nlist_64 sym_entry;
uint8_t space[4096];
} mach_obj_64;
typedef struct {
mach_fat_header fat;
mach_fat_arch fat_arch[2];
struct {
mach_header hdr;
mach_segment_command seg;
mach_section sec;
mach_symtab_command sym;
} arch[2];
mach_nlist sym_entry;
uint8_t space[4096];
} mach_fat_obj;
typedef struct {
mach_fat_header fat;
mach_fat_arch fat_arch[2];
struct {
mach_header_64 hdr;
mach_segment_command_64 seg;
mach_section_64 sec;
mach_symtab_command sym;
} arch[2];
mach_nlist_64 sym_entry;
uint8_t space[4096];
} mach_fat_obj_64;
]]
local symname = '_'..LJBC_PREFIX..ctx.modname
local isfat, is64, align, mobj = false, false, 4, "mach_obj"
if ctx.arch == "x64" then
is64, align, mobj = true, 8, "mach_obj_64"
elseif ctx.arch == "arm" then
isfat, mobj = true, "mach_fat_obj"
elseif ctx.arch == "arm64" then
is64, align, isfat, mobj = true, 8, true, "mach_fat_obj_64"
else
check(ctx.arch == "x86", "unsupported architecture for OSX")
local cputype, cpusubtype = 0x01000007, 3
if ctx.arch ~= "x64" then
check(ctx.arch == "arm64", "unsupported architecture for OSX")
cputype, cpusubtype = 0x0100000c, 0
end
local function aligned(v, a) return bit.band(v+a-1, -a) end
local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE.

-- Create Mach-O object and fill in header.
local o = ffi.new(mobj)
local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, align)
local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12}, arm64={0x01000007,0x0100000c} })[ctx.arch]
local cpusubtype = ({ x86={3}, x64={3}, arm={3,9}, arm64={3,0} })[ctx.arch]
if isfat then
o.fat.magic = be32(0xcafebabe)
o.fat.nfat_arch = be32(#cpusubtype)
end
local o = ffi.new("mach_obj_64")
local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, 8)

-- Fill in sections and symbols.
for i=0,#cpusubtype-1 do
local ofs = 0
if isfat then
local a = o.fat_arch[i]
a.cputype = be32(cputype[i+1])
a.cpusubtype = be32(cpusubtype[i+1])
-- Subsequent slices overlap each other to share data.
ofs = ffi.offsetof(o, "arch") + i*ffi.sizeof(o.arch[0])
a.offset = be32(ofs)
a.size = be32(mach_size-ofs+#s)
end
local a = o.arch[i]
a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface
a.hdr.cputype = cputype[i+1]
a.hdr.cpusubtype = cpusubtype[i+1]
a.hdr.filetype = 1
a.hdr.ncmds = 2
a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym)
a.seg.cmd = is64 and 0x19 or 0x1
a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)
a.seg.vmsize = #s
a.seg.fileoff = mach_size-ofs
a.seg.filesize = #s
a.seg.maxprot = 1
a.seg.initprot = 1
a.seg.nsects = 1
ffi.copy(a.sec.sectname, "__data")
ffi.copy(a.sec.segname, "__DATA")
a.sec.size = #s
a.sec.offset = mach_size-ofs
a.sym.cmd = 2
a.sym.cmdsize = ffi.sizeof(a.sym)
a.sym.symoff = ffi.offsetof(o, "sym_entry")-ofs
a.sym.nsyms = 1
a.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)-ofs
a.sym.strsize = aligned(#symname+2, align)
end
o.hdr.magic = 0xfeedfacf
o.hdr.cputype = cputype
o.hdr.cpusubtype = cpusubtype
o.hdr.filetype = 1
o.hdr.ncmds = 2
o.hdr.sizeofcmds = ffi.sizeof(o.seg)+ffi.sizeof(o.sec)+ffi.sizeof(o.sym)
o.seg.cmd = 0x19
o.seg.cmdsize = ffi.sizeof(o.seg)+ffi.sizeof(o.sec)
o.seg.vmsize = #s
o.seg.fileoff = mach_size
o.seg.filesize = #s
o.seg.maxprot = 1
o.seg.initprot = 1
o.seg.nsects = 1
ffi.copy(o.sec.sectname, "__data")
ffi.copy(o.sec.segname, "__DATA")
o.sec.size = #s
o.sec.offset = mach_size
o.sym.cmd = 2
o.sym.cmdsize = ffi.sizeof(o.sym)
o.sym.symoff = ffi.offsetof(o, "sym_entry")
o.sym.nsyms = 1
o.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)
o.sym.strsize = aligned(#symname+2, 8)
o.sym_entry.type = 0xf
o.sym_entry.sect = 1
o.sym_entry.strx = 1
Expand Down
7 changes: 6 additions & 1 deletion src/luajit/src/jit/dump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,12 @@ local recdepth = 0
local function fmterr(err, info)
if type(err) == "number" then
if type(info) == "function" then info = fmtfunc(info) end
err = format(vmdef.traceerr[err], info)
local fmt = vmdef.traceerr[err]
if fmt == "NYI: bytecode %s" then
local oidx = 6 * info
info = sub(vmdef.bcnames, oidx+1, oidx+6)
end
err = format(fmt, info)
end
return err
end
Expand Down
9 changes: 7 additions & 2 deletions src/luajit/src/jit/v.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local jit = require("jit")
local jutil = require("jit.util")
local vmdef = require("jit.vmdef")
local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
local type, format = type, string.format
local type, sub, format = type, string.sub, string.format
local stdout, stderr = io.stdout, io.stderr

-- Active flag and output file handle.
Expand All @@ -89,7 +89,12 @@ end
local function fmterr(err, info)
if type(err) == "number" then
if type(info) == "function" then info = fmtfunc(info) end
err = format(vmdef.traceerr[err], info)
local fmt = vmdef.traceerr[err]
if fmt == "NYI: bytecode %s" then
local oidx = 6 * info
info = sub(vmdef.bcnames, oidx+1, oidx+6)
end
err = format(fmt, info)
end
return err
end
Expand Down
Loading

0 comments on commit 4d5049a

Please sign in to comment.