回复: [edk2-devel] [edk2] [PATCH v1 1/1] OvmfPkg/TdxDxe: Remove AsmRelocateApMailBoxLoopStart prefix at call


gaoliming
 

Min:
This failure is introduced by the commit b22ac35b754d1a071e0b40adc47f7c53c3d77893 OvmfPkg: Update PlatformInitLib to process Tdx hoblist from you. Can you provide the hot fix for this stable tag 202205? This stable tag will be released on tomorrow.

lld-link: error: undefined symbol: memcpy
referenced by e:\code\edk2github\OvmfPkg\Library\PlatformInitLib\IntelTdx.c:191
PlatformInitLib.lib(IntelTdx.obj):(ValidateHobList)
Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Rebecca Cran
发送时间: 2022年5月26日 9:27
收件人: devel@edk2.groups.io; theojehl76@...
抄送: Ard Biesheuvel <ardb+tianocore@...>; Jiewen Yao
<jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd
Hoffmann <kraxel@...>
主题: Re: [edk2-devel] [edk2] [PATCH v1 1/1] OvmfPkg/TdxDxe: Remove
AsmRelocateApMailBoxLoopStart prefix at call

Reviewed-by: Rebecca Cran <quic_rcran@...>
Tested-by: Rebecca Cran <quic_rcran@...>

This lets the build get further, before it runs into Availability.h not
being found.

If I download
http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/A
vailability.h
and
http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/A
vailabilityInternal.h
into MdePkg/Include
(which is very much a hack) then the DEBUG and RELEASE builds succeed.

However, NOOPT fails with code generating a call to _memcpy:

Undefined symbols for architecture x86_64:
"_memcpy", referenced from:
_ValidateHobList in PlatformInitLib.lib(IntelTdx.obj)
ld: symbol(s) not found for architecture x86_64
"libtool" -static -o
/Users/bcran/src/uefi/edk2/Build/OvmfX64/NOOPT_XCODE5/X64/MdeModu
lePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/OUTPUT/CapsuleR
untimeDxe.lib
-filelist
/Users/bcran/src/uefi/edk2/Build/OvmfX64/NOOPT_XCODE5/X64/MdeModu
lePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/OUTPUT/object_fil
es.lst
make: ***
[/Users/bcran/src/uefi/edk2/Build/OvmfX64/NOOPT_XCODE5/X64/OvmfPkg
/Sec/SecMain/DEBUG/SecMain.dll]
Error 1


build.py...
: error 7000: Failed to execute command
make tbuild
[/Users/bcran/src/uefi/edk2/Build/OvmfX64/NOOPT_XCODE5/X64/OvmfPkg
/Sec/SecMain]


build.py...
: error F002: Failed to build module
/Users/bcran/src/uefi/edk2/OvmfPkg/Sec/SecMain.inf [X64, XCODE5,
NOOPT]



On 5/25/22 17:54, Théo Jehl wrote:
From: Theo Jehl <theojehl76@...>

Removed prefix to match AsmRelocateApMailBoxLoopStart declaration.
This fixes a compilation issue.

Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Gerd Hoffmann <kraxel@...>
Signed-off-by: Jehl Theo <theojehl76@...>
---
OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm
b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm
index a859375fb819..52fb3b4944bf 100644
--- a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm
+++ b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm
@@ -83,7 +83,7 @@ AsmRelocateApMailBoxLoopEnd:
;-------------------------------------------------------------------------------------
global ASM_PFX(AsmGetRelocationMap)
ASM_PFX(AsmGetRelocationMap):
- lea rax, [ASM_PFX(AsmRelocateApMailBoxLoopStart)]
+ lea rax, [AsmRelocateApMailBoxLoopStart]
mov qword [rcx], rax
mov qword [rcx + 8h], AsmRelocateApMailBoxLoopEnd -
AsmRelocateApMailBoxLoopStart
ret



Join devel@edk2.groups.io to automatically receive all group messages.