From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.8132.1584015691114523935 for ; Thu, 12 Mar 2020 05:21:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2020 05:21:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,544,1574150400"; d="scan'208";a="442031703" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 12 Mar 2020 05:21:30 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Mar 2020 05:21:30 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 12 Mar 2020 05:21:29 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 12 Mar 2020 05:21:29 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.86]) with mapi id 14.03.0439.000; Thu, 12 Mar 2020 20:21:27 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "leif@nuviainc.com" , "daniel.schaefer@hpe.com" CC: Abner Chang , Gilbert Chen , "Bi, Dandan" , "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Thread-Topic: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Thread-Index: AQHV8H4Grpqeo7cGt0alci2kOXMgWqhEUmMAgACcW2A= Date: Thu, 12 Mar 2020 12:21:26 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C4938CD@SHSMSX104.ccr.corp.intel.com> References: <20200302103238.25726-1-daniel.schaefer@hpe.com> <20200302103238.25726-4-daniel.schaefer@hpe.com> <20200312105528.GC23627@bivouac.eciton.net> In-Reply-To: <20200312105528.GC23627@bivouac.eciton.net> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Leif, Does CompilerIntrinsicsLib exist because GCC doesn't support to disable in= trinsic? How does the linker find the CompilerInstrinsicsLib in linking phase? Thanks, Ray > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Leif > Lindholm > Sent: Thursday, March 12, 2020 6:55 PM > To: devel@edk2.groups.io; daniel.schaefer@hpe.com > Cc: Abner Chang ; Gilbert Chen > ; Bi, Dandan ; Dong, Eric > > Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem > instead of GUID assignment >=20 > Hi Daniel, >=20 > There is nothing wrong with this patch that just went in (and I should > have called out sooner if I wanted to stop it), but I think a better > solution is to implement a RISC-V variant of > ArmPkg/Library/CompilerIntrinsicsLib/. >=20 > It is perfectly valid for the compiler to generate memcpy calls in > response to struct operations that are perfectly valid C. >=20 > In fact, we could consider moving the ArmPkg one over into > MdeModulePkg. I have a feeling that including a > NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > in your current build would be an alternative solution to your > compilation error. >=20 > / > Leif >=20 > On Mon, Mar 02, 2020 at 11:32:38 +0100, Daniel Schaefer wrote: > > GCC translates a simple assignment to memcpy, which EDKII doesn't > provide. > > See: https://www.mail-archive.com/edk2- > devel@lists.01.org/msg11928.html > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2547 > > > > Signed-off-by: Daniel Schaefer > > Cc: Abner Chang > > Cc: Gilbert Chen > > Cc: Leif Lindholm > > Cc: Dandan Bi > > Cc: Eric Dong > > --- > > > > Notes: > > v2: > > - Use CopyMem instead of CopyGuid [Dandan] > > > > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > index 5cc527679a78..0540e6fa8a44 100644 > > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > @@ -619,7 +619,7 @@ CreateDeviceManagerForm( > > TokenHelp =3D HiiSetString (HiiHandle, 0, String, NULL); > > FreePool (String); > > > > - FormSetGuid =3D ((EFI_IFR_FORM_SET *)Ptr)->Guid; > > + CopyMem (&FormSetGuid, &((EFI_IFR_FORM_SET *) Ptr)->Guid, > sizeof (EFI_GUID)); > > > > // > > // Network device process > > -- > > 2.25.0 > > > > > > > > >=20 >=20