From patchwork Wed Jul 10 15:55:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Faust X-Patchwork-Id: 1958907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2023-11-20 header.b=YCjK0tAp; dkim=pass (1024-bit key; unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=GcuUWLbV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WK2X3714jz1xqc for ; Thu, 11 Jul 2024 01:56:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0026F384A4AB for ; Wed, 10 Jul 2024 15:55:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 224573858432 for ; Wed, 10 Jul 2024 15:55:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 224573858432 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 224573858432 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720626940; cv=pass; b=HPM2ezIQM6fZCdZRWiQHQMcq/7gvMMutyZMHeNOyjGb1glVqbzxWtn+GsUkeM2KcsA6AFAtEPfRRYYS/CU94Xpt8HjNdUvNg7XTOGAA23PmzHHoGgrNtnyWjGgcifC+BJpTPn3rCERdGG3kwq7QYjgQmw+CS9B52nOVKDhn1L/o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720626940; c=relaxed/simple; bh=XSixOSiQOnWd9iWXhGmjSl1JJo1wG+BueX5EA5L/168=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=LpF3ttXGbt+QpZtYL4ag0rFWmVkXEuC7lB81qRnSxJ3wqoRe9KhSyMBpUXHvTquE8YmwjvQIi3HtM93mx4pBPjwjUy+knO84XGwIDX55somVcx7nv6lqG1gdx7X2vQYihjFwo/ooxlS8lZiyQQ8DO2ieBHkP3T1KYUyJIq/OA10= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46A7fTQ2017502 for ; Wed, 10 Jul 2024 15:55:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=corp-2023-11-20; bh=lDXqjxvO0Hh1TZ 80M7UKcQX2Bx59tnolytMX6gnT7WY=; b=YCjK0tApXUXJA4Je00HaUuasBtoCZj VVoB6kPX7yPok7tddxApJUTwmqWUz1B2EppdHm/zai5tySUPotn/0Xqti+pvvflq oKIar0BuR2ndlDf0WlVZCSag7EBe9QyaG7sE3IRZ/84xPIx589HEMaJ5WCNIuwqv kVE1viCVTiNbw1rXsse8qdTGtioapiMB82Kdnt/iVO/8YlpMj61hkm+VMSBP4U31 0lXkuwm/fOcBaPH/ZXfNAycD9Bn4RUHPG779SfA/2x3SgpkYajR4ITHzv7ufcH4r pfbrmJLPDF70VeAZe8xyBaAjzRW2LEhSwTYCt+FKgnKjkfjvUb/1Op/g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wybqq3m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Jul 2024 15:55:37 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46AFKqfR008783 for ; Wed, 10 Jul 2024 15:55:36 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 409vv39e58-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Jul 2024 15:55:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iGfbzZAmSOeCW7+HfkRf4XSQfTmk/dVJfi+JZC4p7obErVi5fGStclfJUCPyZditVqD7aURiN0v7Ccpl5ocz7p59GZLmoXeTQvcaudze72PQl4heZESbTcN8dVSorii0gZ5Xq1CHRXv6wcsnsuJpZl48AF4rMIcqXCZebOFdyjQpK0h5NFYlJGaKZutxk9Qy5M8L76LJ5E8w6Xy9l91F2pjtp+T3alx3RlIRj9431TTIkOkk0cK/vK/h1jlPIGShHiN9Fe2WlHWmpPDGhQc4cXnEfkWECJ351VZXkN8Zfn8cKSyZ1wFbit4X9jJo+5+YWhkZuOMuzIMVuWU+hbAVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=lDXqjxvO0Hh1TZ80M7UKcQX2Bx59tnolytMX6gnT7WY=; b=bgBN77bskggdT2u0oPsEuWyLWLq8PA+TaA4PVcTUULFcJwmE5mx69ay3c7mNtR4JVe+5sJOttqelouufDevjd1INxC2HLqyMxSny0M4N5nAvU36B7V666V9nFDTUqF+zP2+kBcvJOZq+iNx0ma3XPuoC+AsjCmkXiqzmi8dzCN44IRgQHLw29oQyjuKZsiTTSoz8wBJWHBvOYgyWkGCNePjPI9eolH5wIe+p+kQ8xLTyDaBNxHxbnjpyxHv0ARfQKmYrhfMibhgxAb+MrNFJlGQfxV1s7rHOo2GYkeXtuH6LrgtUomm2nWpSDxf9ONpxvlg/qMu3qgJ+Rme59fKuBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lDXqjxvO0Hh1TZ80M7UKcQX2Bx59tnolytMX6gnT7WY=; b=GcuUWLbVB2/pV0hcBNkDWLC4SgLtheo7Wuo5hrWZmy2AVoBvoDDyo9lxDZ2twxiBBVRFUBkf6teCrS/b4LJmkIRFu0WUkEBAMY5cIPvjanXtJIy4WUBd5HiXcjCvXQIUQsAeZOQB9bU74hx3EJaX9fRfW+LXFa5yx67okkYw1Us= Received: from DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) by SJ0PR10MB5787.namprd10.prod.outlook.com (2603:10b6:a03:3dd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20; Wed, 10 Jul 2024 15:55:33 +0000 Received: from DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::5b2d:d28c:8773:c84]) by DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::5b2d:d28c:8773:c84%5]) with mapi id 15.20.7762.016; Wed, 10 Jul 2024 15:55:33 +0000 From: David Faust To: gcc-patches@gcc.gnu.org Subject: [PATCH] opts: allow -gctf, -gbtf, -gdwarf simultaneously Date: Wed, 10 Jul 2024 08:55:26 -0700 Message-ID: <20240710155526.3993-1-david.faust@oracle.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: MW4P223CA0019.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::24) To DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7953:EE_|SJ0PR10MB5787:EE_ X-MS-Office365-Filtering-Correlation-Id: c5f61dd7-d64a-457c-cb1a-08dca0f8bb1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: PXBWX5U/v3rs5uZAmeus01bVs+y28F50DUEiHGuCCo8R7bp+5RgMAkbuPqryNtMb9qi+iYhNz/xa9QvzeWwVv/B3vzhsNF5e8EAOhL6cd51jp7o5H/yqIVwHTqixoIwmAWFfOm5P6hDsdp2tdq6SkqVgz9z1C5FJSFmgp8peEq/u+UUpOrB5J9tvS+9aSNcuLMjSzIG3QBjsSdDgxGXN/G3mltXJpuocWF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aYIW9OhZKs1U= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR10MB7953.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MOQIZmFdAjoR8twUYJV8tTaWhHqONRLAyly3Yd4btQ5Fw6Io9syGIHsuQpCT/PbfpyL+e2D9FmXA/tPFnZUdhv4ixsplGXQKeeZUbTXpjD3PKxteddx/sjCCPZr5tKNHTrhUXjoJepXESnknaK1tSWocnFLwzlweGzkz94fr304GaIqKXSu6kByZQS3xRncBTL9g/SdrQHcPV3C8YKDrCAzaasnmRgaQT+MmdqWiUWDJ/2AcRsfRwape/0r2Mk/pvf1RAur3GICeuIsmejOUxQAgzlDjSV5eGk/7120yB7hgB/k2ORZJHvgFRAdTqgh17zR/2C+jihxBesZwHRLPL/1VzqKS2doHleEzCkwWyxPTn/kU/7FZmRGMRAdpqwV98lgslupOAATZPhkGJKjbgrBbBe9emDumkNmgUkksXkEqsVuXPdCgkHWtCBUjv43zE8gqLVI7CjfsSYkXoqwRz3DEbojHVp3iEOexnlaegxbE149jXBuWw5M0LI9g5RGG2ofvmjowzXxTjVW0AZpXqsYARYPhZBGHlsfaA6FkdkFhu6Hn9ZmGqUA9iK/H8lPBVDJbpTYg74kUYw447F7vodMyX05RhqsfZ9XoStc3DVhd/Z31rRhkBpwHV3+P3wHOcOpeZCqs6GWSKj0vZ/QKFTPE0duqaiRfQfvuudqaumvLV6qYnPbqBzHtqE6rIksPk0hEUXdDtHbx5x9XGkgPuYNgQiZBUm0AvYb14ogqjS7Zumt8vfpwd+IUdXhE7kRwH9Gma4hb+LnARxG4cIXPyiYoyw6AKo/oK7IosLzwzH2d9kJYJmwUgtzHwCs/Q97k66exf51+2AaRvWKzzanUIpXtTxpYpHOA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9L0+2pTtI2hHG11Ms9ShivGW/+gA7CKl+0bBpBU5zNe6I1z9OjeFQvUAuopTeTnjOywmiCxXIvNsPA9C1CQotW/Vkyd0A+xzpqzryZIlOkKnu0hqMRZTsnZ4xkQm8ySi1+HDay0f3i4vAL3gA+pDbWivRAKM+pEN8z+4pa7ymF/InhHmYeUFBAafvUsEjYtkLW7FuSLFGXNytPp26f686wMP/iisRYQwsIkDDPajiTkor2aioI3Qnb8oGPW3ptTjRd/XtOYVwO/Ny3qg0wa8w6jaL4hgThbz7WO1vnu8+/DvGdlk3IIyeNuBdtATNSkfszIukhutn5ZStJSRdy+YGXupOayJR4adpwC6BJZfwaM2F+3r0zC9Zp3qSF8v/o16ZWmLc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5f61dd7-d64a-457c-cb1a-08dca0f8bb1a X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7953.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2024 15:55:33.2518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CEbyhN2sI+mAeIc3mXQCwxbJlZLZtgYl+QBpBOS2/jnmCikFT9VCBfQjC8pBsXMGVBCZbdmkWqS52b3P0xZVKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5787 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_11,2024-07-10_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=970 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407100110 X-Proofpoint-GUID: gDimgC4riHiYGQtLw3MumWZo_glaDVhQ X-Proofpoint-ORIG-GUID: gDimgC4riHiYGQtLw3MumWZo_glaDVhQ X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org [This is a resend of a patch previously sent as: PATCH v4 6/6 opts: allow any combination of DWARF,CTF,BTF https://gcc.gnu.org/pipermail/gcc-patches/2024-June/654253.html] Previously it was not supported to generate both CTF and BTF debug info in the same compiler run, as both formats made incompatible changes to the same internal data structures. With the structural changes to CTF and BTF generation made in: d3f586ec50d3 ctf, btf: restructure CTF/BTF emission in particular, with the guarantee that CTF will always be fully emitted before any BTF translation occurs, there is no longer anything preventing generation of both CTF and BTF at the same time. This patch changes option parsing to lift the restriction on specifying both -gbtf and -gctf at the same time, allowing for any combination of -gdwarf, -gctf, and -gbtf to be active in the same compiler invocation. Bootstrapped and tested on x86_64-linux-gnu. Also tested on x86_64-linux-gnu for bpf-unknown-none. gcc/ * opts.cc (set_debug_level): Allow any combination of -gdwarf, -gctf and -gbtf to be enabled at the same time. gcc/testsuite/ * gcc.dg/debug/btf/btf-3.c: New test. * gcc.dg/debug/btf/btf-4.c: Likewise. * gcc.dg/debug/btf/btf-5.c: Likewise. --- gcc/opts.cc | 20 +++++--------------- gcc/testsuite/gcc.dg/debug/btf/btf-3.c | 8 ++++++++ gcc/testsuite/gcc.dg/debug/btf/btf-4.c | 8 ++++++++ gcc/testsuite/gcc.dg/debug/btf/btf-5.c | 9 +++++++++ 4 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-3.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-4.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-5.c diff --git a/gcc/opts.cc b/gcc/opts.cc index d7e0126e11f8..735d0dd8accf 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -3508,21 +3508,11 @@ set_debug_level (uint32_t dinfo, int extended, const char *arg, } else { - /* Make and retain the choice if both CTF and DWARF debug info are to - be generated. */ - if (((dinfo == DWARF2_DEBUG) || (dinfo == CTF_DEBUG)) - && ((opts->x_write_symbols == (DWARF2_DEBUG|CTF_DEBUG)) - || (opts->x_write_symbols == DWARF2_DEBUG) - || (opts->x_write_symbols == CTF_DEBUG))) - { - opts->x_write_symbols |= dinfo; - opts_set->x_write_symbols |= dinfo; - } - /* However, CTF and BTF are not allowed together at this time. */ - else if (((dinfo == DWARF2_DEBUG) || (dinfo == BTF_DEBUG)) - && ((opts->x_write_symbols == (DWARF2_DEBUG|BTF_DEBUG)) - || (opts->x_write_symbols == DWARF2_DEBUG) - || (opts->x_write_symbols == BTF_DEBUG))) + /* Any combination of DWARF, CTF and BTF is allowed. */ + if (((dinfo == DWARF2_DEBUG) || (dinfo == CTF_DEBUG) + || (dinfo == BTF_DEBUG)) + && ((opts->x_write_symbols | (DWARF2_DEBUG | CTF_DEBUG | BTF_DEBUG)) + == (DWARF2_DEBUG | CTF_DEBUG | BTF_DEBUG))) { opts->x_write_symbols |= dinfo; opts_set->x_write_symbols |= dinfo; diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-3.c b/gcc/testsuite/gcc.dg/debug/btf/btf-3.c new file mode 100644 index 000000000000..93c8164a2a54 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-3.c @@ -0,0 +1,8 @@ +/* Verify that BTF debug info can co-exist with DWARF. */ +/* { dg-do compile } */ +/* { dg-options "-gdwarf -gbtf -dA" } */ +/* { dg-final { scan-assembler "0xeb9f.*btf_magic" } } */ +/* { dg-final { scan-assembler "DWARF version number" } } */ + +void func (void) +{ } diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-4.c b/gcc/testsuite/gcc.dg/debug/btf/btf-4.c new file mode 100644 index 000000000000..b087917188bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-4.c @@ -0,0 +1,8 @@ +/* Verify that BTF debug info can co-exist with CTF. */ +/* { dg-do compile } */ +/* { dg-options "-gctf -gbtf -dA" } */ +/* { dg-final { scan-assembler "0xeb9f.*btf_magic" } } */ +/* { dg-final { scan-assembler "0xdff2.*CTF preamble magic number" } } */ + +void func (void) +{ } diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-5.c b/gcc/testsuite/gcc.dg/debug/btf/btf-5.c new file mode 100644 index 000000000000..45267b5fc422 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-5.c @@ -0,0 +1,9 @@ +/* Verify that BTF, CTF and DWARF can all co-exist happily. */ +/* { dg-do compile } */ +/* { dg-options "-gctf -gbtf -gdwarf -dA" } */ +/* { dg-final { scan-assembler "0xeb9f.*btf_magic" } } */ +/* { dg-final { scan-assembler "0xdff2.*CTF preamble magic number" } } */ +/* { dg-final { scan-assembler "DWARF version number" } } */ + +void func (void) +{ }