Message ID | 87edwyst58.fsf@oracle.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1572995wro; Mon, 29 Aug 2022 13:18:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR51bS+8HcxH0wfffsjX/JwJPBV7qYwn0GwIbg5BTMOtc+HUuYikAmdCa2l+S0l+eL54JvYH X-Received: by 2002:aa7:c519:0:b0:448:c61:8c30 with SMTP id o25-20020aa7c519000000b004480c618c30mr11276825edq.109.1661804281151; Mon, 29 Aug 2022 13:18:01 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hg6-20020a1709072cc600b0073d610ccf33si7081500ejc.296.2022.08.29.13.18.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 13:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="u/sJVMWc"; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ACEE23856DDC for <ouuuleilei@gmail.com>; Mon, 29 Aug 2022 20:17:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACEE23856DDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661804237; bh=/GzE+KoGyktM7UdjZntVI2sUo8wqBdyCP47m09arEc0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u/sJVMWcrv8+6OJ5TZGQHY7Niab9qpE9B/xPzEe3Rr+It3N3GdtlbE3VTRCZZF004 NUeVIOIyl/Vd7FRX3AXQMrgQe+Vey0IqErT53gazKcBYOpieD82X0z9m5Kr5X6Au49 NkUYW54KQ4CG6kSfmc67QKrEckjw1oDubnZ9dYJk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 9EC033857017 for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 20:16:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9EC033857017 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TKGEdR032229 for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 20:16:29 GMT Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7btt4ec2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 20:16:29 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27TKDPAO017923 for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 20:16:28 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q35e1b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Mon, 29 Aug 2022 20:16:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=noKs2nYjthfGo3bU3CPurEsImV3by2UIvwR9wQp45bvVXZlaIV6t1t33MOlYfH+MaLLNemSaqnt1d/nKgEzOu2xJbbKPsDHZVASP+P12yiq6B0Fjp9/eIlTg4xFkJ5qRLz757+p/QFIZVSOLcYBjlW2JZ5cBTSURJhuOdXI3F9+c5omXFaEfpcybfsEjp3OWGpZTVyEhIC9OlXR11xJs/mzGmDE6NbEyNGrtaxm2r4zRqrrFccj6ALQfpsZ3eOcXVhbGLiKuAMFNLTPE0ilNCRlDANFBhyhW2uWvFF5+Tjr2cRY8zaYewKVbKQtN6A5xyazvIT2/LhnZ6GXwZ+wVZg== 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=/GzE+KoGyktM7UdjZntVI2sUo8wqBdyCP47m09arEc0=; b=c6hQH3kNKRnTjnim77ev+fuIkjJz0loEIM0Koo3BPs3P/qVu8gvHkzHP8HGX6Q06fe3Mul3j6LyQ7NjnFOn1nzBQa9HMaDmpKO3gWk1MS/lMSGRambhLzb33JhF5wRAm05hWWpdQ+kkCku4YkM6WHM5UaXjx/N61uEUDPgvY3M+/bOCeXxwzWbJWBjvB/3ilWveCuCr2uoQBBeVkHVmv4Kt/SItiEQSyoenbKkRkD92S1TX55q5aIAR9YjPFRsBMINIk4yrdFQ0YhA36cE3+03yLFizwcThQXK4wZDOyneKZD6jtipOjvtaRyNSYt+gAepeok1aPQh4xfelOKaJfRg== 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 Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by MN2PR10MB4302.namprd10.prod.outlook.com (2603:10b6:208:199::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Mon, 29 Aug 2022 20:16:26 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::3151:a4b3:aec3:b3dc]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::3151:a4b3:aec3:b3dc%7]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 20:16:26 +0000 To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] bpf: define __bpf__ as well as __BPF__ as a target macro Date: Mon, 29 Aug 2022 22:15:47 +0200 Message-ID: <87edwyst58.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-ClientProxiedBy: SGAP274CA0016.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::28) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e5ac546-17bd-4545-a894-08da89fb59b3 X-MS-TrafficTypeDiagnostic: MN2PR10MB4302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OTWCdX5D08Hyk+owyQm6Fmtf+xB2osps/YYGlFMNKIsxKfvofIUQpJxXR9KboRZgd60EgcIojcDRYI6Y+OwUN9xw12wUD1l/Ch/3ytsyTNTQfPHL/QapErwc1jMGADadXvht4QrkVLk2aGw7prwXWw7+aW2k/pdRD2hWCjRBPA7/m9cJFAphA7GEWtvhp+ESWSpMoIqnuf27TRhbFXAhpFn2HpJCwA+EQzEwhjgeO6nZJQJuFC1Ejv2LlRLQIGBPFhhUglearfMgrHdFJrlRMNpGB11K0GoWUuIk2DLhjmP8fQR1TpfLFc71bFeEDL7brdcu6GaJBruoqVTfyJFblYAYST9Pxav55E/EuWqFrIsZ17Yl6yZT/X7+jJPu/3CEp1OHLdOf8fcukXWv5EXc0NTwZQvvZpqCQpNBgRf/JUnreMDKINgSfGQdnzFK4pD8jRpgdQhgRT2gJ2e83bmYd8LffuWWhoLsSycqJucfS7gT1rnps1cU4cI7TIHn7yFPyDTxZhQN6IcIxddXTUyGO41Q/wuaciSWlKBoKM2rtM+1PUedZUOqlonRPaPI7ub+AsDXzZHrpY9HD3zdyr4thjNv+HLLGC7dLcQqrN68fv5300FHp2AOi2ILSc53krlfDxEVp2E3HEOTKnWwbOd5dFyQXg40qTOH2yT/ekGtHHiBLJdTnosuy328sOKq4hh6996jscooH+HN90TISPQk5w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2888.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(366004)(346002)(39860400002)(376002)(396003)(6916009)(66946007)(66556008)(66476007)(316002)(8676002)(6486002)(36756003)(8936002)(86362001)(5660300002)(478600001)(41300700001)(6506007)(2616005)(6512007)(2906002)(38100700002)(6666004)(26005)(4744005)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WjhMD9jCeZMURXwJpuG1PMXXnOiaB3FBEMtQZ0N6Ku8kDuMoPbL4DJaBXvk8S3aaZ8T3Z4v81SPwwV7KHv6yD2LUmwb9YhW8gatnLsGQF2S7KmGQtBWUrmaurxrf2DZYPaKiy40WOtxXm3tmsRPZx/WZQHRi5EZdCB7RtSGLWatOb9BatQT0cw39AyBcRBAIreVOYAzRlD/c7s3OzUM131FZDb16bGRQ5tm3qpclPgPn4HCUv/RQMyL3my75dM+uxr1t3g+t1CtQm2vaa5nkTpTKdv8fpLcbsjfW1aSEkF8H6poRMLRri9LAci4VDFByyXdbP1chgcdycramdrp76Pvud+cjEjraQVJwIfr41WTfGRqSxY405AgnyEErKebY4WQG9kwS9hTKijyD5OCjZ3MqmXsQjy+hqV1/TqGuIQYpLAxiMiNeILKJ9JrBgOMLNZEDiQYUWFtEnvhjZMGZCsF17E/Oqr+J5/yNnTw2Dz37mvI8ybAgrjEvxc52nXqfyVdYO4tXRj0TzfDG4PmBh5Cmd9OyH86lyLVeWEBlYQhfgyJoz7RENbX5AMf3e9/P3C9B2mtiuMPZqMbjyLIZsDskPxSX29HMIqIr9a8RjSeBQQxg4EV9N8/2lTDxnjVHvqc1VDZf2WUpTtyP4wNSFgQ064BSozlGIlBxJ43Z2FQ634BnZeaf8OQ6YDD1KcFhKuDmET97FYAEgPQPmuwJ+PYoR60LhLuFxbMwBR7PflHh8fVZyqABAB+/y+LfnJSvq5jbiXWA/+R/MFulkFFd/0whHyj6og1eRAYHeHRPytJHaU++NtRRpFTQVb1PWA/PpMEkebkO55a2IA1sdIi/VkDuiW0suFOxJNH3OBhlJ3NoymXl1yrb0IcDUX0agK5osdevUs+wNUwdp/yFd8yICjERZSXmCcaz1OJrMXVwTYQZTjiMwFPNdhV2m7dbG1sgAfgM+ti/IOI4RJmQohoJ4s1pPjFYhoJvpTaTHGmwOu1R3Nvt49sKC0WCzdzS7IRd5RZ0g4n9M+d/elUqtTSy7RARHl2EnjqCGUndfRvOjWdPV+zShE/v78mRQkhCqefLfDg8qNKY/8TYuC5Z6B8/vDH3vh5GF4DdRJiEo0aRmCcpvR/bEFNev2gkiwljfdwb+dYKEyxxkNzPhhvVZPR8/HtXwR2KDnB77dT7h4Bvt8erxd0V8ui41Mr13g9og5kVZwhwiGdxY8k2IaANMLphM3/tMyU+wNX7BXMvJkDtiErKOudimEzi8k7MrfdJgYgLi1Q7pKfvKfSv2HqoK+iLKiBHCoHbvQegP6HAch5H+v1EPIdUQbYeoaqKIBHmHt1VYlnbCQNHCs6nKDpHi3O5No8LXjKvbGA6DjhrfItKFz8q7QME4FSVCkqt46VExEOI8QVMvoXSH3yRUd2IKH8GATBz8r7QgaAXJqqwfKKZRFmq/mZchMWz3pQqOHPyUu38ySg0ILUkNC7EPUY3s3GOZ9xbKDvGbPEc39tHlxbEonf7LUNERI3Oj24tj3rLNZCD2OxSZeITnEmUZL+dWI4bm6qmKHEB7553fZP9MRhtopL2G3nrFt9Yn4NTKE6b2HYxW0prEYyAbHlAOVPx44f1zg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e5ac546-17bd-4545-a894-08da89fb59b3 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 20:16:26.4526 (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: 2wZWx96vQ7jhgBYiueGRfXisT6Sn3Eu7QOW7maBKlCiDimXwLUGmDqDBVHjn+likNjPKoaA9G802K30BMEXeSgIDCOSiGn4yWtWjfY6Yxrs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4302 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_09,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=740 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290092 X-Proofpoint-ORIG-GUID: 296acqLNR1HIVa7OPdXakdnnEIHjL4kU X-Proofpoint-GUID: 296acqLNR1HIVa7OPdXakdnnEIHjL4kU X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: "Jose E. Marchesi via Gcc-patches" <gcc-patches@gcc.gnu.org> Reply-To: "Jose E. Marchesi" <jose.marchesi@oracle.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742528085894858997?= X-GMAIL-MSGID: =?utf-8?q?1742528085894858997?= |
Series |
[COMMITTED] bpf: define __bpf__ as well as __BPF__ as a target macro
|
|
Commit Message
Jose E. Marchesi
Aug. 29, 2022, 8:15 p.m. UTC
LLVM defines both __bpf__ and __BPF_ as target macros. GCC was defining only __BPF__. This patch defines __bpf__ as a target macro for BPF. Tested in bpf-unknown-none. gcc/ChangeLog: * config/bpf/bpf.cc (bpf_target_macros): Define __bpf__ as a target macro. --- gcc/config/bpf/bpf.cc | 1 + 1 file changed, 1 insertion(+)
Comments
On Mon, Aug 29, 2022 at 1:16 PM Jose E. Marchesi via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > LLVM defines both __bpf__ and __BPF_ as target macros. > GCC was defining only __BPF__. > > This patch defines __bpf__ as a target macro for BPF. > Tested in bpf-unknown-none. > > gcc/ChangeLog: > > * config/bpf/bpf.cc (bpf_target_macros): Define __bpf__ as a > target macro. > --- > gcc/config/bpf/bpf.cc | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc > index 7e37e080808..9cb56cfb287 100644 > --- a/gcc/config/bpf/bpf.cc > +++ b/gcc/config/bpf/bpf.cc > @@ -291,6 +291,7 @@ void > bpf_target_macros (cpp_reader *pfile) > { > builtin_define ("__BPF__"); > + builtin_define ("__bpf__"); > > if (TARGET_BIG_ENDIAN) > builtin_define ("__BPF_BIG_ENDIAN__"); > -- > 2.30.2 > Having multiple choices in this case seems to just add confusion to users and making code search slightly more inconvenient. How much code uses LLVM specific __bpf__? Can it be migrated? Should LLVM undefine the macro instead?
> On Mon, Aug 29, 2022 at 1:16 PM Jose E. Marchesi via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: >> >> >> LLVM defines both __bpf__ and __BPF_ as target macros. >> GCC was defining only __BPF__. >> >> This patch defines __bpf__ as a target macro for BPF. >> Tested in bpf-unknown-none. >> >> gcc/ChangeLog: >> >> * config/bpf/bpf.cc (bpf_target_macros): Define __bpf__ as a >> target macro. >> --- >> gcc/config/bpf/bpf.cc | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc >> index 7e37e080808..9cb56cfb287 100644 >> --- a/gcc/config/bpf/bpf.cc >> +++ b/gcc/config/bpf/bpf.cc >> @@ -291,6 +291,7 @@ void >> bpf_target_macros (cpp_reader *pfile) >> { >> builtin_define ("__BPF__"); >> + builtin_define ("__bpf__"); >> >> if (TARGET_BIG_ENDIAN) >> builtin_define ("__BPF_BIG_ENDIAN__"); >> -- >> 2.30.2 >> > > Having multiple choices in this case seems to just add confusion to > users and making code search slightly more inconvenient. > > How much code uses LLVM specific __bpf__? Can it be migrated? Should > LLVM undefine the macro instead? I agree that it would be better to support just one form of the target macro. Having two alternative forms can only lead to problems. But I think the train left the station long ago to do any better: there are files in the kernel tree that rely on __bpf__ and there may be BPF programs around doing the same thing.
On Tue, Aug 30, 2022 at 9:46 AM Jose E. Marchesi <jose.marchesi@oracle.com> wrote: > > > > On Mon, Aug 29, 2022 at 1:16 PM Jose E. Marchesi via Gcc-patches > > <gcc-patches@gcc.gnu.org> wrote: > >> > >> > >> LLVM defines both __bpf__ and __BPF_ as target macros. > >> GCC was defining only __BPF__. > >> > >> This patch defines __bpf__ as a target macro for BPF. > >> Tested in bpf-unknown-none. > >> > >> gcc/ChangeLog: > >> > >> * config/bpf/bpf.cc (bpf_target_macros): Define __bpf__ as a > >> target macro. > >> --- > >> gcc/config/bpf/bpf.cc | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc > >> index 7e37e080808..9cb56cfb287 100644 > >> --- a/gcc/config/bpf/bpf.cc > >> +++ b/gcc/config/bpf/bpf.cc > >> @@ -291,6 +291,7 @@ void > >> bpf_target_macros (cpp_reader *pfile) > >> { > >> builtin_define ("__BPF__"); > >> + builtin_define ("__bpf__"); > >> > >> if (TARGET_BIG_ENDIAN) > >> builtin_define ("__BPF_BIG_ENDIAN__"); > >> -- > >> 2.30.2 > >> > > > > Having multiple choices in this case seems to just add confusion to > > users and making code search slightly more inconvenient. > > > > How much code uses LLVM specific __bpf__? Can it be migrated? Should > > LLVM undefine the macro instead? > > I agree that it would be better to support just one form of the target > macro. Having two alternative forms can only lead to problems. > > But I think the train left the station long ago to do any better: there > are files in the kernel tree that rely on __bpf__ and there may be BPF > programs around doing the same thing. Ok, thanks.
diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index 7e37e080808..9cb56cfb287 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -291,6 +291,7 @@ void bpf_target_macros (cpp_reader *pfile) { builtin_define ("__BPF__"); + builtin_define ("__bpf__"); if (TARGET_BIG_ENDIAN) builtin_define ("__BPF_BIG_ENDIAN__");