From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SIXdHnGfy2m8kwAAWB0awg (envelope-from ) for ; Tue, 31 Mar 2026 06:18:25 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Fp/dIfni; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Fp/dIfni; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 687711E0BC; Tue, 31 Mar 2026 06:18:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F11C01E04F for ; Tue, 31 Mar 2026 06:18:23 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 308364BA2E36 for ; Tue, 31 Mar 2026 10:18:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 308364BA2E36 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Fp/dIfni; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Fp/dIfni Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11011064.outbound.protection.outlook.com [40.107.130.64]) by sourceware.org (Postfix) with ESMTPS id A53804BA2E23 for ; Tue, 31 Mar 2026 10:17:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A53804BA2E23 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A53804BA2E23 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.130.64 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1774952265; cv=pass; b=Jdv2nme1mzDpsM06FvdmwyHrUQluRiCWqXASjuR4qhHhRL+Mgr4ciP/9u3Sp3nWHtDCL1bdSUvhdDSHuEMlZCb/FdL5ltkm3FjSZsMJFArSnomkpz0bILHkak6kY/At6NFqz5yGNpnE+BvPKp5X8rGyJIf4NPfrxuBu0gwKyDs4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1774952265; c=relaxed/simple; bh=SDJc8nX+Ge8i093RR5kn3w46Q/yTCXv+33/QWNFjw2U=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=vIZ3hgNXBeP2LJauv6eVGaLDJM1cKD5/ayKK3Ut/atEvMi1dyIQUVEHqG9S4Ag5e9jZYgvsHpCy//vbH/BHHumnb/ztVZMcLxvhG0bD7i5u2oq1Pl/XDD4a9IMuwuFKCft2X5aFU/kt8WislNn8+LJKTAX1m7n8HvDmy6QVSfss= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A53804BA2E23 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=wvdVsvZexYfOgTl2b3EyOL9u1prJ8fF+X60u8FO0n+jtC27sHwpggSpvnCVJecMhdh4P3TkckUsX9KC5t0XUE9pOBu0VkWOZV9mGEK6XMnGSlggTPyr9y9pWWvNB1dZftcCnj17uYQwYLUCZ1Hh0VLqEsEOfuX3MMhiw39l2lg9CRgl9puMp8+XL7xPSUFxUXlZsYw/58NvVjFL4rkidZMZa3gFsnLsWMHP67OHrRNuZhSNNAoZas789QPheoZH0izzn4NKYtggjf223xLXyK4ZKp6zOToI8InuTqnsvi0GRgPYBmluqysdw7hnkctvIseingpYGchWd2RYpPVgArg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=74w2PikXo8oXIwSU6UvLRKHY3yficMrl+EH8lZD0GDc=; b=R3yGm7wbWCOiSNWaLz6mdeFlOcJNr3MuOeJYFSb9S0Njkv/SWPQsXN0cfRg3DQ1evf4BBdCA8y1D361a0rZo13YY+Qv0BTkiwcU13mQp8mysS2U6Ihw5ordo/HuEaqqnUfaC+MvYi/dV2XqgiXQHDXDzCGayMjHs6F68ly314+yVXTV60I10G40RJIyjw9H0ADrlFGIgYA902Nc/Mol4/CT0Fg743f9g8XfZZBnfxeQ7dYljXDZJCZmXSg4fWZP1UEltHfSrxlmmEHy8jUXznATewSmzBjM0074MRR8Q9bQZ2I7MJETADVbK8yXlJx3HttOLrSC/BIZv8HoV02f0eg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=tromey.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=74w2PikXo8oXIwSU6UvLRKHY3yficMrl+EH8lZD0GDc=; b=Fp/dIfniEuG2mfu/hl3SG3dYy33ff9+0ib5dMcBfj39UA58Xw/oEN8ccwLZZZt7u/SeLIfvSSsQDInM3AmyaWV3ifBEBxCfzEU3SVQhPPoK29LhSsxLHGbcRM3idxZJL6cXZKuIgqbv/h4KrvoZdWJ+HUw7Xcwf7DblzayYxa/s= Received: from DUZPR01CA0058.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::12) by VI1PR08MB10298.eurprd08.prod.outlook.com (2603:10a6:800:1be::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Tue, 31 Mar 2026 10:17:34 +0000 Received: from DU6PEPF0000B61F.eurprd02.prod.outlook.com (2603:10a6:10:469:cafe::b) by DUZPR01CA0058.outlook.office365.com (2603:10a6:10:469::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Tue, 31 Mar 2026 10:17:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DU6PEPF0000B61F.mail.protection.outlook.com (10.167.8.134) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Tue, 31 Mar 2026 10:17:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iRM4qMC101AMZ2DZnYzV5nm01I1QRl7opm304VAV8l05U0jr4HzPas7+6/PHVm6Je4AZlkxvbmLSUBaOum1JHZXdCFLacwhbcYsbqEF/nkFcvZHwbvDNjDcGeYXnJJ2yMFtoQ/FAQXxYeM4gprJEXFVkR52FXKQDy1Jah61asEva8OWZES2KnktWRcl76TQ1WrDyXJ5OFVVYX+HTRVgEjO6tQhh1BOfUbh39EoWsgtzVHwnZ2F2tTc06zQCtIS1yIgFLFycN6nEa9SxbtUj5kcCywqTgUA6eZu0iZX1JYWyj+Swd8DfYpVVD06Uf1nQDbk1TgwQIjWPM9cF3W1nnmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=74w2PikXo8oXIwSU6UvLRKHY3yficMrl+EH8lZD0GDc=; b=X1RZE5rNdMe1dv+D5f1nF8wBXK88iF7QbqbDmWbZ0GGWrgPZyhS3/iZnBDkvPOTrpDiiPYL9SJiGhxstrLQ/Wf/fmUpKNftcGsw65rLgLpd25oyzuWwWgJADs9KBw+99p4tu+62ZVUcEogeVDPgoukJ76HBR/yJo6Inn9esUTvTlAaAnLAmz7H5kem/fjrSKtzsp0HEb/f35JsTQOSZm6/DzNbiTH7cQs7nddPr0Viy9+NIym6Gyi9tebwivtWLDcv661XXghkC46NCwY5lcX/fWdt8WiImWLaWP4p464o5OOaaSpvXkmBdDztBbaL1YZzCQ0muIZAM91oAL3bwP7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=74w2PikXo8oXIwSU6UvLRKHY3yficMrl+EH8lZD0GDc=; b=Fp/dIfniEuG2mfu/hl3SG3dYy33ff9+0ib5dMcBfj39UA58Xw/oEN8ccwLZZZt7u/SeLIfvSSsQDInM3AmyaWV3ifBEBxCfzEU3SVQhPPoK29LhSsxLHGbcRM3idxZJL6cXZKuIgqbv/h4KrvoZdWJ+HUw7Xcwf7DblzayYxa/s= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8663.eurprd08.prod.outlook.com (2603:10a6:10:401::6) by DU0PR08MB9322.eurprd08.prod.outlook.com (2603:10a6:10:41d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.28; Tue, 31 Mar 2026 10:16:29 +0000 Received: from DU0PR08MB8663.eurprd08.prod.outlook.com ([fe80::f957:cec9:ec8d:7968]) by DU0PR08MB8663.eurprd08.prod.outlook.com ([fe80::f957:cec9:ec8d:7968%2]) with mapi id 15.20.9769.014; Tue, 31 Mar 2026 10:16:29 +0000 Message-ID: <7437a144-6d93-414f-a7c3-f67babc0a901@arm.com> Date: Tue, 31 Mar 2026 11:16:28 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/7] gdb: fail configure if Python version is too old for limited API To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20260309175624.236491-1-matthieu.longo@arm.com> <20260309175624.236491-3-matthieu.longo@arm.com> <87h5q55a9o.fsf@tromey.com> Content-Language: en-US From: Matthieu Longo In-Reply-To: <87h5q55a9o.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PA7P264CA0016.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2df::11) To DU0PR08MB8663.eurprd08.prod.outlook.com (2603:10a6:10:401::6) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DU0PR08MB8663:EE_|DU0PR08MB9322:EE_|DU6PEPF0000B61F:EE_|VI1PR08MB10298:EE_ X-MS-Office365-Filtering-Correlation-Id: 55237767-034a-48ad-ba51-08de8f0eb93f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|366016|1800799024|18002099003|56012099003|22082099003; X-Microsoft-Antispam-Message-Info-Original: rGyyT0BN+5+vxI8S43JquTKuVn7bJd/0vPZR8OTPnPMSv/PIAq0LbZ1nZDksPaFASRbyC2iEjwbgBFd6liGEcr1K35MaG0HjaOH1+3XzDTCYL9mhMZ2OKazXxkQHzjV8iV3eKCeqYNBfwPodz7NtvGfXYYA0AdPn2Hb4egfFafzY3hx68Z8Z/kVL8SdR3XUd73jIDFDN7EtM4knZW8b/G2UVfZsW+vytsFg/qO7qE/dZZlOD3l3BfuZC3ZDAixB/AdM9xSFZRN8E3UvkwEUHc6wdFSfCNVNZKGBrG+EY1hV4Jshg+iClL/OSXZhF2fx4hHG7QzI4QXN08+ccz4bBtsCUGDIpn7uHz7hFW9ZWg3fV/nnW5Rz1qyHhx01IyEJ5FgdwFACu0QXIbi7Pw4w9gzMy/VuP3+IESf7RjLCrYF6xmrr4b/REMbiApTaHFkQmJKb6Hmqo6OtRQkRpo0dkjHmIzTHh/2VQNoGMvkRrZyDGDOGkYIPFo32ruL4ltgVHkCXyNGUXPUMwQlkRY7AvVZdjvWkUM/bzRMeLsJNHfhkaHG7npvQ/e+oCA9cYiefAiDcLPF/kGRfJb+cAowp/hJUJDe2Agm8GcI5cI1nrGrENWSet1H2lp+weKrKZ+ONLAKW8KWfvtBaIdPjXWiOUdavwa4lBW/9/4r9zA3+xtFih9W0vMg0Exjam8OlPHWtRWMncWF5LLnsyvMNf+3Z2nbf5nJUP5fhvmmuSGgdjxkY= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8663.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(18002099003)(56012099003)(22082099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: kP43Cut/5ACEbV3AVOc9sdDgYQWdR6bys8duikEyJ4t2LMBSJ3oxt1zCgFhWOedkKUSFU+fMRGuFfvssnGiw9WfhMQbH6qoXPRZ4d8R/Chnunpk11kxHJ4jsaEVOi+oAlGlN12dSHNRMw4LTGYzJlaZZjOsStYokV2mDIw3l68mAuByzJnqxO687GF6W31gtoj92MTqr205MChld5vSW+V21jffkPqE4ZeN7DpgdNQ3PJy0+FWBQqubcxaeIebW/Jhx/2yadvljOO7Y44fARtrC+8BSfBwThVEr9Ki4OwmUbz0RGAVxFj5MvObXeoQARlwPt91p5FJ38HJyVzkojDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9322 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8c7a0579-3c4f-45d8-0d80-08de8f0e92bb X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700016|14060799003|35042699022|22082099003|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: Gg0E1CQSUuKn9PKBXOVxzwZUDjBPV+XVy1GlFGUfcvLFznCRfQu3ME9P+1FRNx85qTxKls2XZgAjr438cknSsg4DN2Jb6RT4uqnfhc/1/5b3pcS28gez78Eh8X1Yl65u11ojis8gQHmk0xVMuPAfRcIlGz65QQGtjPZO3rO/qN2dp9umfWAyTq3KkoE1Qh1f7k5NHZZCS5NwpVDGzLLO+uaKsqRZvugfpLcsps4v4IYU7HCsbq9YVscAFb3NDIQHN37LTJelFDqi7H59/HJRThD18zrsbSvrtgYQieLZ+BOC2UwQGkWrqQFQprBnriS/8y1HTAr2EMo6sw/aTHBhhNNRmawwQo4AgHMMUtdS7HokNgBu3NZm+TpL/zg25sn0Y3lPWyWIz+G4zzVWzyGBd30WiR6XIO0rkfre6Zulg3IgSUkrEu1lINPgOvZITi8q7JpLw7KpoAHKO2hNXycHLtRNVjf42jhKK2bk5g+cYDacdD1AyjjduOoNpO6pwNr4oE/u7vi2b4vTqkPdh0O4iNzIIR+AEH6Zo5lKolr/sEgC4QZTe2A8Z7F0ymujFJnYB42Dphf/vtGv9xHPVrIxFAUM2gFuja3SePBaMYUPzPJYN2oUptTe/MxiVpPNUvbxR/CGLl+5pE4SeOa0t5LMG4n8cs7fT7tyVHHK5DWoBrGl3yATJiRtilerKaTA5cm8dI4WYjIzomeh47iqSYg6OHImAmN8o4T3/Ko9u38g/5PMHDY09CXuU41EcY+bZnzoEMFgQfoSQj9CfkOWmfff9g== X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700016)(14060799003)(35042699022)(22082099003)(18002099003)(56012099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FX7QbqaGsIfw4gdRTo4vaUUdYvJBJwOHnhYKP1eL2L078OVww8WGInkigPepbhAe+vDMMK0r0HTTinJUtxVJS+5fKfd1S1bRwxE5vZCut/BpRzlNYr8GI02c38AKg0yE/fIn7hB0WOtplolSpUFQfXSKqQhK2216c9MW0u/eVqg0CjN/ZGF3jM6rp+QFcPkYB1wr3UMBLUnxOlzzm7weN5nFcBsgq4H2sh77HcCb8NWuu4XspHH6TgyL7ZbkaefRE8ieKztuio5hzY1CHuUq0eDRNc0Ry4SPzdhFwr8nrwGZ3YcqqLrYbrdu16LAvt4Hy30hIsEjvGCUM+d2cNTeJNHu46cf+aC02jXrIBovQ7NAuPGEi+AGDhPVRwzNkxdWQTLMqIrgswmA9RWpEDmUmiz0xvkncn5NpFe6OKHOH0guaNcBLMZ1F72ciCZ2So7x X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2026 10:17:33.2696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55237767-034a-48ad-ba51-08de8f0eb93f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10298 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 24/03/2026 18:53, Tom Tromey wrote: >>>>>> Matthieu Longo writes: > >> GDB can be built against the Python limited API using the configure >> flag '--enable-py-limited-api=yes'. This flag is currently experimental, >> and the build is not yet fully successful. Today, the minimum required >> Python version for this option is 3.11. This requirement is not final >> and will be raised to a later version as the migration progresses. > >> However, the configure script does not currently report an error if an >> older version of Python is used. Instead, the build fails later with >> numerous errors that are difficult to relate to Python limited API >> compatiblity. > >> This patch adds a version check when '--enable-py-limited-api=yes' is >> specified, ensuring that the provided Python version meets the minimum >> requirements for the limited API support. If it does not, configure will >> now fail with a clear error message. > > Sorry about the delay on this. > > I'm a bit worried about adding a bunch of new python-related configury. > Like are we sure it will agree with what's already in there? As in, > picking up the same version from the same place, etc? For instance does > this new code respect --with-python-libdir? > > I wonder if instead there could just be a new compile test that is run > when --enable-py-limited-api is used. This test could just check > PY_VERSION_HEX and #error on failure. > > Wouldn't that have the same effect but without adding a ton of new code? > > TBH I'd even be happy with not doing this check in configure at all and > saying that if you specify --enable-py-limited-api then you should know > what you're doing and if you mess up you'll just get compile-time > errors. That is, stick the check in python-internal.h. > > Tom So I followed your advice and added a compile test checking PY_VERSION_HEX and #erroring on failure. Here below is the new patch that I posted here to avoid a new revision. Matthieu diff --git a/gdb/configure b/gdb/configure index 12c54521682..16580e4af7d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -28507,6 +28507,7 @@ fi # do except assume that the compiler will be able to find those files. python_includes= python_libs= + python_prefix= have_python_config=no fi @@ -28743,6 +28744,7 @@ else fi + # Check whether to build GDB against Python limited C API. # Check whether --enable-py-limited-api was given. if test "${enable_py_limited_api+set}" = set; then : @@ -28763,11 +28765,46 @@ fi if test "$enable_py_limited_api" = yes; then # The minimal Python limited API version is currently set to 3.11 for the # support of PyBuffer_FillInfo and PyBuffer_Release. - # The choice of the minimal version for the Python limited API won't be frozen - # until the end of the migration. + # The choice of the minimal version for the Python limited API won't be + # frozen until the end of the migration. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" + old_LIBS="$LIBS" + LIBS="$LIBS $PYTHON_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifndef PY_VERSION_HEX +#error "PY_VERSION_HEX is not defined" +#endif +#if PY_VERSION_HEX < 0x030b0000 +#error "Python limited API support requires at least Python version 3.11" +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define Py_LIMITED_API 0x030b0000" >>confdefs.h + +else + + as_fn_error $? "Python limited API support requires at least Python version 3.11" "$LINENO" 5 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$old_CFLAGS" + CPPFLAGS="$old_CPPFLAGS" + LIBS="$old_LIBS" fi # -------------------- # diff --git a/gdb/configure.ac b/gdb/configure.ac index cf8078e1d89..c6b0653e3b0 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -933,6 +933,7 @@ else # do except assume that the compiler will be able to find those files. python_includes= python_libs= + python_prefix= have_python_config=no fi @@ -1062,6 +1063,13 @@ AC_SUBST(PYTHON_CPPFLAGS) AC_SUBST(PYTHON_LIBS) AM_CONDITIONAL(HAVE_PYTHON, test "${have_libpython}" != no) +dnl Use --enable-py-limited-api to enable the build of GDB against the Python +dnl limited API. +dnl +dnl no - Disable the Python limited API. +dnl yes - Use the Python limited API to build GDB, error if the selected +dnl version of Python is not compatible with the Python limited API. + # Check whether to build GDB against Python limited C API. AC_ARG_ENABLE([py-limited-api], [AS_HELP_STRING([--enable-py-limited-api], @@ -1072,10 +1080,31 @@ AC_ARG_ENABLE([py-limited-api], if test "$enable_py_limited_api" = yes; then # The minimal Python limited API version is currently set to 3.11 for the # support of PyBuffer_FillInfo and PyBuffer_Release. - # The choice of the minimal version for the Python limited API won't be frozen - # until the end of the migration. - AC_DEFINE(Py_LIMITED_API, 0x030b0000, - [Define if GDB should be built against the Python limited C API.]) + # The choice of the minimal version for the Python limited API won't be + # frozen until the end of the migration. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" + old_LIBS="$LIBS" + LIBS="$LIBS $PYTHON_LIBS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include +#ifndef PY_VERSION_HEX +#error "PY_VERSION_HEX is not defined" +#endif +#if PY_VERSION_HEX < 0x030b0000 +#error "Python limited API support requires at least Python version 3.11" +#endif + ]],[[]])], + [AC_DEFINE(Py_LIMITED_API, 0x030b0000, + [Define if GDB should be built against the Python limited C API.]) + ],[ + AC_MSG_ERROR([Python limited API support requires at least Python version 3.11]) + ]) + CFLAGS="$old_CFLAGS" + CPPFLAGS="$old_CPPFLAGS" + LIBS="$old_LIBS" fi # -------------------- #