From patchwork Mon Jun 3 21:53:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Young X-Patchwork-Id: 10974017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA53B14B6 for ; Mon, 3 Jun 2019 21:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90D63285D6 for ; Mon, 3 Jun 2019 21:55:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8375028704; Mon, 3 Jun 2019 21:55:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 711E1285D6 for ; Mon, 3 Jun 2019 21:55:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXutg-00028S-Jm; Mon, 03 Jun 2019 21:53:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXutf-00028H-8d for xen-devel@lists.xenproject.org; Mon, 03 Jun 2019 21:53:39 +0000 X-Inumbo-ID: 09c9f9e7-864a-11e9-8980-bc764e045a96 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe02::717]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 09c9f9e7-864a-11e9-8980-bc764e045a96; Mon, 03 Jun 2019 21:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=durhamuniversity.onmicrosoft.com; s=selector1-durhamuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IkEbW49i4QHJVsMVJHJWSLWNfnmOH2NRL1dw4C/zotc=; b=eeMeiSs7sBzJfvgpWAiuHJlwK2x3ja3KqxpigZjB/xa6v3xcACPBSnVGKnzJLaHL5HdBr0CDly0BJ2T8SDXvFfUUuywGI9DxK23RcxXyJ3h6Kd4xRx59lRiOqXHl8R/7bNyqSYdC2yXu/XeUKVJJuAb3B19bo2TWCjLbnYFXHZg= Received: from AM6PR06MB4648.eurprd06.prod.outlook.com (20.177.197.138) by AM6PR06MB4754.eurprd06.prod.outlook.com (20.177.118.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.22; Mon, 3 Jun 2019 21:53:34 +0000 Received: from AM6PR06MB4648.eurprd06.prod.outlook.com ([fe80::864:f58f:98c6:b4a5]) by AM6PR06MB4648.eurprd06.prod.outlook.com ([fe80::864:f58f:98c6:b4a5%5]) with mapi id 15.20.1943.018; Mon, 3 Jun 2019 21:53:34 +0000 From: "YOUNG, MICHAEL A." To: "xen-devel@lists.xenproject.org" Thread-Topic: issues with Python 3.8 Thread-Index: AQHVGlbK2uli84wTlUOOOEW8m+MOuw== Date: Mon, 3 Jun 2019 21:53:34 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: user-agent: Alpine 2.21 (LFD 202 2017-01-01) x-originating-ip: [2a00:23c4:9208:400:c49a:db08:8036:b390] x-clientproxiedby: LNXP265CA0028.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::16) To AM6PR06MB4648.eurprd06.prod.outlook.com (2603:10a6:20b:67::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=m.a.young@durham.ac.uk; x-ms-exchange-messagesentrepresentingtype: 1 x-x-sender: michael@austen3.home x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ccd774d2-385c-4103-9ef9-08d6e86deca4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(49563074)(7193020); SRVR:AM6PR06MB4754; x-ms-traffictypediagnostic: AM6PR06MB4754: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:392; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(136003)(396003)(366004)(376002)(189003)(199004)(58126008)(256004)(66946007)(66556008)(5640700003)(6436002)(66576008)(66476007)(64756008)(66446008)(966005)(73956011)(316002)(14454004)(25786009)(5024004)(478600001)(6512007)(6306002)(14444005)(99936001)(8676002)(81156014)(81166006)(71200400001)(53936002)(68736007)(8936002)(71190400001)(7736002)(786003)(36756003)(305945005)(9686003)(102836004)(6916009)(6116002)(53346004)(6486002)(52116002)(74482002)(7116003)(2501003)(186003)(86362001)(6506007)(386003)(99286004)(46003)(5660300002)(2351001)(476003)(4744005)(486006)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR06MB4754; H:AM6PR06MB4648.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: durham.ac.uk does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 6iXjJ6k3E0ZOXiXvw/9v4KfBTULMh2GOq6pQ41klzEkCNiFfrqxyaFd8ldKC1A09upQ/YyMysvatMyMN4v8OAKgPcEpqizKhvT+M3xN0hx/TQzqxQJK3EfkcXR7+5Sv2MClvmocriYX8kZYfnZQZTT6E8W2ou6NYEqMM0AqL2XETLZtoibPq9L/IM7Ye9sL+tYswVW0rmEZbUOl4EBCUcvQM6osvj3vWQyjpNZclK8rXEQ4CY1adP46vwSmEPbeDPtWge9LMRGZSP8o3uaIUnY0EdHqnDQiwoptbOMKLdEeWaVpQkDTmxoEKcNA3WS+li4Qy1j4DpUvuQ0n0E5pEsVg32fTYZyWx49qAQrKLa5DGANAyBt8w2c2QcH/7UTyUtJkBHZpNKAg2CR9N5Sw19TXt2TpxiV47k94tbuadGtM= MIME-Version: 1.0 X-OriginatorOrg: durham.ac.uk X-MS-Exchange-CrossTenant-Network-Message-Id: ccd774d2-385c-4103-9ef9-08d6e86deca4 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2019 21:53:34.1743 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7250d88b-4b68-4529-be44-d59a2d8a6f94 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dcl0may@durham.ac.uk X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR06MB4754 Subject: [Xen-devel] issues with Python 3.8 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fedora rawhide is about to to update to Python 3.8 (in beta I think) and there are two issues with compiling xen with it (see https://bugzilla.redhat.com/show_bug.cgi?id=1704807 ). It seems that in 3.8 python3-config --libs no longer includes -lpython3.8 by default which causes tools/configure to fail. You can get -lpython3.8 back by adding --embed , but this option isn't recognized in earlier versions of python. It also seems python 3.8 adds the options -Wno-unused-result -Wsign-compare to the compilations in tools/python (though I am not sure how this happens) and -Wsign-compare gives some build warnings which the Fedora build treats as errors. I have attached the patch I used to get xen-4.12.0 to build with python 3.8 and also the build warnings it fixes in case they are useful. Michael Young BUILDSTDERR: xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_create’: BUILDSTDERR: xen/lowlevel/xc/xc.c:148:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] BUILDSTDERR: for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_sethandle’: BUILDSTDERR: xen/lowlevel/xc/xc.c:313:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] BUILDSTDERR: for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_getinfo’: BUILDSTDERR: xen/lowlevel/xc/xc.c:392:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] BUILDSTDERR: for ( j = 0; j < sizeof(xen_domain_handle_t); j++ ) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xc/xc.c: In function ‘pyxc_get_device_group’: BUILDSTDERR: xen/lowlevel/xc/xc.c:678:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] BUILDSTDERR: for ( i = 0; i < num_sdevs; i++ ) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xc/xc.c: In function ‘pyxc_physinfo’: BUILDSTDERR: xen/lowlevel/xc/xc.c:983:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] BUILDSTDERR: for ( i = 0; i < sizeof(pinfo.hw_cap)/4; i++ ) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xs/xs.c: In function ‘xspy_ls’: BUILDSTDERR: xen/lowlevel/xs/xs.c:191:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] BUILDSTDERR: for (i = 0; i < xsval_n; i++) BUILDSTDERR: ^ BUILDSTDERR: xen/lowlevel/xs/xs.c: In function ‘xspy_get_permissions’: BUILDSTDERR: xen/lowlevel/xs/xs.c:297:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] BUILDSTDERR: for (i = 0; i < perms_n; i++) { BUILDSTDERR: ^ --- xen-4.12.0/m4/python_devel.m4.orig 2019-05-31 23:30:42.489738121 +0100 +++ xen-4.12.0/m4/python_devel.m4 2019-06-01 17:02:38.886934441 +0100 @@ -24,7 +24,8 @@ dnl If python-config is found use it CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`" LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`" - LIBS="$LIBS `$PYTHON-config --libs`" + LIBSTMP="`$PYTHON-config --libs --embed`" || LIBSTMP="`$PYTHON-config --libs`" + LIBS="$LIBS $LIBSTMP" ]) AC_CHECK_HEADER([Python.h], [], --- xen-4.12.0/tools/configure.orig 2019-05-31 23:30:42.498738452 +0100 +++ xen-4.12.0/tools/configure 2019-06-01 17:08:26.100727658 +0100 @@ -7482,7 +7482,8 @@ CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`" LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`" - LIBS="$LIBS `$PYTHON-config --libs`" + LIBSTMP="`$PYTHON-config --libs --embed`" || LIBSTMP="`$PYTHON-config --libs`" + LIBS="$LIBS $LIBSTMP" fi --- xen-4.12.0/tools/python/xen/lowlevel/xc/xc.c.orig 2019-04-01 12:03:23.000000000 +0100 +++ xen-4.12.0/tools/python/xen/lowlevel/xc/xc.c 2019-06-01 17:58:39.567729630 +0100 @@ -118,7 +118,8 @@ PyObject *kwds) { uint32_t dom = 0, target = 0; - int ret, i; + int ret; + unsigned int i; PyObject *pyhandle = NULL; struct xen_domctl_createdomain config = { .handle = { @@ -296,7 +297,7 @@ static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args) { - int i; + unsigned int i; uint32_t dom; PyObject *pyhandle; xen_domain_handle_t handle; @@ -337,7 +338,8 @@ PyObject *list, *info_dict, *pyhandle; uint32_t first_dom = 0; - int max_doms = 1024, nr_doms, i, j; + int max_doms = 1024, nr_doms, i; + unsigned int j; xc_dominfo_t *info; static char *kwd_list[] = { "first_dom", "max_doms", NULL }; @@ -632,7 +634,8 @@ { uint32_t sbdf; uint32_t max_sdevs, num_sdevs; - int domid, seg, bus, dev, func, rc, i; + int domid, seg, bus, dev, func, rc; + unsigned int i; PyObject *Pystr; char *group_str; char dev_str[9]; @@ -972,7 +975,7 @@ { xc_physinfo_t pinfo; char cpu_cap[128], virt_caps[128], *p; - int i; + unsigned int i; const char *virtcap_names[] = { "hvm", "hvm_directio" }; if ( xc_physinfo(self->xc_handle, &pinfo) != 0 ) --- xen-4.12.0/tools/python/xen/lowlevel/xs/xs.c.orig 2019-04-01 12:03:23.000000000 +0100 +++ xen-4.12.0/tools/python/xen/lowlevel/xs/xs.c 2019-06-01 18:59:46.316760561 +0100 @@ -186,7 +186,7 @@ Py_END_ALLOW_THREADS if (xsval) { - int i; + unsigned int i; PyObject *val = PyList_New(xsval_n); for (i = 0; i < xsval_n; i++) #if PY_MAJOR_VERSION >= 3 @@ -276,7 +276,7 @@ struct xs_handle *xh = xshandle(self); struct xs_permissions *perms; unsigned int perms_n = 0; - int i; + unsigned int i; xs_transaction_t th; char *thstr;