[lxc/lxc] bc3189: cgroups: fix -Waddress warning

0 views
Skip to first unread message

Christian Brauner

unread,
Nov 22, 2022, 10:08:04 AM11/22/22
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/master
Home: https://github.com/lxc/lxc
Commit: bc318926d701befde030b77948c343bb337b0713
https://github.com/lxc/lxc/commit/bc318926d701befde030b77948c343bb337b0713
Author: Aleksa Sarai <cyp...@cyphar.com>
Date: 2022-10-31 (Mon, 31 Oct 2022)

Changed paths:
M src/lxc/cgroups/cgfsng.c

Log Message:
-----------
cgroups: fix -Waddress warning

While in principle the pointer could overflow, GCC 12 considers this to
not be possible and issues the following warning:

../src/lxc/cgroups/cgfsng.c: In function ‘__cgfsng_delegate_controllers’:
../src/lxc/cgroups/cgfsng.c:3306:21: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘it + 8’ must not be NULL [-Waddress]
3306 | if ((it + 1) && *(it + 1))
| ^

This removes the only build warning triggered when building on openSUSE.

Signed-off-by: Aleksa Sarai <cyp...@cyphar.com>


Commit: c1f87c8113a896fc0fd27f3f941bc7f3fa2754e5
https://github.com/lxc/lxc/commit/c1f87c8113a896fc0fd27f3f941bc7f3fa2754e5
Author: Aleksa Sarai <cyp...@cyphar.com>
Date: 2022-10-31 (Mon, 31 Oct 2022)

Changed paths:
M meson.build
M src/lxc/cmd/meson.build
M src/lxc/meson.build

Log Message:
-----------
build: fix handling of dependancies to fix build on openSUSE

Among other things, openSUSE places seccomp.h inside a non-default
include directory (/usr/include/seccomp/seccomp.h) which revealed
several issues with how dependencies were being handled previously.

The most notable issue is that the include cflags of our build
dependencies were not being provided to the recipes for static
executables (yet they still expected access to the dependency headers).

This also involved a minor cleanup of how these dependencies are
collected, and added liburing to the set of private pkg-config libs
(which I assume was an oversight?).

Signed-off-by: Aleksa Sarai <cyp...@cyphar.com>


Commit: 5aff4ea371352a230ab2c5ad8edd2e0dd736ee39
https://github.com/lxc/lxc/commit/5aff4ea371352a230ab2c5ad8edd2e0dd736ee39
Author: Aleksa Sarai <cyp...@cyphar.com>
Date: 2022-10-31 (Mon, 31 Oct 2022)

Changed paths:
M meson.build
M src/lxc/cmd/meson.build

Log Message:
-----------
build: only build init.lxc.static if libcap is statically linkable

Without setting this, the default build will fail if you don't have the
static libcap library installed (on openSUSE this is packaged separately
to libcap-devel).

Signed-off-by: Aleksa Sarai <cyp...@cyphar.com>


Commit: f321cd610ad8bfc65fbae7a869db12933fb71b46
https://github.com/lxc/lxc/commit/f321cd610ad8bfc65fbae7a869db12933fb71b46
Author: Aleksa Sarai <cyp...@cyphar.com>
Date: 2022-10-31 (Mon, 31 Oct 2022)

Changed paths:
M meson.build

Log Message:
-----------
build: use cc.get_define to detect FS_CONFIG_* symbols

For some reason, openSUSE has a very strange layout in sys/mount.h where
the definition of all of the FS_CONFIG_* idents are present but are
ifdef'd out in such a way that they will never be defined in an actual
build:

#define FSOPEN_CLOEXEC 0x00000001
/* ... */
#ifndef FSOPEN_CLOEXEC
enum fsconfig_command
{
FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
/* ... */
};
#endif

Unfortunately, while cc.has_header_symbol is faster, it cannot handle
this which results in compilation errors on openSUSE because the
FS_CONFIG_* symbols are actually not defined when compiling even though
the ident is present in the header. Switching to cc.get_define fixes
this issue.

Fixes: cbabe8abf11e ("build: check for FS_CONFIG_* header symbol in sys/mount.h")
Signed-off-by: Aleksa Sarai <cyp...@cyphar.com>


Commit: c6c705bfa30a4a3388c29f51025092c090f725b8
https://github.com/lxc/lxc/commit/c6c705bfa30a4a3388c29f51025092c090f725b8
Author: Aleksa Sarai <cyp...@cyphar.com>
Date: 2022-10-31 (Mon, 31 Oct 2022)

Changed paths:
M config/init/systemd/meson.build
M meson_options.txt

Log Message:
-----------
build: drop build-time systemd dependency

On openSUSE, our packages are build in the Open Build Service which does
not have a proper systemd installation that you can query to get the
systemdunitdir.

The simplest solution is to re-add the ability to explicitly set the
systemdunitdir (as was previously possible with the autotools build
system in pre-5.0 LXC).

Signed-off-by: Aleksa Sarai <cyp...@cyphar.com>


Commit: cafced2a3f91f1dd11b8c00ca83fef19633112b1
https://github.com/lxc/lxc/commit/cafced2a3f91f1dd11b8c00ca83fef19633112b1
Author: Christian Brauner <chri...@brauner.io>
Date: 2022-11-22 (Tue, 22 Nov 2022)

Changed paths:
M config/init/systemd/meson.build
M meson.build
M meson_options.txt
M src/lxc/cgroups/cgfsng.c
M src/lxc/cmd/meson.build
M src/lxc/meson.build

Log Message:
-----------
Merge pull request #4214 from cyphar/opensuse-build

build: fix build issues on openSUSE


Compare: https://github.com/lxc/lxc/compare/cf9474fab679...cafced2a3f91
Reply all
Reply to author
Forward
0 new messages