From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.3792.1595469382947458126 for ; Wed, 22 Jul 2020 18:56:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=aZhrwXlc; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: bob.c.feng@intel.com) IronPort-SDR: 2UFPtAELx4f1EGE8dwQzBuMO6zPB+wpYAfHx6qslC2+5mrhFzcVO+QEPPhWjjeKljfmuk14s4e grAwd6uhOjbw== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="235321181" X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="235321181" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2020 18:56:21 -0700 IronPort-SDR: uzkXf608qFyKj59nqmkMEqrG/XD89Yb1Xt7u22edtqcA4unI09hT2JN86p7PlgFQJ2IxK2P0hP KFK6XVwPYOSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="302148580" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga002.jf.intel.com with ESMTP; 22 Jul 2020 18:56:21 -0700 Received: from orsmsx122.amr.corp.intel.com (10.22.225.227) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Jul 2020 18:56:20 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX122.amr.corp.intel.com (10.22.225.227) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Jul 2020 18:56:20 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Jul 2020 18:56:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aez+Xc1ds/JMb2FF+O2N3BFQhT7wa8YVCwoke+RNjlrlsYk5v5jhtgSbUzBmp4mG+IUSa+Pp7GCb6GuL+Nxr5R5+hqfH3C16DJJj2n8nZwFf1auDCMemQPcfIzn/Q/zfD2VH3GFUcH3W9yFhqqSqVDQfyQ+/zczRPVA+DZOMRVBFLfi/p69aRrtT9apYSajIjr6DphgeqaGMve2XPN6VcbUG27ejiV8qa1banq66mvM53eeH+qyZ20ClaeQZr7kJyCrK4cJDhw/SfNVDe0sNexyW1QNiEU7LpQ4FkP5VRsbooSCKlJ7E9rmdQzBH3evOH/Dhlq9JMrAJ3F+Y6ivu2A== 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=erWCY0dO21n3HAZQOUDccJWZDkSOr0onPNukDFqdIdY=; b=i1DQH2/hxCGWOQpNEwV9/geSo1fBgPQcm8m8CJEFa46xGR1ewsBomP8GJse2Mir6evLB4WTowjmPB10eCU+umEQFXOCPHxghVRprY8GCUfTEBPdGxt+gZ8Ytfr/Kt3WwnIeRwuRziy5Hd+f2gQof38mDfob0OFLhtW8tnMzrgU1BwY4Agj4v8aBAuiuoAgm4XdqNEwaEshozfGB1fU3SkxY2D3XdtMlV5SoExLnIO8uDt2jGi/mD06Ix0MSZiN0UoFdVSP6egE/DjOButM9Ppm2Q7e/C2CDmshy0VgQD94SquYkanIEMPK3M8dE49Pvs6zz5ovjx96DiKMqjJFFgOg== 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=erWCY0dO21n3HAZQOUDccJWZDkSOr0onPNukDFqdIdY=; b=aZhrwXlctSkyBGj17Zgdytm9WqCTzdnUSoRgpXnUxl9d0UUly/egATHc2fOafHczUh0GUcbdAiy4zaexhGM7LdbSc2eULijJByi7/wRWn9K8ClMeIVyXFWlV/PU6VDo5/RieLJxCTq6bLpgcnPj1ba9L4LtOYxgKlSVKlsymkAM= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN8PR11MB3779.namprd11.prod.outlook.com (2603:10b6:408:8a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21; Thu, 23 Jul 2020 01:56:18 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069%3]) with mapi id 15.20.3216.023; Thu, 23 Jul 2020 01:56:18 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "leif@nuviainc.com" CC: PierreGondois , "Gao, Liming" , "tomas@nuviainc.com" Subject: Re: [edk2-devel] [PATCH V2 1/2] BaseTools: Add gcc flag to warn on void* pointer arithmetic Thread-Topic: [edk2-devel] [PATCH V2 1/2] BaseTools: Add gcc flag to warn on void* pointer arithmetic Thread-Index: AQHWVDmfe0wkQbzBeUWGwVg6onp8AKkLggvggAh65QCAAG790A== Date: Thu, 23 Jul 2020 01:56:18 +0000 Message-ID: References: <20200707083522.138944-1-pierre.gondois@arm.com> <20200707083522.138944-2-pierre.gondois@arm.com> <20200722180534.GG1337@vanye> In-Reply-To: <20200722180534.GG1337@vanye> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ab496871-44c4-4a4f-373a-08d82eab9748 x-ms-traffictypediagnostic: BN8PR11MB3779: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SS1cyokeQogpsEHy8nJ5frZLboX3WuaRygveCEgK097tgTfzxSabWmuNVPCtFdQv4/Kinhy/0NAm2zIYVJSu3XNy8YMdAXvMDQmikqEkJWl5Pm2D37HJOPKn0hT29eNvI3XEzr2Jd/j9TLRq9SiArXySMeS3udgNM0QTt7lEC1O/oGFK4UTS2HlYxl8E+Of1AHVJxzKkx25mqg3wBYCKU/ITL5A9mF+XbnuXqKbStnQ/lziTjQrIfDpFgDjrBHaZXTW35Yq3j0Fg1ILKYIJ7uMGuMxYYZ0fiyYM8QZ6k+JE5BrOqc1Bxi0mdIZxpE2Qx+11+NuKtCEC56mJ1bHkdgXQPsYBevM7Qi7Ucuz2G+Ch7dICuJZ04Zl4d3IYDpjw6RBE69TMrb6IDbLQ/Hh43Jg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(396003)(366004)(346002)(39860400002)(376002)(45080400002)(5660300002)(478600001)(53546011)(71200400001)(4326008)(6506007)(86362001)(316002)(33656002)(55016002)(110136005)(54906003)(76116006)(64756008)(66446008)(66556008)(66476007)(66946007)(8936002)(8676002)(966005)(7696005)(83380400001)(26005)(186003)(9686003)(2906002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 915Ly+VMR2eWibJCvZrf6e23zk1eIsis34XJ7cXpDJe5amFErPJO/ywUOcyd1AwJavN3ZzUS65HJs2xWvNl5Bl5qhHWl1/Vfbc1XXdnSdqDHQ0GAikptrn6AoGmMg/AVYibSbFuNQCUPSq8VkMYkzTbKm4tWIFkTg//IAcVaARIAd2jd9PygE6J8vl+Bup3lIM1JasYerhzA770I8Wc8WwcITwkzHl+MeoR8mj6YdMwIUdgnXLYweZDN56ncs4lMUBFbQfG0YvFtnBj0RU1/uG663uUMg+PR3I+e4XcHvIm84togHjpIx58xFrgD3KaYxTkCohK9kovgKB7my4bBKP72bmiaEEWADYPtPbR48RpJfx0lR6KLeHXVT3NcMDEC/+Q7cMbbcOml1AQlMycddvtZkMRyXLINc9o1wJgNa9038Yopsr78rL090luJjwbffxbU5SWyeS6AeKlzhQ0t7FDiytaZ9kvEdCSbQK5Bt8x+TDWK13i79tmNVJmwZiX1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0068.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab496871-44c4-4a4f-373a-08d82eab9748 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2020 01:56:18.3323 (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: WPIJ/1YN0PK1fQbCKvwFkJYRqjQH2yx8tdJUnxsTJ2vcWgs9Ai8UbJLQgW/0MSnrL5K4E8IvZaEp4128Wbh+IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3779 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif I agree to revert that patch for now and I sent a revert patch for review.= After resolving the build break issue for ARM/AARCH64 platforms in edk2-pl= atforms, and make sure there is no platform build break with this patch, we= will push it again. Thanks, Bob=20 -----Original Message----- From: devel@edk2.groups.io On Behalf Of Leif Lindho= lm Sent: Thursday, July 23, 2020 2:06 AM To: devel@edk2.groups.io; Feng, Bob C Cc: PierreGondois ; Gao, Liming ; tomas@nuviainc.com Subject: Re: [edk2-devel] [PATCH V2 1/2] BaseTools: Add gcc flag to warn o= n void* pointer arithmetic Hi Bob, This patch also breaks about half of the ARM/AARCH64 platforms in edk2-pla= tforms. I agree it should go in at a later stage, but for now, can we pleas= e revert it? Regards, Leif On Mon, Jul 20, 2020 at 04:10:27 +0000, Bob Feng wrote: > Reviewed-by: Bob Feng >=20 >=20 > -----Original Message----- > From: PierreGondois > Sent: Tuesday, July 7, 2020 4:35 PM > To: devel@edk2.groups.io > Cc: Pierre Gondois ; Feng, Bob C=20 > ; Gao, Liming ;=20 > tomas.pilar@arm.com; nd@arm.com > Subject: [PATCH V2 1/2] BaseTools: Add gcc flag to warn on void*=20 > pointer arithmetic >=20 > From: Pierre Gondois >=20 > By default, gcc allows void* pointer arithmetic. > This is a GCC extension. > However: > - the C reference manual states that void* > pointer "cannot be operands of addition > or subtraction operators". Cf s5.3.1 > "Generic Pointers"; > - Visual studio compiler treat such operation as > an error. >=20 > To prevent such pointer arithmetic, the "-Wpointer-arith" > flag should be set for all GCC versions. >=20 > The "-Wpointer-arith" allows to: > "Warn about anything that depends on the "size of" > a function type or of void. GNU C assigns these > types a size of 1, for convenience in calculations > with void * pointers and pointers to functions." >=20 > This flag is available since GCC2.95.3 which came out in 2001. >=20 > Signed-off-by: Pierre Gondois > --- >=20 > The changes can be seen at:=20 > https://github.com/PierreARM/edk2/commits/831_Add_gcc_flag_warning_v2 >=20 > Notes: > v1: > - Add "-Wpointer-arith" gcc flag. [Pierre] > v2: > - Only add the flag for ARM and AARCH64. [Tomas] >=20 > BaseTools/Conf/tools_def.template | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/BaseTools/Conf/tools_def.template=20 > b/BaseTools/Conf/tools_def.template > index=20 > 8aeb8a2a6417e41c5660cda5066f52adc8cc3089..397b011ba38f97f81f314f8641ac > 8bb95d5a2197 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1,7 +1,7 @@ > # > # Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 > reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All=20 > rights reserved.
-# Portions copyright (c) 2011 - 2019, ARM Ltd.=20 > All rights reserved.
> +# Portions copyright (c) 2011 - 2020, ARM Ltd. All rights=20 > +reserved.
> # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
#= (C) Copyright 2020, Hewlett Packard Enterprise Development LP
# Cop= yright (c) Microsoft Corporation > @@ -1921,9 +1921,9 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG =3D --add-gnu-d= ebuglink=3D$(DEBUG_DIR)/$(MODULE_N > DEFINE GCC_ALL_CC_FLAGS =3D -g -Os -fshort-wchar -fno-builti= n -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -= fno-common > DEFINE GCC_IA32_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -m32 -mali= gn-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-ar= g-probe > DEFINE GCC_X64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -mno-red-z= one -Wno-address -mno-stack-arg-probe > -DEFINE GCC_ARM_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -mlittle-e= ndian -mabi=3Daapcs -fno-short-enums -funsigned-char -ffunction-sections -f= data-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=3Dsoft = -fno-pic -fno-pie > +DEFINE GCC_ARM_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -Wpointer-= arith -mlittle-endian -mabi=3Daapcs -fno-short-enums -funsigned-char -ffunc= tion-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mf= loat-abi=3Dsoft -fno-pic -fno-pie > DEFINE GCC_ARM_CC_XIPFLAGS =3D -mno-unaligned-access > -DEFINE GCC_AARCH64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -mlittle-e= ndian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -= fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tab= les -fno-pic -fno-pie -ffixed-x18 > +DEFINE GCC_AARCH64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -Wpointer-= arith -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunc= tion-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables = -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 > DEFINE GCC_AARCH64_CC_XIPFLAGS =3D -mstrict-align -mgeneral-regs-on= ly > DEFINE GCC_DLINK_FLAGS_COMMON =3D -nostdlib --pie > DEFINE GCC_DLINK2_FLAGS_COMMON =3D -Wl,--script=3D$(EDK_TOOLS_PATH)= /Scripts/GccBase.lds > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >=20 >=20 >=20 >=20