Skip to content

Commit

Permalink
Merge pull request #1573 from jclulow/neovim-0.10.3
Browse files Browse the repository at this point in the history
neovim: update to 0.10.3, work around #1539
  • Loading branch information
oetiker authored Jan 22, 2025
2 parents 03cdce9 + 2461db1 commit 164ad6b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build/neovim/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
. ../../lib/build.sh

PROG=neovim
VER=0.10.2
VER=0.10.3
PKG=ooce/editor/neovim
SUMMARY="Neovim"
DESC="hyperextensible Vim-based text editor"
Expand Down Expand Up @@ -55,7 +55,8 @@ pre_configure() {
-DUSE_BUNDLED_LIBUV=OFF
\"
CMAKE_EXTRA_FLAGS=\"
-DCMAKE_EXE_LINKER_FLAGS='-Wl,-R$OPREFIX/${LIBDIRS[$arch]} -lgcc_s'
-DCMAKE_EXE_LINKER_FLAGS='-Wl,-R$OPREFIX/${LIBDIRS[$arch]} -lgcc_s
-lumem'
\"
"

Expand Down
31 changes: 31 additions & 0 deletions build/neovim/patches/illumos-luajit-umem-workaround.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- a~/src/nvim/os_illumos.c Tue Jan 21 16:21:57 2025
+++ a/src/nvim/os_illumos.c Tue Jan 21 16:39:03 2025
@@ -174,3 +174,28 @@

return (0);
}
+
+/*
+ * At present, due to an argument between bespoke generated assembly in LuaJIT
+ * and our linker, we cannot build LuaJIT as a shared library for use by
+ * Neovim. To work around this, we build LuaJIT statically and embed it in the
+ * nvim executable directly. Unfortunately this means the program text for
+ * LuaJIT is placed before the heap, and LuaJIT does some ill-advised things
+ * with mmap() for memory allocation which means it forcibly tries to put
+ * memory allocations quite close to the heap. As the brk moves up in the
+ * address space, it eventually collides with one of these low address mappings
+ * and the program crashes with an error like "E41: Out of memory" next time a
+ * malloc(3C) call fails.
+ *
+ * In order to work around this, we'll use libumem(3LIB) as our allocator
+ * instead of the base libc malloc(3C). The umem allocator has a backend that
+ * can use mmap(2) instead of brk(2) to get memory, which avoids the clash with
+ * LuaJIT.
+ *
+ * See omnios-extra#1539 for more details.
+ */
+const char *
+_umem_options_init(void)
+{
+ return ("backend=mmap");
+}
1 change: 1 addition & 0 deletions build/neovim/patches/series
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
libuv.patch
link-gcc_s.patch
illumos-support.patch
illumos-luajit-umem-workaround.patch
use-system-default-tty-modes.patch
path.patch
2 changes: 1 addition & 1 deletion doc/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
| ooce/editor/helix | 25.01 | https://github.com/helix-editor/helix/releases| [omniosorg](https://github.com/omniosorg)
| ooce/editor/joe | 4.6 | https://sourceforge.net/projects/joe-editor/files/JOE%20sources/ | [omniosorg](https://github.com/omniosorg)
| ooce/editor/nano | 8.2 | https://ftp.gnu.org/gnu/nano/ | [omniosorg](https://github.com/omniosorg)
| ooce/editor/neovim | 0.10.2 | https://github.com/neovim/neovim/releases | [omniosorg](https://github.com/omniosorg)
| ooce/editor/neovim | 0.10.3 | https://github.com/neovim/neovim/releases | [omniosorg](https://github.com/omniosorg)
| ooce/emulator/qemu | 9.2.0 | https://www.qemu.org/download/ | [omniosorg](https://github.com/omniosorg)
| ooce/file/acltool | 1.16.2 | https://github.com/ptrrkssn/acltool/releases | [Peter Eriksson](https://github.com/ptrrkssn)
| ooce/file/lsof | 4.99.3 | https://github.com/lsof-org/lsof/releases | [omniosorg](https://github.com/omniosorg)
Expand Down

0 comments on commit 164ad6b

Please sign in to comment.