pwmt/zathura

[musl] landlock syscall breakage

Closed this issue · 11 comments

Hi,
I am test building zathura 0.5.8 for musl but I am hitting a snag with the sandbox. Last known good version is 0.5.6.
I am also unformiliar with landlock or musl in general so I dont know who is the most upsetting :)

configure log
The Meson build system
Version: 1.4.0
Source dir: /builddir/zathura-0.5.8
Build dir: /builddir/zathura-0.5.8/build
Build type: cross build
Project name: zathura
Project version: 0.5.8
C compiler for the host machine: x86_64-linux-musl-gcc (gcc 13.2.0 "x86_64-linux-musl-gcc (GCC) 13.2.0")
C linker for the host machine: x86_64-linux-musl-gcc ld.bfd 2.41
C compiler for the build machine: cc (gcc 13.2.0 "cc (GCC) 13.2.0")
C linker for the build machine: cc ld.bfd 2.41
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library m found: YES
Found pkg-config: YES (/builddir/.xbps-zathura/wrappers/x86_64-linux-musl-pkg-config) 0.29.2
Run-time dependency girara-gtk3 found: YES 0.4.4
Run-time dependency glib-2.0 found: YES 2.80.3
Run-time dependency gio-unix-2.0 found: YES 2.80.3
Run-time dependency gthread-2.0 found: YES 2.80.3
Run-time dependency gmodule-no-export-2.0 found: YES 2.80.3
Run-time dependency gtk+-3.0 found: YES 3.24.42
Run-time dependency json-glib-1.0 found: YES 1.9.2
Run-time dependency cairo found: YES 1.18.0
Run-time dependency libmagic found: YES 5.45
Run-time dependency sqlite3 found: YES 3.45.3
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Werror=vla: YES 
Compiler for C supports arguments -fvisibility=hidden: YES 
Compiler for C supports arguments -Werror=int-conversion: YES 
Run-time dependency synctex found: YES 2.0.0
Run-time dependency libseccomp found: YES 2.5.5
Check usable header "linux/landlock.h" : YES 
Configuring zathura-version.h using configuration
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
Build-time dependency gio-2.0 found: YES 2.80.3
Program /usr/bin/glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program rsvg-convert found: YES (/usr/bin/rsvg-convert)
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate skipped: feature tests disabled
Program appstream-util skipped: feature tests disabled
Configuring zathura using configuration
Configuring _zathura using configuration
Configuring zathura.fish using configuration
Found CMake: NO
Run-time dependency bash-completion found: NO (tried pkgconfig and cmake)
Run-time dependency fish found: NO (tried pkgconfig and cmake)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Program sphinx-build found: YES (/usr/bin/sphinx-build)
Build targets in project: 41

zathura 0.5.8

  User defined options
    Cross files   : /builddir/.xbps-zathura/wrappers/meson/xbps_meson.cross
    auto_features : auto
    bindir        : /usr/bin
    buildtype     : plain
    datadir       : /usr/share
    includedir    : /usr/include
    infodir       : /usr/share/info
    libdir        : /usr/lib64
    libexecdir    : /usr/libexec
    localedir     : /usr/share/locale
    localstatedir : /var
    mandir        : /usr/share/man
    prefix        : /usr
    sbindir       : /usr/bin
    sharedstatedir: /var/lib
    sysconfdir    : /etc
    wrap_mode     : nodownload
    b_lto         : true
    b_ndebug      : true
    b_staticpic   : true
    synctex       : enabled
    tests         : disabled

Found ninja-1.11.1 at /usr/bin/ninja

build log
ninja: Entering directory `build'
[1/104] Generating data/resources_c with a custom command
[2/104] Generating data/resources_h with a custom command
[3/104] Building translation po/de/LC_MESSAGES/zathura-de.mo
[4/104] Building translation po/ar/LC_MESSAGES/zathura-ar.mo
[5/104] Generating data/icon-32/org.pwmt.zathura_32.png with a custom command
[6/104] Generating data/icon-64/org.pwmt.zathura_64.png with a custom command
[7/104] Building translation po/ca/LC_MESSAGES/zathura-ca.mo
[8/104] Generating data/icon-128/org.pwmt.zathura_128.png with a custom command
[9/104] Building translation po/cs/LC_MESSAGES/zathura-cs.mo
[10/104] Building translation po/eo/LC_MESSAGES/zathura-eo.mo
[11/104] Building translation po/es/LC_MESSAGES/zathura-es.mo
[12/104] Building translation po/el/LC_MESSAGES/zathura-el.mo
[13/104] Building translation po/fr/LC_MESSAGES/zathura-fr.mo
[14/104] Building translation po/hr/LC_MESSAGES/zathura-hr.mo
[15/104] Building translation po/et/LC_MESSAGES/zathura-et.mo
[16/104] Building translation po/he/LC_MESSAGES/zathura-he.mo
[17/104] Building translation po/id_ID/LC_MESSAGES/zathura-id_ID.mo
[18/104] Generating data/icon-16/org.pwmt.zathura_16.png with a custom command
[19/104] Generating data/icon-256/org.pwmt.zathura_256.png with a custom command
[20/104] Building translation po/it/LC_MESSAGES/zathura-it.mo
[21/104] Building translation po/es_CL/LC_MESSAGES/zathura-es_CL.mo
[22/104] Building translation po/nl/LC_MESSAGES/zathura-nl.mo
[23/104] Building translation po/no/LC_MESSAGES/zathura-no.mo
[24/104] Building translation po/ru/LC_MESSAGES/zathura-ru.mo
[25/104] Building translation po/tr/LC_MESSAGES/zathura-tr.mo
[26/104] Building translation po/pl/LC_MESSAGES/zathura-pl.mo
[27/104] Building translation po/pt_BR/LC_MESSAGES/zathura-pt_BR.mo
[28/104] Building translation po/uk_UA/LC_MESSAGES/zathura-uk_UA.mo
[29/104] Building translation po/sv/LC_MESSAGES/zathura-sv.mo
[30/104] Building translation po/lt/LC_MESSAGES/zathura-lt.mo
[31/104] Building translation po/ta_IN/LC_MESSAGES/zathura-ta_IN.mo
[32/104] Compiling C object libzathura.a.p/zathura_checked-integer-arithmetic.c.o
[33/104] Merging translations for data/org.pwmt.zathura.appdata.xml
[34/104] Merging translations for data/org.pwmt.zathura.desktop
[35/104] Compiling C object libzathura.a.p/meson-generated_.._data_resources.c.o
[36/104] Compiling C object libzathura.a.p/zathura_content-type.c.o
[37/104] Compiling C object libzathura.a.p/zathura_file-monitor.c.o
[38/104] Compiling C object libzathura.a.p/zathura_completion.c.o
[39/104] Compiling C object libzathura.a.p/zathura_bookmarks.c.o
[40/104] Compiling C object libzathura.a.p/zathura_database.c.o
[41/104] Compiling C object libzathura.a.p/zathura_commands.c.o
[42/104] Compiling C object libzathura.a.p/zathura_file-monitor-noop.c.o
[43/104] Compiling C object libzathura.a.p/zathura_adjustment.c.o
[44/104] Compiling C object libzathura.a.p/zathura_file-monitor-glib.c.o
[45/104] Compiling C object libzathura.a.p/zathura_file-monitor-signal.c.o
[46/104] Compiling C object libzathura.a.p/zathura_callbacks.c.o
[47/104] Compiling C object libzathura.a.p/zathura_database-sqlite.c.o
[48/104] Compiling C object libzathura.a.p/zathura_config.c.o
[49/104] Compiling C object libzathura.a.p/zathura_dbus-interface.c.o
[50/104] Compiling C object libzathura.a.p/zathura_document.c.o
[51/104] Compiling C object libzathura.a.p/zathura_jumplist.c.o
[52/104] Compiling C object libzathura.a.p/zathura_links.c.o
[53/104] Compiling C object libzathura.a.p/zathura_page.c.o
[54/104] Compiling C object libzathura.a.p/zathura_marks.c.o
[55/104] Compiling C object libzathura.a.p/zathura_page-widget.c.o
[56/104] Compiling C object libzathura.a.p/zathura_plugin.c.o
[57/104] Compiling C object libzathura.a.p/zathura_print.c.o
[58/104] Compiling C object libzathura-sandbox.a.p/zathura_checked-integer-arithmetic.c.o
[59/104] Compiling C object libzathura-sandbox.a.p/meson-generated_.._data_resources.c.o
[60/104] Compiling C object libzathura.a.p/zathura_synctex.c.o
[61/104] Compiling C object libzathura.a.p/zathura_types.c.o
[62/104] Compiling C object libzathura.a.p/zathura_render.c.o
[63/104] Compiling C object libzathura.a.p/zathura_shortcuts.c.o
[64/104] Compiling C object libzathura.a.p/zathura_utils.c.o
[65/104] Compiling C object libzathura-sandbox.a.p/zathura_content-type.c.o
[66/104] Compiling C object libzathura-sandbox.a.p/zathura_adjustment.c.o
[67/104] Compiling C object libzathura-sandbox.a.p/zathura_file-monitor.c.o
[68/104] Compiling C object libzathura-sandbox.a.p/zathura_bookmarks.c.o
[69/104] Compiling C object libzathura.a.p/zathura_zathura.c.o
[70/104] Linking static target libzathura.a
[71/104] Compiling C object libzathura-sandbox.a.p/zathura_commands.c.o
[72/104] Compiling C object libzathura-sandbox.a.p/zathura_completion.c.o
[73/104] Compiling C object libzathura-sandbox.a.p/zathura_file-monitor-noop.c.o
[74/104] Compiling C object libzathura-sandbox.a.p/zathura_callbacks.c.o
[75/104] Compiling C object libzathura-sandbox.a.p/zathura_file-monitor-signal.c.o
[76/104] Compiling C object libzathura-sandbox.a.p/zathura_file-monitor-glib.c.o
[77/104] Compiling C object libzathura-sandbox.a.p/zathura_config.c.o
[78/104] Compiling C object libzathura-sandbox.a.p/zathura_database.c.o
[79/104] Compiling C object libzathura-sandbox.a.p/zathura_database-sqlite.c.o
[80/104] Compiling C object libzathura-sandbox.a.p/zathura_document.c.o
[81/104] Compiling C object libzathura-sandbox.a.p/zathura_dbus-interface.c.o
[82/104] Compiling C object libzathura-sandbox.a.p/zathura_links.c.o
[83/104] Compiling C object libzathura-sandbox.a.p/zathura_page.c.o
[84/104] Compiling C object libzathura-sandbox.a.p/zathura_jumplist.c.o
[85/104] Compiling C object libzathura-sandbox.a.p/zathura_marks.c.o
[86/104] Compiling C object libzathura-sandbox.a.p/zathura_synctex.c.o
[87/104] Compiling C object libzathura-sandbox.a.p/zathura_types.c.o
[88/104] Compiling C object libzathura-sandbox.a.p/zathura_print.c.o
[89/104] Compiling C object libzathura-sandbox.a.p/zathura_plugin.c.o
[90/104] Compiling C object libzathura-sandbox.a.p/zathura_landlock.c.o
FAILED: libzathura-sandbox.a.p/zathura_landlock.c.o 
x86_64-linux-musl-gcc -Ilibzathura-sandbox.a.p -I. -I.. -Idata -I/usr/x86_64-linux-musl/usr/include/json-glib-1.0 -I/usr/x86_64-linux-musl/usr/include/gtk-3.0 -I/usr/x86_64-linux-musl/usr/include/at-spi2-atk/2.0 -I/usr/x86_64-linux-musl/usr/include/at-spi-2.0 -I/usr/x86_64-linux-musl/usr/include/dbus-1.0 -I/usr/x86_64-linux-musl/usr/lib64/dbus-1.0/include -I/usr/x86_64-linux-musl/usr/include/gio-unix-2.0 -I/usr/x86_64-linux-musl/usr/include/pango-1.0 -I/usr/x86_64-linux-musl/usr/include/harfbuzz -I/usr/x86_64-linux-musl/usr/include/fribidi -I/usr/x86_64-linux-musl/usr/include/atk-1.0 -I/usr/x86_64-linux-musl/usr/include/cairo -I/usr/x86_64-linux-musl/usr/include/freetype2 -I/usr/x86_64-linux-musl/usr/include/pixman-1 -I/usr/x86_64-linux-musl/usr/include/gdk-pixbuf-2.0 -I/usr/x86_64-linux-musl/usr/include/libpng16 -I/usr/x86_64-linux-musl/usr/include/libmount -I/usr/x86_64-linux-musl/usr/include/blkid -I/usr/x86_64-linux-musl/usr/include/glib-2.0 -I/usr/x86_64-linux-musl/usr/lib64/glib-2.0/include -I/usr/x86_64-linux-musl/usr/include/synctex -I/usr/x86_64-linux-musl/usr/include -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c17 -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -mtune=generic -ffile-prefix-map=/builddir/zathura-0.5.8/build=. -fPIC -pthread '-DGETTEXT_PACKAGE="zathura"' '-DLOCALEDIR="/usr/share/locale"' '-DZATHURA_PLUGINDIR="/usr/lib64/zathura"' -D_DEFAULT_SOURCE -DWITH_SYNCTEX -Werror=implicit-function-declaration -Werror=vla -fvisibility=hidden -Werror=int-conversion -DWITH_SANDBOX -DWITH_SECCOMP -DWITH_LANDLOCK -MD -MQ libzathura-sandbox.a.p/zathura_landlock.c.o -MF libzathura-sandbox.a.p/zathura_landlock.c.o.d -o libzathura-sandbox.a.p/zathura_landlock.c.o -c ../zathura/landlock.c
../zathura/landlock.c: In function 'landlock_create_ruleset':
../zathura/landlock.c:17:18: error: '__NR_landlock_create_ruleset' undeclared (first use in this function); did you mean 'landlock_create_ruleset'?
   17 |   return syscall(__NR_landlock_create_ruleset, attr, size, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_create_ruleset
../zathura/landlock.c:17:18: note: each undeclared identifier is reported only once for each function it appears in
../zathura/landlock.c: In function 'landlock_add_rule':
../zathura/landlock.c:24:18: error: '__NR_landlock_add_rule' undeclared (first use in this function); did you mean 'landlock_add_rule'?
   24 |   return syscall(__NR_landlock_add_rule, ruleset_fd, rule_type, rule_attr, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_add_rule
../zathura/landlock.c: In function 'landlock_restrict_self':
../zathura/landlock.c:30:18: error: '__NR_landlock_restrict_self' undeclared (first use in this function); did you mean 'landlock_restrict_self'?
   30 |   return syscall(__NR_landlock_restrict_self, ruleset_fd, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_restrict_self
../zathura/landlock.c: In function 'landlock_create_ruleset':
../zathura/landlock.c:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
../zathura/landlock.c: In function 'landlock_restrict_self':
../zathura/landlock.c:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
../zathura/landlock.c: In function 'landlock_add_rule':
../zathura/landlock.c:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
[91/104] Compiling C object libzathura-sandbox.a.p/zathura_page-widget.c.o
[92/104] Compiling C object libzathura-sandbox.a.p/zathura_render.c.o
[93/104] Compiling C object libzathura-sandbox.a.p/zathura_shortcuts.c.o
[94/104] Compiling C object zathura-sandbox.p/zathura_landlock.c.o
FAILED: zathura-sandbox.p/zathura_landlock.c.o 
x86_64-linux-musl-gcc -Izathura-sandbox.p -I. -I.. -I/usr/x86_64-linux-musl/usr/include/json-glib-1.0 -I/usr/x86_64-linux-musl/usr/include/gtk-3.0 -I/usr/x86_64-linux-musl/usr/include/at-spi2-atk/2.0 -I/usr/x86_64-linux-musl/usr/include/at-spi-2.0 -I/usr/x86_64-linux-musl/usr/include/dbus-1.0 -I/usr/x86_64-linux-musl/usr/lib64/dbus-1.0/include -I/usr/x86_64-linux-musl/usr/include/gio-unix-2.0 -I/usr/x86_64-linux-musl/usr/include/pango-1.0 -I/usr/x86_64-linux-musl/usr/include/harfbuzz -I/usr/x86_64-linux-musl/usr/include/fribidi -I/usr/x86_64-linux-musl/usr/include/atk-1.0 -I/usr/x86_64-linux-musl/usr/include/cairo -I/usr/x86_64-linux-musl/usr/include/freetype2 -I/usr/x86_64-linux-musl/usr/include/pixman-1 -I/usr/x86_64-linux-musl/usr/include/gdk-pixbuf-2.0 -I/usr/x86_64-linux-musl/usr/include/libpng16 -I/usr/x86_64-linux-musl/usr/include/libmount -I/usr/x86_64-linux-musl/usr/include/blkid -I/usr/x86_64-linux-musl/usr/include/glib-2.0 -I/usr/x86_64-linux-musl/usr/lib64/glib-2.0/include -I/usr/x86_64-linux-musl/usr/include/synctex -I/usr/x86_64-linux-musl/usr/include -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c17 -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -mtune=generic -ffile-prefix-map=/builddir/zathura-0.5.8/build=. -pthread '-DGETTEXT_PACKAGE="zathura"' '-DLOCALEDIR="/usr/share/locale"' '-DZATHURA_PLUGINDIR="/usr/lib64/zathura"' -D_DEFAULT_SOURCE -DWITH_SYNCTEX -DWITH_SANDBOX -DWITH_SECCOMP -DWITH_LANDLOCK -Werror=implicit-function-declaration -Werror=vla -fvisibility=hidden -Werror=int-conversion -MD -MQ zathura-sandbox.p/zathura_landlock.c.o -MF zathura-sandbox.p/zathura_landlock.c.o.d -o zathura-sandbox.p/zathura_landlock.c.o -c ../zathura/landlock.c
../zathura/landlock.c: In function 'landlock_create_ruleset':
../zathura/landlock.c:17:18: error: '__NR_landlock_create_ruleset' undeclared (first use in this function); did you mean 'landlock_create_ruleset'?
   17 |   return syscall(__NR_landlock_create_ruleset, attr, size, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_create_ruleset
../zathura/landlock.c:17:18: note: each undeclared identifier is reported only once for each function it appears in
../zathura/landlock.c: In function 'landlock_add_rule':
../zathura/landlock.c:24:18: error: '__NR_landlock_add_rule' undeclared (first use in this function); did you mean 'landlock_add_rule'?
   24 |   return syscall(__NR_landlock_add_rule, ruleset_fd, rule_type, rule_attr, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_add_rule
../zathura/landlock.c: In function 'landlock_restrict_self':
../zathura/landlock.c:30:18: error: '__NR_landlock_restrict_self' undeclared (first use in this function); did you mean 'landlock_restrict_self'?
   30 |   return syscall(__NR_landlock_restrict_self, ruleset_fd, flags);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  landlock_restrict_self
../zathura/landlock.c: In function 'landlock_create_ruleset':
../zathura/landlock.c:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
../zathura/landlock.c: In function 'landlock_restrict_self':
../zathura/landlock.c:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
../zathura/landlock.c: In function 'landlock_add_rule':
../zathura/landlock.c:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
[95/104] Compiling C object libzathura-sandbox.a.p/zathura_utils.c.o
[96/104] Compiling C object libzathura-sandbox.a.p/zathura_seccomp-filters.c.o
[97/104] Compiling C object libzathura-sandbox.a.p/zathura_zathura.c.o
[98/104] Compiling C object zathura-sandbox.p/zathura_main-sandbox.c.o
[99/104] Compiling C object zathura-sandbox.p/zathura_seccomp-filters.c.o
[100/104] Compiling C object zathura.p/zathura_main.c.o
[101/104] Generating doc/man pages with a custom command
Running Sphinx v7.2.6
building [mo]: targets for 0 po files that are out of date
writing output... 
building [man]: all manpages
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] zathura.1
reading sources... [100%] zathurarc.5
looking for now-outdated files... none found
pickling environment... done
checking consistency... /builddir/zathura-0.5.8/doc/man/zathurarc.5.rst: WARNING: document isn't included in any toctree
done
writing... zathura.1 { } zathurarc.5 { } done
build succeeded, 1 warning.

The manual pages are in doc.
ninja: build stopped: subcommand failed.
�[1m�[31m=> ERROR: zathura-0.5.8_1: do_build: '${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}' exited with 1
�[m�[1m�[31m=> ERROR:   in do_build() at common/build-style/meson.sh:50
�[m

@valoq Could you take a look at that?

Hello @biopsin

can you please share your kernel version and used distribution? If you have taken any extra configuration steps to use musl that would also help to identify the issue.

At a first glance I suspect there are some kernel header files missing, at least that used to give me the same error a few years ago before landlock was automatically added. Perhaps you find a package for your distro called something like linux-api-headers that you could try.

As a general note: Support for Musl is not well tested at the moment, especially the seccomp filter would need some work.
In case this continues to give you issues, you can disable these features by using -Dseccomp=disabled and
-Dlandlock=disabled

Hi @valoq
Thank you for your time.
I am building on voidlinux using Linux 5.10.222_1 #1 SMP Fri Jul 19 13:28:20 UTC 2024 x86_64 GNU/Linux,
however the buildsystem is inside a container and sets up the crossbuild enviroment.
Link to template

If I pass -Dlandlock=disabled while crossbuild it builds successfull

I am building on voidlinux using `Linux 5.10.222_1

That would explain the error since landlock is only available starting with Linux 5.13

@sebastinas I had tried to add a kernel version check here but I didn't find an easy to use option for meson. Are you aware of a simple check for the kernel version to add as a condition to landlock? Otherwise I would tend towards leaving this as is since not many users will run the current version of zathura on 3+ year old kernels.

Hm thats odd as I can build v.0.5.6 without issue prior to the refactor of landlock.h/c , but configure and build show no landlock enable or disable when crosscompile x86_64-musl

configure log
The Meson build system
Version: 1.4.0
Source dir: /builddir/zathura-0.5.6
Build dir: /builddir/zathura-0.5.6/build
Build type: cross build
Project name: zathura
Project version: 0.5.6
C compiler for the host machine: x86_64-linux-musl-gcc (gcc 13.2.0 "x86_64-linux-musl-gcc (GCC) 13.2.0")
C linker for the host machine: x86_64-linux-musl-gcc ld.bfd 2.41
C compiler for the build machine: cc (gcc 13.2.0 "cc (GCC) 13.2.0")
C linker for the build machine: cc ld.bfd 2.41
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library m found: YES
Found pkg-config: YES (/builddir/.xbps-zathura/wrappers/x86_64-linux-musl-pkg-config) 0.29.2
Run-time dependency girara-gtk3 found: YES 0.4.4
Run-time dependency glib-2.0 found: YES 2.80.3
Run-time dependency gio-unix-2.0 found: YES 2.80.3
Run-time dependency gthread-2.0 found: YES 2.80.3
Run-time dependency gmodule-no-export-2.0 found: YES 2.80.3
Run-time dependency gtk+-3.0 found: YES 3.24.42
Run-time dependency json-glib-1.0 found: YES 1.9.2
Run-time dependency cairo found: YES 1.18.0
Library magic found: YES
Run-time dependency sqlite3 found: YES 3.45.3
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Werror=vla: YES 
Compiler for C supports arguments -fvisibility=hidden: YES 
Compiler for C supports arguments -Werror=int-conversion: YES 
Run-time dependency synctex found: YES 2.0.0
Run-time dependency libseccomp found: YES 2.5.5
Configuring zathura-version.h using configuration
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
Build-time dependency gio-2.0 found: YES 2.80.3
Program /usr/bin/glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program rsvg-convert found: YES (/usr/bin/rsvg-convert)
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate skipped: feature tests disabled
Program appstream-util skipped: feature tests disabled
Configuring zathura using configuration
Configuring _zathura using configuration
Configuring zathura.fish using configuration
Found CMake: NO
Run-time dependency bash-completion found: NO (tried pkgconfig and cmake)
Run-time dependency fish found: NO (tried pkgconfig and cmake)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Program sphinx-build found: YES (/usr/bin/sphinx-build)
Dependency check skipped: feature tests disabled
Build targets in project: 39

zathura 0.5.6

  User defined options
    Cross files   : /builddir/.xbps-zathura/wrappers/meson/xbps_meson.cross
    auto_features : auto
    bindir        : /usr/bin
    buildtype     : plain
    datadir       : /usr/share
    includedir    : /usr/include
    infodir       : /usr/share/info
    libdir        : /usr/lib64
    libexecdir    : /usr/libexec
    localedir     : /usr/share/locale
    localstatedir : /var
    mandir        : /usr/share/man
    prefix        : /usr
    sbindir       : /usr/bin
    sharedstatedir: /var/lib
    sysconfdir    : /etc
    wrap_mode     : nodownload
    b_lto         : true
    b_ndebug      : true
    b_staticpic   : true
    synctex       : enabled
    tests         : disabled

Found ninja-1.11.1 at /usr/bin/ninja
build log
ninja: Entering directory `build'
[1/68] Generating data/resources_c with a custom command
[2/68] Generating data/resources_h with a custom command
[3/68] Building translation po/cs/LC_MESSAGES/zathura-cs.mo
[4/68] Building translation po/de/LC_MESSAGES/zathura-de.mo
[5/68] Building translation po/es/LC_MESSAGES/zathura-es.mo
[6/68] Building translation po/ar/LC_MESSAGES/zathura-ar.mo
[7/68] Building translation po/ca/LC_MESSAGES/zathura-ca.mo
[8/68] Generating data/icon-128/org.pwmt.zathura_128.png with a custom command
[9/68] Building translation po/es_CL/LC_MESSAGES/zathura-es_CL.mo
[10/68] Building translation po/el/LC_MESSAGES/zathura-el.mo
[11/68] Building translation po/eo/LC_MESSAGES/zathura-eo.mo
[12/68] Generating data/icon-16/org.pwmt.zathura_16.png with a custom command
[13/68] Generating data/icon-64/org.pwmt.zathura_64.png with a custom command
[14/68] Building translation po/hr/LC_MESSAGES/zathura-hr.mo
[15/68] Building translation po/fr/LC_MESSAGES/zathura-fr.mo
[16/68] Generating data/icon-32/org.pwmt.zathura_32.png with a custom command
[17/68] Building translation po/et/LC_MESSAGES/zathura-et.mo
[18/68] Building translation po/no/LC_MESSAGES/zathura-no.mo
[19/68] Building translation po/pl/LC_MESSAGES/zathura-pl.mo
[20/68] Building translation po/pt_BR/LC_MESSAGES/zathura-pt_BR.mo
[21/68] Building translation po/he/LC_MESSAGES/zathura-he.mo
[22/68] Building translation po/sv/LC_MESSAGES/zathura-sv.mo
[23/68] Generating data/icon-256/org.pwmt.zathura_256.png with a custom command
[24/68] Building translation po/it/LC_MESSAGES/zathura-it.mo
[25/68] Building translation po/id_ID/LC_MESSAGES/zathura-id_ID.mo
[26/68] Building translation po/lt/LC_MESSAGES/zathura-lt.mo
[27/68] Building translation po/ru/LC_MESSAGES/zathura-ru.mo
[28/68] Building translation po/nl/LC_MESSAGES/zathura-nl.mo
[29/68] Building translation po/uk_UA/LC_MESSAGES/zathura-uk_UA.mo
[30/68] Building translation po/ta_IN/LC_MESSAGES/zathura-ta_IN.mo
[31/68] Building translation po/tr/LC_MESSAGES/zathura-tr.mo
[32/68] Compiling C object libzathura.a.p/zathura_checked-integer-arithmetic.c.o
[33/68] Merging translations for data/org.pwmt.zathura.desktop
[34/68] Merging translations for data/org.pwmt.zathura.appdata.xml
[35/68] Compiling C object libzathura.a.p/meson-generated_.._data_resources.c.o
[36/68] Compiling C object libzathura.a.p/zathura_content-type.c.o
[37/68] Compiling C object libzathura.a.p/zathura_file-monitor.c.o
[38/68] Compiling C object libzathura.a.p/zathura_adjustment.c.o
[39/68] Compiling C object libzathura.a.p/zathura_file-monitor-noop.c.o
[40/68] Compiling C object libzathura.a.p/zathura_completion.c.o
[41/68] Compiling C object libzathura.a.p/zathura_file-monitor-glib.c.o
[42/68] Compiling C object libzathura.a.p/zathura_bookmarks.c.o
[43/68] Compiling C object libzathura.a.p/zathura_file-monitor-signal.c.o
[44/68] Compiling C object libzathura.a.p/zathura_database.c.o
[45/68] Compiling C object libzathura.a.p/zathura_config.c.o
[46/68] Compiling C object libzathura.a.p/zathura_dbus-interface.c.o
[47/68] Compiling C object libzathura.a.p/zathura_commands.c.o
[48/68] Compiling C object libzathura.a.p/zathura_callbacks.c.o
[49/68] Compiling C object libzathura.a.p/zathura_database-sqlite.c.o
[50/68] Compiling C object libzathura.a.p/zathura_document.c.o
[51/68] Compiling C object libzathura.a.p/zathura_jumplist.c.o
[52/68] Compiling C object libzathura.a.p/zathura_marks.c.o
[53/68] Compiling C object libzathura.a.p/zathura_links.c.o
[54/68] Compiling C object libzathura.a.p/zathura_page.c.o
[55/68] Compiling C object libzathura.a.p/zathura_plugin.c.o
[56/68] Compiling C object libzathura.a.p/zathura_types.c.o
[57/68] Compiling C object libzathura.a.p/zathura_shortcuts.c.o
[58/68] Compiling C object libzathura.a.p/zathura_page-widget.c.o
[59/68] Compiling C object libzathura.a.p/zathura_synctex.c.o
[60/68] Compiling C object libzathura.a.p/zathura_render.c.o
[61/68] Compiling C object libzathura.a.p/zathura_print.c.o
[62/68] Compiling C object libzathura.a.p/zathura_utils.c.o
[63/68] Compiling C object libzathura.a.p/zathura_zathura.c.o
[64/68] Compiling C object libzathura.a.p/zathura_seccomp-filters.c.o
[65/68] Linking static target libzathura.a
[66/68] Compiling C object zathura.p/zathura_main.c.o
[67/68] Generating doc/man pages with a custom command
Running Sphinx v7.2.6
building [mo]: targets for 0 po files that are out of date
writing output... 
building [man]: all manpages
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] zathura.1
reading sources... [100%] zathurarc.5
looking for now-outdated files... none found
pickling environment... done
checking consistency... /builddir/zathura-0.5.6/doc/man/zathurarc.5.rst: WARNING: document isn't included in any toctree
done
writing... zathura.1 { } zathurarc.5 { } done
build succeeded, 1 warning.

The manual pages are in doc.
[68/68] Linking target zathura

@biopsin 0.5.6 did not have landlock support.

I am building on voidlinux using `Linux 5.10.222_1

That would explain the error since landlock is only available starting with Linux 5.13

@sebastinas I had tried to add a kernel version check here but I didn't find an easy to use option for meson. Are you aware of a simple check for the kernel version to add as a condition to landlock? Otherwise I would tend towards leaving this as is since not many users will run the current version of zathura on 3+ year old kernels.

How is the availability of the header detected then? Was there a landlock.h before linux 5.13?

How is the availability of the header detected then? Was there a landlock.h before linux 5.13?

The header should be installed as part of the kernel >= 5.13 but after a quick test on debian trixie, it seems like it gets installed by a different package that appears to be part of the build-essential group. I installed a kernel 5.10 on trixie and remove the current kernel, but the landlock.h file remained until I removed the entire libc package and its dependencies. With landlock.h gone zathura correctly disables landlock, but if someone compiles zathura on a system that includes landlock.h even though its running an older kernel, it will be enabled. Which does not seem to be an issue (at least on debian) for some reason since zathura-sandbox runs just fine on linux 5.10 even with landlock compiled in. One issue though is the lack of a warning that landlock is not available while running on that kernel version, but I will add that later.
To me it looks like a strange edge case of newer kernel header files being available on a system with an older kernel, which is the case when you compile inside a container.

this is probably just because void's musl is old, the macros are defined in newer musl: https://git.musl-libc.org/cgit/musl/tree/arch/x86_64/bits/syscall.h.in#n355

this can/should probably be fixed on void's side

this is probably just because void's musl is old, the macros are defined in newer musl: https://git.musl-libc.org/cgit/musl/tree/arch/x86_64/bits/syscall.h.in#n355

That would explain a lot actually. I had assumed that the landlock header comes with the specific kernel as it used to be the case but if the header comes via libc, then landlock will always be enabled as long as the libc version supports it. As long as older kernels run zathura-sandbox just fine even with landlock compiled in, this shouldn't be an issue. A warning on kernels without landlock support should be added though, I will look into that.

Resolved downstream. I exuse the detoure, but thank you for the help.