From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: suse.com, ip: 15.124.64.68, mailfrom: glin@suse.com) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) by groups.io with SMTP; Fri, 05 Jul 2019 01:01:47 -0700 Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.190) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Fri, 5 Jul 2019 08:01:45 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 5 Jul 2019 07:57:13 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.124.72.14) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 5 Jul 2019 07:57:12 +0000 Received: from DM6PR18MB2489.namprd18.prod.outlook.com (20.179.105.16) by DM6PR18MB3115.namprd18.prod.outlook.com (10.255.76.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Fri, 5 Jul 2019 07:57:11 +0000 Received: from DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::c953:1927:cc0a:dcae]) by DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::c953:1927:cc0a:dcae%7]) with mapi id 15.20.2032.019; Fri, 5 Jul 2019 07:57:11 +0000 From: "Gary Lin" To: "devel@edk2.groups.io" , "liming.gao@intel.com" CC: Danmei Wei , Farrah Chen , Xudong Hao Subject: Re: [edk2-devel] Make edk2 fail on Red Hat 8.0 Thread-Topic: [edk2-devel] Make edk2 fail on Red Hat 8.0 Thread-Index: AdUy/foPd3/thalCQDW9+wH/wOHzdwABMX9QAABIYwAAANXUgA== Date: Fri, 5 Jul 2019 07:57:11 +0000 Message-ID: <20190705075659.GB5004@GaryWorkstation> References: <1B925CC0CD9F3341B32D442251E7E1DC3E2E31ED@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E4A2C83@SHSMSX104.ccr.corp.intel.com> <15AE728890343D4F.21242@groups.io> In-Reply-To: <15AE728890343D4F.21242@groups.io> Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB8PR06CA0003.eurprd06.prod.outlook.com (2603:10a6:10:100::16) To DM6PR18MB2489.namprd18.prod.outlook.com (2603:10b6:5:184::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=GLin@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [202.47.205.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bee4af57-f3f5-4e36-ffb6-08d7011e62bd x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:DM6PR18MB3115; x-ms-traffictypediagnostic: DM6PR18MB3115: x-ms-exchange-purlcount: 4 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:883; x-forefront-prvs: 008960E8EC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(7916004)(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(189003)(199004)(64756008)(73956011)(486006)(11346002)(66476007)(476003)(66446008)(446003)(66556008)(71190400001)(5024004)(256004)(386003)(7736002)(5660300002)(33716001)(14444005)(2906002)(305945005)(8936002)(6436002)(2501003)(66946007)(33656002)(71200400001)(102836004)(86362001)(81156014)(6246003)(68736007)(53936002)(66066001)(316002)(110136005)(478600001)(3846002)(6506007)(6116002)(4326008)(72206003)(25786009)(26005)(229853002)(6306002)(53546011)(54906003)(6486002)(81166006)(186003)(52116002)(6512007)(966005)(9686003)(76176011)(1076003)(8676002)(14454004)(80792005)(99286004);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR18MB3115;H:DM6PR18MB2489.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: QxW+haEOb6eoNO4IrnhqE7PtfgVdPtLu1cnKpxH8bz7WtE8d8Q/6QC77wA33LEBfxwQ8rYZdzLbRQu3c26eaflJTwMgEWJ8VJ3qixmAqxRMJ31fEzI2M9LclmOb+akaNEV8CO72YtKLHI2DLMiU7U7YxMYFAKwtQ6nCBV0sekfvt0rSYBSzay04G1nq1+uQuJHlKlaNnkQyucaA3cYE9TmsYwOJPpfvl7fCHisBH3JwY+mNuIeowWZJKL3hOPrEUEFrlq7w5XFsOO9DYFoMt/qhnsj9dj4BW9L9NiD7Z7FrrS8OmkOVCjF3FA/QF2jiKsyS7WhLUF+GG+97+tywdzkTyundRVby6Rncik62CWvVi+QcfoKpZsrHvCoopJGsQtZ7lJYZE3MELvl9K+YajhIg6ls0UsROHRXe2sQf8iW8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bee4af57-f3f5-4e36-ffb6-08d7011e62bd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2019 07:57:11.6218 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GLin@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3115 Return-Path: GLin@suse.com X-OriginatorOrg: suse.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: <18E215A8BA55CC4CB73A6612C64E83E4@namprd18.prod.outlook.com> Content-Transfer-Encoding: quoted-printable On Fri, Jul 05, 2019 at 07:33:17AM +0000, Gary Lin wrote: > On Fri, Jul 05, 2019 at 07:25:18AM +0000, Liming Gao wrote: > > Can you let me know your GCC compiler version? > >=20 > I also encountered the error. My system is openSUSE Tumbleweed, and the > gcc version is 9.1.1. >=20 > It seems the new gcc is restricter on memset and strncat. >=20 Those warnings are legit. For example: memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH); UiName is CHAR16, so this line should be memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH * sizeof(CHAR16= )); For those strncat() statements, the third parameter of strncat() stands for the "available" space in the destination buffer, so using sizeof(SRC_STR) is actually very dangerous because it doesn't guarantee that the destination buffer has that many space for the string. Gary Lin > Gary Lin >=20 > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of = Chen, Farrah > > Sent: Friday, July 05, 2019 3:10 PM > > To: devel@edk2.groups.io > > Cc: Hao, Xudong ; Wei, Danmei > > Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0 > >=20 > > Hi, > >=20 > > I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323ad= ab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6. > > With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several da= ys ago, it works well on both RHEL8.0 and RHEL7.6. > >=20 > > Steps: > > git clone https://github.com/tianocore/edk2.git > > cd edk2 > > git submodule init > > git submodule update -recursive > > OvmfPkg/build.sh -a X64 -n 40 > > ............... > > make -C FMMT > > make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/F= MMT' > > gcc -c -I .. -I ../Include/Common -I ../Include/ -I ../Include/Indus= tryStandard -I ../Common/ -I .. -I . -I ../Include/X64/ -MD -fshort-wchar = -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror = -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-un= used-result -nostdlib -g -O2 FmmtLib.c -o FmmtLib.o > > FmmtLib.c: In function 'LibInitializeFvStruct': > > FmmtLib.c:158:5: error: 'memset' used with length equal to number of e= lements without multiplication by element size [-Werror=3Dmemset-elt-size] > > memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH); > > ^~~~~~ > > FmmtLib.c: In function 'LibFvHeaderAttributeToStr': > > FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is th= e same expression as the source; did you mean to use the size of the destin= ation? [-Werror=3Dsizeof-pointer-memaccess] > > strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n")); > > ^ > > FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is th= e same expression as the source; did you mean to use the size of the destin= ation? [-Werror=3Dsizeof-pointer-memaccess] > > strncat (LocalStr, "EFI_READ_DISABLED_CAP =3D TRUE \n", sizeof ("= EFI_READ_DISABLED_CAP =3D TRUE \n")); > > ..................... > >=20 > > And detailed log attached. > > Could anyone provide some advice? > >=20 > >=20 > > Thanks, > > Fan > >=20 > >=20 > >=20 > >=20 > >=20 >=20 >=20 >=20 >=20