From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by mx.groups.io with SMTP id smtpd.web08.93.1606847262790986683 for ; Tue, 01 Dec 2020 10:27:43 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ispras.ru, ip: 83.149.199.84, mailfrom: cheptsov@ispras.ru) Received: from localhost.localdomain (unknown [77.232.9.83]) by mail.ispras.ru (Postfix) with ESMTPSA id 7631940D4004; Tue, 1 Dec 2020 18:27:39 +0000 (UTC) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Vitaly Cheptsov , Jian J Wang , Hao A Wu , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH] MdeModulePkg: Fix undefined reference to memcpy with XCODE5 Date: Tue, 1 Dec 2020 21:26:51 +0300 Message-Id: <20201201182651.32218-1-cheptsov@ispras.ru> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3098=0D =0D XCODE5 toolchain in NOOPT mode generates memcpy when trying=0D to copy PEI_CORE_FV_HANDLE structure. This breaks OVMF=0D compilation with XCODE5.=0D =0D CC: Jian J Wang =0D CC: Hao A Wu =0D CC: Jordan Justen =0D CC: Laszlo Ersek =0D CC: Ard Biesheuvel =0D Signed-off-by: Vitaly Cheptsov =0D ---=0D MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 ++--=0D MdeModulePkg/Core/Pei/PeiMain.h | 2 +-=0D MdeModulePkg/Core/Pei/Ppi/Ppi.c | 10 +++++-----=0D 3 files changed, 8 insertions(+), 8 deletions(-)=0D =0D diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/C= ore/Pei/Dispatcher/Dispatcher.c=0D index b9a279e..3369585 100644=0D --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c=0D +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c=0D @@ -1256,13 +1256,13 @@ EvacuateTempRam (=0D }=0D for (FvIndex =3D 0; FvIndex < Private->FvCount; FvIndex++) {=0D if (Private->Fv[FvIndex].FvHandle =3D=3D PeiCoreFvHandle.FvHandle) {=0D - PeiCoreFvHandle =3D Private->Fv[FvIndex];=0D + CopyMem (&PeiCoreFvHandle, &Private->Fv[FvIndex], sizeof (PEI_CORE_F= V_HANDLE));=0D break;=0D }=0D }=0D Status =3D EFI_SUCCESS;=0D =0D - ConvertPeiCorePpiPointers (Private, PeiCoreFvHandle);=0D + ConvertPeiCorePpiPointers (Private, &PeiCoreFvHandle);=0D =0D for (FvIndex =3D 0; FvIndex < Private->FvCount; FvIndex++) {=0D FvHeader =3D Private->Fv[FvIndex].FvHeader;=0D diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMai= n.h=0D index c27e8fc..daa48b4 100644=0D --- a/MdeModulePkg/Core/Pei/PeiMain.h=0D +++ b/MdeModulePkg/Core/Pei/PeiMain.h=0D @@ -542,7 +542,7 @@ ConvertPpiPointersFv (=0D VOID=0D ConvertPeiCorePpiPointers (=0D IN PEI_CORE_INSTANCE *PrivateData,=0D - PEI_CORE_FV_HANDLE CoreFvHandle=0D + IN PEI_CORE_FV_HANDLE *CoreFvHandle=0D );=0D =0D /**=0D diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Pp= i.c=0D index 541047d..0ad71d1 100644=0D --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c=0D +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c=0D @@ -1062,7 +1062,7 @@ ProcessPpiListFromSec (=0D VOID=0D ConvertPeiCorePpiPointers (=0D IN PEI_CORE_INSTANCE *PrivateData,=0D - PEI_CORE_FV_HANDLE CoreFvHandle=0D + IN PEI_CORE_FV_HANDLE *CoreFvHandle=0D )=0D {=0D EFI_FV_FILE_INFO FileInfo;=0D @@ -1079,16 +1079,16 @@ ConvertPeiCorePpiPointers (=0D //=0D // Find the PEI Core in the BFV in temporary memory.=0D //=0D - Status =3D CoreFvHandle.FvPpi->FindFileByType (=0D - CoreFvHandle.FvPpi,=0D + Status =3D CoreFvHandle->FvPpi->FindFileByType (=0D + CoreFvHandle->FvPpi,=0D EFI_FV_FILETYPE_PEI_CORE,=0D - CoreFvHandle.FvHandle,=0D + CoreFvHandle->FvHandle,=0D &PeiCoreFileHandle=0D );=0D ASSERT_EFI_ERROR (Status);=0D =0D if (!EFI_ERROR (Status)) {=0D - Status =3D CoreFvHandle.FvPpi->GetFileInfo (CoreFvHandle.FvPpi, PeiCor= eFileHandle, &FileInfo);=0D + Status =3D CoreFvHandle->FvPpi->GetFileInfo (CoreFvHandle->FvPpi, PeiC= oreFileHandle, &FileInfo);=0D ASSERT_EFI_ERROR (Status);=0D =0D Status =3D PeiGetPe32Data (PeiCoreFileHandle, &PeiCoreImageBase);=0D -- =0D 2.24.3 (Apple Git-128)=0D =0D