I think we need to -D OPENSSL_NO_APPLE_CRYPTO_RANDOM in the INF.

Thanks,

Andrew Fish

> On May 25, 2022, at 7:39 PM, Rebecca Cran <quic_rc...@quicinc.com> wrote:
> 
> It's Library/OpensslLib/openssl/include/crypto/rand.h
> 
> # include <openssl/rand.h>
> 
> # if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
> #  include <Availability.h>
> #  if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && 
> __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || \
>      (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && 
> __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
> #   define OPENSSL_APPLE_CRYPTO_RANDOM 1
> #   include <CommonCrypto/CommonCryptoError.h>
> #   include <CommonCrypto/CommonRandom.h>
> #  endif
> # endif
> 
> 
> -- 
> Rebecca Cran
> 
> On 5/25/22 20:22, Andrew (EFI) Fish wrote:
>> What is pulling in Availability.h? That sound more like and #ifdef issue in 
>> some 3rd party header?
>> 
>> I think I might have seen that in SSL headers?
>> 
>> Sent from my iPhone
>> 
>>> On May 25, 2022, at 6:26 PM, Rebecca Cran <quic_rc...@quicinc.com> wrote:
>>> 
>>> Reviewed-by: Rebecca Cran <quic_rc...@quicinc.com>
>>> Tested-by: Rebecca Cran <quic_rc...@quicinc.com>
>>> 
>>> 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/Availability.h
>>>  and
>>> http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AvailabilityInternal.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/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/OUTPUT/CapsuleRuntimeDxe.lib
>>>  -filelist 
>>> /Users/bcran/src/uefi/edk2/Build/OvmfX64/NOOPT_XCODE5/X64/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/OUTPUT/object_files.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 <theojeh...@gmail.com>
>>>> 
>>>> Removed prefix to match AsmRelocateApMailBoxLoopStart declaration.
>>>> This fixes a compilation issue.
>>>> 
>>>> Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
>>>> Cc: Jiewen Yao <jiewen....@intel.com>
>>>> Cc: Jordan Justen <jordan.l.jus...@intel.com>
>>>> Cc: Gerd Hoffmann <kra...@redhat.com>
>>>> Signed-off-by: Jehl Theo <theojeh...@gmail.com>
>>>> ---
>>>>  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
>>> 
>>> 
>>> 
>>> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90031): https://edk2.groups.io/g/devel/message/90031
Mute This Topic: https://groups.io/mt/91344827/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to