All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Alexander Kanavin <alex@linutronix.de>
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH] xen-tools: fix python 3.12 build errors
Date: Mon, 4 Dec 2023 22:20:07 +0000	[thread overview]
Message-ID: <ZW5Qlwe6CIaegBaS@gmail.com> (raw)
In-Reply-To: <20231128175003.3883327-1-alex@linutronix.de>

Thanks for the fix!

this is now merged.

Bruce

In message: [meta-virtualization][PATCH] xen-tools: fix python 3.12 build errors
on 28/11/2023 Alexander Kanavin wrote:

> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  ...mk-drop-Wdeclaration-after-statement.patch | 42 +++++++++++++++++++
>  recipes-extended/xen/xen-tools_4.17.bb        | 10 ++---
>  2 files changed, 47 insertions(+), 5 deletions(-)
>  create mode 100644 recipes-extended/xen/files/0001-Config.mk-drop-Wdeclaration-after-statement.patch
> 
> diff --git a/recipes-extended/xen/files/0001-Config.mk-drop-Wdeclaration-after-statement.patch b/recipes-extended/xen/files/0001-Config.mk-drop-Wdeclaration-after-statement.patch
> new file mode 100644
> index 00000000..dcfffb06
> --- /dev/null
> +++ b/recipes-extended/xen/files/0001-Config.mk-drop-Wdeclaration-after-statement.patch
> @@ -0,0 +1,42 @@
> +From 70e8b986fe78f5fbd1dfdef4f02ea9b50c7158db Mon Sep 17 00:00:00 2001
> +From: Alexander Kanavin <alex@linutronix.de>
> +Date: Tue, 28 Nov 2023 18:34:17 +0100
> +Subject: [PATCH] Config.mk: drop -Wdeclaration-after-statement
> +
> +Such constructs are fully allowed by C99:
> +https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Mixed-Labels-and-Declarations.html#Mixed-Labels-and-Declarations
> +
> +If the flag is present, then building against python 3.12 will fail thusly:
> +
> +| In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:44,
> +|                  from xen/lowlevel/xc/xc.c:8:
> +| /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h: In function 'Py_SIZE':
> +| /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
> +|   233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);
> +|       |     ^~~~~~~~~~~
> +| In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:53:
> +| /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h: In function '_PyLong_CompactValue':
> +| /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h:121:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
> +|   121 |     Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
> +|       |     ^~~~~~~~~~
> +| cc1: all warnings being treated as errors
> +
> +Upstream-Status: Submitted [by email to xen-devel@lists.xenproject.org and maintainers printed by get_maintainer.pl]
> +Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> +---
> + Config.mk | 2 --
> + 1 file changed, 2 deletions(-)
> +
> +diff --git a/Config.mk b/Config.mk
> +index 8bc2bcd5f6..09d5e8ebde 100644
> +--- a/Config.mk
> ++++ b/Config.mk
> +@@ -173,8 +173,6 @@ CFLAGS += -std=gnu99
> + 
> + CFLAGS += -Wall -Wstrict-prototypes
> + 
> +-$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
> +-$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
> + $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
> + $(call cc-option-add,CFLAGS,CC,-Wno-unused-local-typedefs)
> + 
> diff --git a/recipes-extended/xen/xen-tools_4.17.bb b/recipes-extended/xen/xen-tools_4.17.bb
> index c6a3052c..e011b87c 100644
> --- a/recipes-extended/xen/xen-tools_4.17.bb
> +++ b/recipes-extended/xen/xen-tools_4.17.bb
> @@ -4,11 +4,11 @@ SRCREV ?= "322a20add00a4687cd46d9183616fa6fecbef81f"
>  XEN_REL ?= "4.17"
>  XEN_BRANCH ?= "stable-${XEN_REL}"
>  
> -SRC_URI = " \
> -    git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
> -    file://0001-python-pygrub-pass-DISTUTILS-xen-4.15.patch \
> -    file://0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch \
> -    "
> +SRC_URI = "git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
> +           file://0001-python-pygrub-pass-DISTUTILS-xen-4.15.patch \
> +           file://0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch \
> +           file://0001-Config.mk-drop-Wdeclaration-after-statement.patch \
> +           "
>  
>  LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
>  
> -- 
> 2.39.2
> 


           reply	other threads:[~2023-12-04 22:20 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20231128175003.3883327-1-alex@linutronix.de>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZW5Qlwe6CIaegBaS@gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=alex@linutronix.de \
    --cc=meta-virtualization@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.