Hi Daniel,
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/.
It is perfectly valid for the compiler to generate memcpy calls in
response to struct operations that are perfectly valid C.
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.
/
Leif
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://urldefense.proofpoint.com/v2/url?u=https-3A__www.mail-2Darchive.com_edk2-2Ddevel-40lists.01.org_msg11928.html&d=DwIBAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=wVtkBG7Yvxr1ZwGC2X-DFznM8iUD7og3137fRa2yRiU&m=OH3BPEpUySzO08XGI-6pvl4Uo-7mUgOsaf-jKHSCoJM&s=pUtOxfKtpYxlYwtDHP8hhRZ8QJ52whxSqi285877XsM&e=
>
> REF:
https://bugzilla.tianocore.org/show_bug.cgi?id=2547
>
> Signed-off-by: Daniel Schaefer
<daniel.schaefer@hpe.com>
> Cc: Abner Chang
<abner.chang@hpe.com>
> Cc: Gilbert Chen
<gilbert.chen@hpe.com>
> Cc: Leif Lindholm
<leif@nuviainc.com>
> Cc: Dandan Bi
<dandan.bi@intel.com>
> Cc: Eric Dong
<eric.dong@intel.com>
> ---
>
> 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 = HiiSetString (HiiHandle, 0, String, NULL);
> FreePool (String);
>
> - FormSetGuid = ((EFI_IFR_FORM_SET *)Ptr)->Guid;
> + CopyMem (&FormSetGuid, &((EFI_IFR_FORM_SET *) Ptr)->Guid, sizeof (EFI_GUID));
>
> //
> // Network device process
> --
> 2.25.0
>
>
>
>