Skip to content

Commit 164ad6b

Browse files
authored
Merge pull request #1573 from jclulow/neovim-0.10.3
neovim: update to 0.10.3, work around #1539
2 parents 03cdce9 + 2461db1 commit 164ad6b

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

build/neovim/build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
. ../../lib/build.sh
1818

1919
PROG=neovim
20-
VER=0.10.2
20+
VER=0.10.3
2121
PKG=ooce/editor/neovim
2222
SUMMARY="Neovim"
2323
DESC="hyperextensible Vim-based text editor"
@@ -55,7 +55,8 @@ pre_configure() {
5555
-DUSE_BUNDLED_LIBUV=OFF
5656
\"
5757
CMAKE_EXTRA_FLAGS=\"
58-
-DCMAKE_EXE_LINKER_FLAGS='-Wl,-R$OPREFIX/${LIBDIRS[$arch]} -lgcc_s'
58+
-DCMAKE_EXE_LINKER_FLAGS='-Wl,-R$OPREFIX/${LIBDIRS[$arch]} -lgcc_s
59+
-lumem'
5960
\"
6061
"
6162

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- a~/src/nvim/os_illumos.c Tue Jan 21 16:21:57 2025
2+
+++ a/src/nvim/os_illumos.c Tue Jan 21 16:39:03 2025
3+
@@ -174,3 +174,28 @@
4+
5+
return (0);
6+
}
7+
+
8+
+/*
9+
+ * At present, due to an argument between bespoke generated assembly in LuaJIT
10+
+ * and our linker, we cannot build LuaJIT as a shared library for use by
11+
+ * Neovim. To work around this, we build LuaJIT statically and embed it in the
12+
+ * nvim executable directly. Unfortunately this means the program text for
13+
+ * LuaJIT is placed before the heap, and LuaJIT does some ill-advised things
14+
+ * with mmap() for memory allocation which means it forcibly tries to put
15+
+ * memory allocations quite close to the heap. As the brk moves up in the
16+
+ * address space, it eventually collides with one of these low address mappings
17+
+ * and the program crashes with an error like "E41: Out of memory" next time a
18+
+ * malloc(3C) call fails.
19+
+ *
20+
+ * In order to work around this, we'll use libumem(3LIB) as our allocator
21+
+ * instead of the base libc malloc(3C). The umem allocator has a backend that
22+
+ * can use mmap(2) instead of brk(2) to get memory, which avoids the clash with
23+
+ * LuaJIT.
24+
+ *
25+
+ * See omnios-extra#1539 for more details.
26+
+ */
27+
+const char *
28+
+_umem_options_init(void)
29+
+{
30+
+ return ("backend=mmap");
31+
+}

build/neovim/patches/series

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
libuv.patch
22
link-gcc_s.patch
33
illumos-support.patch
4+
illumos-luajit-umem-workaround.patch
45
use-system-default-tty-modes.patch
56
path.patch

doc/packages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
| ooce/editor/helix | 25.01 | https://github.com/helix-editor/helix/releases| [omniosorg](https://github.com/omniosorg)
9292
| ooce/editor/joe | 4.6 | https://sourceforge.net/projects/joe-editor/files/JOE%20sources/ | [omniosorg](https://github.com/omniosorg)
9393
| ooce/editor/nano | 8.2 | https://ftp.gnu.org/gnu/nano/ | [omniosorg](https://github.com/omniosorg)
94-
| ooce/editor/neovim | 0.10.2 | https://github.com/neovim/neovim/releases | [omniosorg](https://github.com/omniosorg)
94+
| ooce/editor/neovim | 0.10.3 | https://github.com/neovim/neovim/releases | [omniosorg](https://github.com/omniosorg)
9595
| ooce/emulator/qemu | 9.2.0 | https://www.qemu.org/download/ | [omniosorg](https://github.com/omniosorg)
9696
| ooce/file/acltool | 1.16.2 | https://github.com/ptrrkssn/acltool/releases | [Peter Eriksson](https://github.com/ptrrkssn)
9797
| ooce/file/lsof | 4.99.3 | https://github.com/lsof-org/lsof/releases | [omniosorg](https://github.com/omniosorg)

0 commit comments

Comments
 (0)