public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* CryptoPkg build broken using XCODE5 (Availability.h not found)
@ 2022-03-29 17:33 Rebecca Cran
  2022-03-29 22:34 ` [edk2-devel] " Andrew Fish
  0 siblings, 1 reply; 2+ messages in thread
From: Rebecca Cran @ 2022-03-29 17:33 UTC (permalink / raw)
  To: devel, Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang

A build of CryptoPkg with XCODE5 on macOS is now trying to include 
Availability.h, which isn't found:

In file included from 
/Users/bcran/src/uefi/edk2/CryptoPkg/Library/OpensslLib/openssl/crypto/init.c:13:
/Users/bcran/src/uefi/edk2/CryptoPkg/Library/OpensslLib/openssl/include/crypto/rand.h:24:12: 
fatal error: 'Availability.h' file not found
#  include <Availability.h>
            ^~~~~~~~~~~~~~~~

This is because of the following in 
CryptoPkg/Library/OpensslLib/openssl/include/crypto/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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] CryptoPkg build broken using XCODE5 (Availability.h not found)
  2022-03-29 17:33 CryptoPkg build broken using XCODE5 (Availability.h not found) Rebecca Cran
@ 2022-03-29 22:34 ` Andrew Fish
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Fish @ 2022-03-29 22:34 UTC (permalink / raw)
  To: edk2-devel-groups-io, Rebecca Cran
  Cc: Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]

Rebecca,

I got it to compile by doing this

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index cdeed0d073eb..72dbeb2795e8 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -595,8 +595,8 @@ [BuildOptions]
   # 3017: <entity> may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with
   #       commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)
   RVCT:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) --library_interface=aeabi_clib99 --diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCryptoPkg/Include
-  XCODE:*_*_IA32_CC_FLAGS   = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=c99 -Wno-error=uninitialized
-  XCODE:*_*_X64_CC_FLAGS    = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=c99 -Wno-error=uninitialized
+  XCODE:*_*_IA32_CC_FLAGS   = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM
+  XCODE:*_*_X64_CC_FLAGS    = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM
 
   #
   # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute


Thanks,

Andrew Fish

> On Mar 29, 2022, at 10:33 AM, Rebecca Cran <quic_rcran@quicinc.com> wrote:
> 
> A build of CryptoPkg with XCODE5 on macOS is now trying to include Availability.h, which isn't found:
> 
> In file included from /Users/bcran/src/uefi/edk2/CryptoPkg/Library/OpensslLib/openssl/crypto/init.c:13:
> /Users/bcran/src/uefi/edk2/CryptoPkg/Library/OpensslLib/openssl/include/crypto/rand.h:24:12: fatal error: 'Availability.h' file not found
> #  include <Availability.h>
>            ^~~~~~~~~~~~~~~~
> 
> This is because of the following in CryptoPkg/Library/OpensslLib/openssl/include/crypto/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
> 
> 
> 
> 
> 


[-- Attachment #2: Type: text/html, Size: 7015 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-29 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 17:33 CryptoPkg build broken using XCODE5 (Availability.h not found) Rebecca Cran
2022-03-29 22:34 ` [edk2-devel] " Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox