Skip to contentSkip to conversation

lxc: fix compile failure on gcc10

PATCH In review hongxu 2 participants 2 messages May 19, 2020

lore
Share & tools
lore

hongxu

author
#0 lore raw

PATCH 1/1 lxc: fix compile failure on gcc10

Since oe-core is upgrading gcc to 10.1, there is
a compile failure
...
|../../../lxc-4.0.2/src/lxc/cgroups/cgfsng.c:2100:10: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
| 2100 | *slash = '\0';
...

Add gcc option `-Werror=stringop-overflow' to workaround the issue

---
 recipes-containers/lxc/lxc_4.0.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_4.0.2.bb +1 -1
index 441cf96..d0ead81 100644
@@ -67,7 +67,7 @@ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
 
 EXTRA_OECONF += "--enable-log-src-basename"
 
-CFLAGS_append = " -Wno-error=deprecated-declarations"
+CFLAGS_append = " -Wno-error=deprecated-declarations -Wno-error=stringop-overflow"
 
 PACKAGECONFIG ??= "templates \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
Signature · 1 line
2.21.0
#1 lore raw

merged

Bruce

In message: [meta-virtualization][PATCH] lxc: fix compile failure on gcc10

Quoted 33 lines · on 19/05/2020 hongxu wrote:

Since oe-core is upgrading gcc to 10.1, there is
a compile failure
...
|../../../lxc-4.0.2/src/lxc/cgroups/cgfsng.c:2100:10: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
| 2100 | *slash = '\0';
...

Add gcc option `-Werror=stringop-overflow' to workaround the issue

---
 recipes-containers/lxc/lxc_4.0.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_4.0.2.bb +1 -1
index 441cf96..d0ead81 100644
@@ -67,7 +67,7 @@ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
 
 EXTRA_OECONF += "--enable-log-src-basename"
 
-CFLAGS_append = " -Wno-error=deprecated-declarations"
+CFLAGS_append = " -Wno-error=deprecated-declarations -Wno-error=stringop-overflow"
 
 PACKAGECONFIG ??= "templates \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
Signature · 1 line
2.21.0