[PR #7109] [MERGED] build: fix empty lists in syscall.c breaking compilation #6320

Closed
opened 2026-05-05 10:54:43 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/7109
Author: @kmk3
Created: 3/17/2026
Status: Merged
Merged: 3/20/2026
Merged by: @kmk3

Base: masterHead: fix-syscall-empty-lists


📝 Commits (1)

  • 5318a1c build: fix empty lists in syscall.c breaking compilation

📊 Changes

1 file changed (+72 additions, -44 deletions)

View changed files

📝 src/lib/syscall.c (+72 -44)

📄 Description

If no syscalls are defined (such as with an older kernel) inside of a
.list element, then compilation breaks due to a syntax error:

  .list =
},

For example, SYS_memfd_create and SYS_memfd_secret are apparently
not defined on Linux 3.8, which is used on 32-bit x86 Chromebooks:

$ make clean >/dev/null && make CFLAGS+='-march=i686 -m32'
[...]
gcc -ggdb -O2 -DVERSION='"0.9.81"' [...] -march=i686 -m32 -c ../../src/lib/syscall.c -o ../../src/lib/syscall.o
../../src/lib/syscall.c:907:9: error: expected expression before ‘}’ token
  907 |         },
      |         ^
make[1]: *** [../../src/prog.mk:25: ../../src/lib/syscall.o] Error 1

Also, syscall lists cannot be empty (""), so ensure that
__dummy_syscall__ appears in every list as the last element for
simplicity.

This makes every non-dummy syscall string in the source code end with
, (including the last item, which makes sorting them easier) and
removes the need for checking all syscall macros in each list before
adding __dummy_syscall__.

Related commits:

  • 34ee8e03f ("Seccomp: system call grouping and call numbers",
    2017-08-06)
  • 88a75a650 ("add a new option --debug-syscall-groups - part 1",
    2026-01-31) / PR #7049
  • a3f352521 ("update system call groups - part 3", 2026-01-18) / PR
    #7034

Fixes #7108.

Reported-by: @Zopolis4
Cc: @topimiettinen
Cc: @pierretom


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/7109 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 3/17/2026 **Status:** ✅ Merged **Merged:** 3/20/2026 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `fix-syscall-empty-lists` --- ### 📝 Commits (1) - [`5318a1c`](https://github.com/netblue30/firejail/commit/5318a1cb62877b214401cae36bd1e1eb8000ae6c) build: fix empty lists in syscall.c breaking compilation ### 📊 Changes **1 file changed** (+72 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/syscall.c` (+72 -44) </details> ### 📄 Description If no syscalls are defined (such as with an older kernel) inside of a `.list` element, then compilation breaks due to a syntax error: .list = }, For example, `SYS_memfd_create` and `SYS_memfd_secret` are apparently not defined on Linux 3.8, which is used on 32-bit x86 Chromebooks: $ make clean >/dev/null && make CFLAGS+='-march=i686 -m32' [...] gcc -ggdb -O2 -DVERSION='"0.9.81"' [...] -march=i686 -m32 -c ../../src/lib/syscall.c -o ../../src/lib/syscall.o ../../src/lib/syscall.c:907:9: error: expected expression before ‘}’ token 907 | }, | ^ make[1]: *** [../../src/prog.mk:25: ../../src/lib/syscall.o] Error 1 Also, syscall lists cannot be empty (`""`), so ensure that `__dummy_syscall__` appears in every list as the last element for simplicity. This makes every non-dummy syscall string in the source code end with `,` (including the last item, which makes sorting them easier) and removes the need for checking all syscall macros in each list before adding `__dummy_syscall__`. Related commits: * 34ee8e03f ("Seccomp: system call grouping and call numbers", 2017-08-06) * 88a75a650 ("add a new option `--debug-syscall-groups` - part 1", 2026-01-31) / PR #7049 * a3f352521 ("update system call groups - part 3", 2026-01-18) / PR #7034 Fixes #7108. Reported-by: @Zopolis4 Cc: @topimiettinen Cc: @pierretom --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:54:43 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#6320
No description provided.