Build on older systems - #786
Merged
Merged
Conversation
Fix building with older compilers that do not default to C99 or newer, resulting in errors like the following: ----------------------------------------------------------------------- In file included from ../bind-mount.c:24:0: ../utils.h: In function ‘cleanup_fdsetp’: ../utils.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < set->len; i++) ----------------------------------------------------------------------- This was the only occurrence of initial declarations in for loops, so the change also realigns the code style to what is used for the rest of the project. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
smcv
requested changes
Sep 7, 2026
smcv
left a comment
Collaborator
There was a problem hiding this comment.
Generally looks good to me, some minor issues around __NR_pivot_root.
Fix compilation warnings about `-Wunused-parameter` in
`mount_setattr_wrapper` when building on older systems that do not have
`__NR_mount_setattr`:
-----------------------------------------------------------------------
../utils.c: In function ‘mount_setattr_wrapper’:
../utils.c:1101:28: warning: unused parameter ‘dirfd’ [-Wunused-parameter]
mount_setattr_wrapper (int dirfd, const char *path, unsigned int flags,
^
../utils.c:1101:47: warning: unused parameter ‘path’ [-Wunused-parameter]
mount_setattr_wrapper (int dirfd, const char *path, unsigned int flags,
^
../utils.c:1101:66: warning: unused parameter ‘flags’ [-Wunused-parameter]
mount_setattr_wrapper (int dirfd, const char *path, unsigned int flags,
^
../utils.c:1102:43: warning: unused parameter ‘attr’ [-Wunused-parameter]
struct mount_attr *attr, size_t size)
^
../utils.c:1102:56: warning: unused parameter ‘size’ [-Wunused-parameter]
struct mount_attr *attr, size_t size)
^
-----------------------------------------------------------------------
And while at it also fix potential similar issues in `pivot_root` on
systems that do no have `__NR_pivot_root`.
Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
On some old systems it's possible that `__u64` has not been defined already when the fallback type for `mount_attr` is declared. So make sure `__u64` is defined by including `linux/types.h` explicitly. On systems where the file has been included already this causes no harm because the file should also have `#ifndef _LINUX_TYPES_H` protection guards. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
ao2
force-pushed
the
build-on-older-systems
branch
from
September 7, 2026 16:05
1df4ae3 to
a6ebe83
Compare
smcv
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix building bubblewrap on some older systems, like for example the SDK from https://gitlab.steamos.cloud/steamrt/scout/sdk
cc @smcv