Skip to contentSkip to conversation

libvirt: fix build with glibc-2.36

PATCH In review [email protected] 2 participants 2 messages Aug 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvirt: fix build with glibc-2.36

From: Kai Kang <[email protected]>

add only necessary definitions from linux/fs.h, because including whole causes conflicts with sys/mount.h:

| In file included from /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/fs.h:19,
|                  from ../libvirt-8.1.0/src/util/virfile.c:74:
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
|    95 | enum fsconfig_command {
|       |      ^~~~~~~~~~~~~~~~
| In file included from ../libvirt-8.1.0/src/util/virfile.c:46:
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/sys/mount.h:189:6: note: originally defined here
|   189 | enum fsconfig_command
|       |      ^~~~~~~~~~~~~~~~
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
|    96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
|       |         ^~~~~~~~~~~~~~~~~
---
 .../0002-fix-build-with-glibc-2.36.patch      | 61 +++++++++++++++++++
 recipes-extended/libvirt/libvirt_8.1.0.bb     |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 recipes-extended/libvirt/libvirt/0002-fix-build-with-glibc-2.36.patch
recipes-extended/libvirt/libvirt/0002-fix-build-with-glibc-2.36.patch new file +61 -0
new file mode 100644
index 0000000..bd7e59f
@@ -0,0 +1,61 @@
+libvirt: fix build with glibc-2.36
+
+add only necessary definitions from linux/fs.h, because including whole
+causes conflicts with sys/mount.h:
+
+| In file included from /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/fs.h:19,
+|                  from ../libvirt-8.1.0/src/util/virfile.c:74:
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+|    95 | enum fsconfig_command {
+|       |      ^~~~~~~~~~~~~~~~
+| In file included from ../libvirt-8.1.0/src/util/virfile.c:46:
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/sys/mount.h:189:6: note: originally defined here
+|   189 | enum fsconfig_command
+|       |      ^~~~~~~~~~~~~~~~
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+|    96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+|       |         ^~~~~~~~~~~~~~~~~
+
+...
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ src/lxc/lxc_container.c |  1 -
+ src/util/virfile.c      | 10 +++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index d5410e9..3f49fb8 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -34,7 +34,6 @@
+ #include <linux/unistd.h>
+ 
+ /* For MS_MOVE */
+-#include <linux/fs.h>
+ 
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index a04f888..1cf118d 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,15 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++// #include <linux/fs.h>       /* FIGETBSZ, FIBMAP, FS_IOC_* */
++// linux/fs.h unfortunately causes conflict with sys/mount.h since glibc-2.36
++// https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
++// add the necessary definitions
++
++#define FS_IOC_GETFLAGS                 _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                 _IOW('f', 2, long)
++#define FS_NOCOW_FL                     0x00800000 /* Do not cow file */
++
+ #endif
+ 
+ #if WITH_LIBATTR
recipes-extended/libvirt/libvirt_8.1.0.bb +1 -0
index 89f82bf..20e2e98 100644
@@ -29,6 +29,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
            file://hook_support.py \
            file://gnutls-helper.py \
            file://0001-qemu-segmentation-fault-in-virtqemud-executing-qemuD.patch \
+           file://0002-fix-build-with-glibc-2.36.patch \
           "
 
 SRC_URI[libvirt.sha256sum] = "3c6c43becffeb34a3f397c616206aa69a893ff8bf5e8208393c84e8e75352934"
Signature · 1 line
2.17.1
#1 lore raw

you wanna wait for the latest glibc patch I have sent to oe-core

https://lists.openembedded.org/g/openembedded-core/message/169820

this patch won't be needed. Infact test it out if you can.

Quoted 117 lines · kai

From: Kai Kang <[email protected]>

add only necessary definitions from linux/fs.h, because including whole causes conflicts with sys/mount.h:

| In file included from /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/fs.h:19,
|                  from ../libvirt-8.1.0/src/util/virfile.c:74:
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
|    95 | enum fsconfig_command {
|       |      ^~~~~~~~~~~~~~~~
| In file included from ../libvirt-8.1.0/src/util/virfile.c:46:
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/sys/mount.h:189:6: note: originally defined here
|   189 | enum fsconfig_command
|       |      ^~~~~~~~~~~~~~~~
| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
|    96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
|       |         ^~~~~~~~~~~~~~~~~
---
 .../0002-fix-build-with-glibc-2.36.patch      | 61 +++++++++++++++++++
 recipes-extended/libvirt/libvirt_8.1.0.bb     |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 recipes-extended/libvirt/libvirt/0002-fix-build-with-glibc-2.36.patch
recipes-extended/libvirt/libvirt/0002-fix-build-with-glibc-2.36.patch new file +61 -0
new file mode 100644
index 0000000..bd7e59f
@@ -0,0 +1,61 @@
+libvirt: fix build with glibc-2.36
+
+add only necessary definitions from linux/fs.h, because including whole
+causes conflicts with sys/mount.h:
+
+| In file included from /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/fs.h:19,
+|                  from ../libvirt-8.1.0/src/util/virfile.c:74:
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+|    95 | enum fsconfig_command {
+|       |      ^~~~~~~~~~~~~~~~
+| In file included from ../libvirt-8.1.0/src/util/virfile.c:46:
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/sys/mount.h:189:6: note: originally defined here
+|   189 | enum fsconfig_command
+|       |      ^~~~~~~~~~~~~~~~
+| /path/to/tmp-glibc/work/core2-32-wrs-linux/libvirt/8.1.0-r0/recipe-sysroot/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+|    96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+|       |         ^~~~~~~~~~~~~~~~~
+
+...
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ src/lxc/lxc_container.c |  1 -
+ src/util/virfile.c      | 10 +++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index d5410e9..3f49fb8 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -34,7 +34,6 @@
+ #include <linux/unistd.h>
+
+ /* For MS_MOVE */
+-#include <linux/fs.h>
+
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index a04f888..1cf118d 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,15 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++// #include <linux/fs.h>       /* FIGETBSZ, FIBMAP, FS_IOC_* */
++// linux/fs.h unfortunately causes conflict with sys/mount.h since glibc-2.36
++// https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
++// add the necessary definitions
++
++#define FS_IOC_GETFLAGS                 _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                 _IOW('f', 2, long)
++#define FS_NOCOW_FL                     0x00800000 /* Do not cow file */
++
+ #endif
+
+ #if WITH_LIBATTR
recipes-extended/libvirt/libvirt_8.1.0.bb +1 -1
index 89f82bf..20e2e98 100644
@@ -29,6 +29,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
            file://hook_support.py \
            file://gnutls-helper.py \
            file://0001-qemu-segmentation-fault-in-virtqemud-executing-qemuD.patch \
+           file://0002-fix-build-with-glibc-2.36.patch \
           "
 
 SRC_URI[libvirt.sha256sum] = "3c6c43becffeb34a3f397c616206aa69a893ff8bf5e8208393c84e8e75352934"
--

2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7560): https://lists.yoctoproject.org/g/meta-virtualization/message/7560
Mute This Topic: https://lists.yoctoproject.org/mt/93242053/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-