From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.11067.1595298586847011091 for ; Mon, 20 Jul 2020 19:29:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=dD9b8/fH; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: liming.gao@intel.com) IronPort-SDR: UKquDogI81JhCtJYGKOhGxQECqKJdh9KF+fUKyppyTugOd69F2+W+OU4Fv9HsmHrI1Po6assMo IbXMtJ7PDdIw== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="151393584" X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="151393584" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 19:29:46 -0700 IronPort-SDR: SH/NVnQr5loBkvSEyWmwhCZmJxoiYA/TnDjpE4U0IP/bN7P0H05nkazxTTZx8xRR0z1JUVWine 7ht0Nf/lv+7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="301462156" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by orsmga002.jf.intel.com with ESMTP; 20 Jul 2020 19:29:46 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 19:29:45 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX161.amr.corp.intel.com (10.22.240.84) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 19:29:45 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 19:29:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EJ//OAeOvCA+sJ3J7+AcFxNA7/gD1rwcxLO/fml3fDKvG58wWB4rhOTTMGAtFMsFirWwlgSPTKWcvFnDe4t402gn1DZLFiMiKaydXRN6/B+fYeHy1Rf9pyu/TIsH7Aq3ycv1ENxOYl3gJHNMx8QF/XNZl9YSvhJsp/FJhn3m9MlN7aoAuJ91+Ee9SHv/kl42YRk31sTf7ZAU4HlyJjjFbitT5fHGKJt/RSf+DjwU3v91/LTaFY3+mbDW2hTU8Fq29E5eje7rNkXLlm15e3Mj8lOZ65P2ODpqGdv39Crj5YrprRo0uxbaFD6iRvkqpq5xnruBSsM7ARUyKv1hcTj0hA== 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-SenderADCheck; bh=q0Pk67xWzMqBTDV1GeuxnKv6esHrKqojshJovP92FRM=; b=Xu1j9sNDH82mSlY/YJLNVLPflrY0293YFiPE8/PqdiO0erk07omOa6gnPBv7dYXX06m4Tvng2G13BKK6c7piMgpdu5ED6/TM/1b3xTUKdQuP3JiduN4osraBWNBYIND2PEvVdoW3XBGTvoEs+PFKMNhfC4+nMvqowlVX+sqHmxJnDgpc1C3bJIO3gkpmYurx0BFLOP2M8zlZb96vOWzXWwtqpy62dT5nsA3P7wBaeah+ZEu61Dwe+bPsvbdx2q1S+fhNEuTxGcnrdhkRf42tXeBCPTAHSQXlnjltciU26D4LJhV7T4YZNTEkdNZrCKLZb6xq15X9lMP8wfqhkawOIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q0Pk67xWzMqBTDV1GeuxnKv6esHrKqojshJovP92FRM=; b=dD9b8/fHHYWKFOzkmyPlWI4vStOI0Dd/qP7jqtdDEBtAYpJaoka15ObOJHmE8xWX+rs+1MJD60vRYP8TtDOgHoZD9czP9aDcGQO2JyERqwqVP3SP5CGXLJbRAQOQv8u815qJzb7XY7bvrj2eauF8bmeGdXbfvzt3a+UmbZDUiL8= Received: from MWHPR11MB1630.namprd11.prod.outlook.com (2603:10b6:301:e::7) by MWHPR11MB1677.namprd11.prod.outlook.com (2603:10b6:301:c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Tue, 21 Jul 2020 02:29:44 +0000 Received: from MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e]) by MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e%6]) with mapi id 15.20.3195.025; Tue, 21 Jul 2020 02:29:44 +0000 From: "Liming Gao" To: Jessica Clarke CC: "devel@edk2.groups.io" , "leif@nuviainc.com" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH] MdePkg Base.h: Delete prototype for __builtin_return_address Thread-Topic: [edk2-devel] [PATCH] MdePkg Base.h: Delete prototype for __builtin_return_address Thread-Index: AQHWXp7MrDF3nWgtXUeDcNm/EMifTakQjqnAgAACxYCAAL3gwA== Date: Tue, 21 Jul 2020 02:29:43 +0000 Message-ID: References: <20200720134946.33723-1-jrtc27@jrtc27.com> <20200720140446.GP12303@vanye> <1872CF8A-5DEE-4F17-B1C5-3E0E243594C8@jrtc27.com> In-Reply-To: <1872CF8A-5DEE-4F17-B1C5-3E0E243594C8@jrtc27.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: jrtc27.com; dkim=none (message not signed) header.d=none;jrtc27.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ffd7ebf8-1756-498e-2d3c-08d82d1dedd6 x-ms-traffictypediagnostic: MWHPR11MB1677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:519; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Wkiq5Qh2agDqZmZWBipdBzLQ9BELM0EUKjbmaWydHtJQkVJrCv9FGfzrNiBqVxnn9TXLtG6da4SV7aJXMcyQqsBNmme86OnGEZQdhNofz0MupCBoKZjj3HzJZB5pcl/nOYqi3oZKojmJOYSqhhtLMuDMsIrtXbw/AFOnrmmI820HS7QqnM33IROIqIpHnCabVg1TpYajdT6rSjqxTAhVvJUt/Hulr8Z+9smXOkNafR20ebVGJX3flicPYhd0aIYSATYLGO8QxXhZaQPTiUJ70rm6Dt7lDmlJEZ1gU9AeW7fqV9jgFm/NQD1RA47T6fz4o5EzCh8vnGJixJXxAosAVizbDB9nVQmLtRhjp+bhD25hKQwUFKBTSL6fpFzi4YuZnutatqupNLfb0eyT6HkDwQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1630.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(376002)(396003)(366004)(346002)(136003)(66946007)(966005)(64756008)(66476007)(76116006)(66556008)(7696005)(55016002)(86362001)(9686003)(2906002)(107886003)(66446008)(6916009)(83380400001)(8676002)(8936002)(33656002)(26005)(186003)(53546011)(6506007)(52536014)(54906003)(71200400001)(5660300002)(4326008)(316002)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: YMV3cmDsuyE+J8YC9N8U+7N5Sy0vzUEj1keaf8d9o+fsPv/DiAddJ2llBVfbrH/Z+H2I/LfwRc2jQI2ICxr/6DHH/vQ7yvTdpqXG0JtZsoovixCQwBF9WDBZBbh3hcJFYfsCpQXTT10OdWZuASn07ioQUmJZ8d0+b98Lco/SaVZK654+/rba2YaF0ADwZr3Ioq3kMBahLKNb0sArSgHpBVpC49ccsKstifKAJSIcV7hzw+eNStVfB6Z5iNliUoEHHKeRrNlnmdX9t0ZlbNeYtvvQfh6zVDGiU0CfmTSoYLVlur90Efet04NDhDg5xn4doY3b/O8oA1AvUQTNc/gtIxvmzEbHT82NRDn9DcPoXJhBv1vO9pHPZzvNjwvXNUF2qK5d16gMvF8D0lmMFV9h2NW8IPuho8acRznTgSbDXO6Y7fkr/c0dEHrqe6U6RndHSF7jucWZat6VZ/QADwzpTm1cKxXYQn/NSDq/o5P0+PVj0/bi3eFz48LFjyhFyOKT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1630.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffd7ebf8-1756-498e-2d3c-08d82d1dedd6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 02:29:43.8913 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pm1/M6K/J1OJaOWCQfdn4xZaI5UHervKVJHIkKLS1cNuV00C8noSo409PczYLqSv579E/zDWSYv0KLnvGmGKzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1677 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Jess: OK. Seemly, there is no impact with this change. Reviewed-by: Liming Gao= Thanks Liming -----Original Message----- From: Jessica Clarke =20 Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B20=1B$BF|=1B(B 23:06 To: Gao, Liming Cc: devel@edk2.groups.io; leif@nuviainc.com; Kinney, Michael D Subject: Re: [edk2-devel] [PATCH] MdePkg Base.h: Delete prototype for __bu= iltin_return_address It will always look like void *__builtin_return_address(unsigned) and work= like that, just that under the hood it's being implemented slightly differ= ently, which has the unfortunate side-effect of triggering this bug. We've = been compiling the embedded EDK2 in our CheriBSD with that line deleted for= years now with no issue. Jess > On 20 Jul 2020, at 15:58, Gao, Liming wrote: >=20 > Clarke: > Do you mean CLANG compiler may have the different prototype for __built= in_return_address()? If so, dose __builtin_return_address (L) always work?= =20 >=20 > Thanks > Liming >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Leif=20 >> Lindholm >> Sent: Monday, July 20, 2020 10:05 PM >> To: Jessica Clarke >> Cc: devel@edk2.groups.io; Kinney, Michael D=20 >> ; Gao, Liming >> Subject: Re: [edk2-devel] [PATCH] MdePkg Base.h: Delete prototype for= =20 >> __builtin_return_address >>=20 >> +Mike, Liming >>=20 >> On Mon, Jul 20, 2020 at 14:49:46 +0100, Jessica Clarke wrote: >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1004 >>>=20 >>> Being a compiler builtin, the type of __builtin_return_address is=20 >>> already known to the compiler so no prototype is needed. Clang also=20 >>> errors out when redeclaring certain builtins like this[1], though=20 >>> currently only for ones with custom type checking. At the moment,=20 >>> __builtin_return_address does not use custom type checking and so=20 >>> does not trigger this error, however, the CHERI fork of LLVM, which=20 >>> will form the basis of the toolchain for Arm's experimental Morello=20 >>> platform, does use custom type checking for it, and so gives an=20 >>> error. Thus, simply delete the unnecessary line. >>>=20 >>> [1]=20 >>> https://github.com/llvm/llvm-project/commit/41af97137572ad6d4dafc872 >>> e7ecf6bbb08d4984 >>>=20 >>> Cc: Leif Lindholm >>> Signed-off-by: Jessica Clarke >>> --- >>> MdePkg/Include/Base.h | 1 - >>> 1 file changed, 1 deletion(-) >>>=20 >>> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index=20 >>> 85a091b9d5..8e4271f6ea 100644 >>> --- a/MdePkg/Include/Base.h >>> +++ b/MdePkg/Include/Base.h >>> @@ -1273,7 +1273,6 @@ typedef UINTN RETURN_STATUS; >>> **/ >>> #define RETURN_ADDRESS(L) ((L =3D=3D 0) ? _ReturnAddress() : (VO= ID *) 0) >>> #elif defined (__GNUC__) || defined (__clang__) >>> - void * __builtin_return_address (unsigned int level); >>=20 >> Agreed this looks somewhat bonkers. >> And I can't see any ill effects from dropping it, so: >> Reviewed-by: Leif Lindholm >>=20 >>> /** >>> Get the return address of the calling function. >>>=20 >>> -- >>> 2.20.1 >>>=20 >>=20 >>=20 >=20