]> git.ipfire.org Git - thirdparty/lxc.git/commit
build: use cc.get_define to detect FS_CONFIG_* symbols
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 01:50:41 +0000 (12:50 +1100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 16 Dec 2022 16:42:22 +0000 (11:42 -0500)
commita330126b45c7c3b6fcf0f9ba6c1eda7bdb4e508a
treea51c5629dda1c9a6df0cc616a1876ea633a8913b
parentc89be8325d767774879187a97402d8b2074933ed
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 <cyphar@cyphar.com>
meson.build