From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rn-mailsvcp-ppex-lapp24.apple.com (rn-mailsvcp-ppex-lapp24.apple.com [17.179.253.38]) by mx.groups.io with SMTP id smtpd.web08.424.1648593275752514900 for ; Tue, 29 Mar 2022 15:34:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=Klk/b7z3; spf=pass (domain: apple.com, ip: 17.179.253.38, mailfrom: afish@apple.com) Received: from pps.filterd (rn-mailsvcp-ppex-lapp24.rno.apple.com [127.0.0.1]) by rn-mailsvcp-ppex-lapp24.rno.apple.com (8.16.1.2/8.16.1.2) with SMTP id 22TMTHER030646; Tue, 29 Mar 2022 15:34:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=voblKP8TVJ/1ghNl4gqq6+qXn5kVR6n4rXUZWbeQCFs=; b=Klk/b7z3Nt/4Gvl2eGWgKQHQjjHRIAz6sU+ZPKhKNa44xAFozOLwyoqXZfKoAKxEs/2s iR5lahPdOA3sK0f+5x/PE9yJKixe9jD2WZh/1xlRQvhY4cEE6nuch92RFfyi0BABo3XC bs0veiyCjQ8X1MuLZ3lL9bGuDBfWMYm+V2QphD3wcjd4NdffsuGtQaSUuPR1moLCEqBk YJ/qebqgN/cLATTogHfXD5UL7sGLSKOPdbU/QlfUFP58hbx+M0bReJtmzg3zCIorXrFt 9dW7muIl8xPgghkK40Ypspvh3GIoWZKCXNPHT/RMPs0Hfpr35Ti/FAAZFW2srDJ6M0mT sA== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by rn-mailsvcp-ppex-lapp24.rno.apple.com with ESMTP id 3f3qs1x1pv-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 29 Mar 2022 15:34:35 -0700 Received: from rn-mailsvcp-mmp-lapp02.rno.apple.com (rn-mailsvcp-mmp-lapp02.rno.apple.com [17.179.253.15]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.16.20220118 64bit (built Jan 18 2022)) with ESMTPS id <0R9J0064Q2PMZFD0@rn-mailsvcp-mta-lapp01.rno.apple.com>; Tue, 29 Mar 2022 15:34:34 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp02.rno.apple.com by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.16.20220118 64bit (built Jan 18 2022)) id <0R9J009002FFZG00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Tue, 29 Mar 2022 15:34:34 -0700 (PDT) X-Va-A: X-Va-T-CD: b8560e99725edb257a41779751fee7de X-Va-E-CD: 556bbb4abd9fb3c812d735d1b02d3f4d X-Va-R-CD: 7338ee03ea75fe851892e30d498519b7 X-Va-CD: 0 X-Va-ID: efc027ca-b2ad-45c6-9ee3-934df54a8bdd X-V-A: X-V-T-CD: b8560e99725edb257a41779751fee7de X-V-E-CD: 556bbb4abd9fb3c812d735d1b02d3f4d X-V-R-CD: 7338ee03ea75fe851892e30d498519b7 X-V-CD: 0 X-V-ID: aa18cb58-40b3-4ddc-98dd-47af60b6cb71 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425,18.0.850 definitions=2022-03-29_10:2022-03-29,2022-03-29 signatures=0 Received: from smtpclient.apple (unknown [17.235.34.18]) by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.16.20220118 64bit (built Jan 18 2022)) with ESMTPSA id <0R9J00WI02PLGE00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Tue, 29 Mar 2022 15:34:33 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Subject: Re: [edk2-devel] CryptoPkg build broken using XCODE5 (Availability.h not found) Date: Tue, 29 Mar 2022 15:34:32 -0700 In-reply-to: <21e51675-a3e5-3956-ec07-adb0a67b284e@quicinc.com> Cc: Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang To: edk2-devel-groups-io , Rebecca Cran References: <21e51675-a3e5-3956-ec07-adb0a67b284e@quicinc.com> X-Mailer: Apple Mail (2.3693.20.0.1.32) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425,18.0.850 definitions=2022-03-29_10:2022-03-29,2022-03-29 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_C38BF9EF-250C-41F0-B48C-CC1E4ED266A5" --Apple-Mail=_C38BF9EF-250C-41F0-B48C-CC1E4ED266A5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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: may be used before being set (NOTE: This was fixed in O= penSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be drop= ped then.) RVCT:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) --library_interface=3Daea= bi_clib99 --diag_suppress=3D1296,1295,550,1293,111,68,177,223,144,513,188,1= 28,546,1,3017 -JCryptoPkg/Include - XCODE:*_*_IA32_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) -w -std=3Dc99 -Wno-error=3Duninitialized - XCODE:*_*_X64_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) -w -std=3Dc99 -Wno-error=3Duninitialized + XCODE:*_*_IA32_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) -w -std=3Dc99 -Wno-error=3Duninitialized -DOPENSSL_NO_APPLE_CRYPTO_RAN= DOM + XCODE:*_*_X64_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) -w -std=3Dc99 -Wno-error=3Duninitialized -DOPENSSL_NO_APPLE_CRYPTO_RAN= DOM =20 # # 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 wrote= : >=20 > A build of CryptoPkg with XCODE5 on macOS is now trying to include Availa= bility.h, which isn't found: >=20 > In file included from /Users/bcran/src/uefi/edk2/CryptoPkg/Library/Openss= lLib/openssl/crypto/init.c:13: > /Users/bcran/src/uefi/edk2/CryptoPkg/Library/OpensslLib/openssl/include/c= rypto/rand.h:24:12: fatal error: 'Availability.h' file not found > # include > ^~~~~~~~~~~~~~~~ >=20 > This is because of the following in CryptoPkg/Library/OpensslLib/openssl/= include/crypto/rand.h >=20 > # if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM) > # include > # if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN= _REQUIRED >=3D 101200) || \ > (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MI= N_REQUIRED >=3D 80000) > # define OPENSSL_APPLE_CRYPTO_RANDOM 1 > # include > # include > # endif > # endif >=20 > --=20 > Rebecca Cran >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_C38BF9EF-250C-41F0-B48C-CC1E4ED266A5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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/OpensslLibC= rypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -59= 5,8 +595,8 @@ [BuildOptions]
   # 3017: <entity> may be used be= fore being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with
<= div style=3D"margin: 0px; font-stretch: normal; font-size: 11px; line-heigh= t: normal; font-family: Menlo;" class=3D"">   #       = commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)<= /span>
   RVCT:*_*_A= RM_CC_FLAGS     =3D $(OPENSSL_FLAGS) --library_interface=3Daeabi_= clib99 --diag_suppress=3D1296,1295,550,1293,111,68,177,223,144,513,188,128,= 546,1,3017 -JCryptoPkg/Include
-  XCODE:*_*_IA32_CC_FLAGS   =3D= -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=3Dc99 -Wno-error=3D= uninitialized
-  XCODE:*_*_X64_CC_FLAGS    =3D -mmmx -msse= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=3Dc99 -Wno-error=3Duninitialize= d
+  XCODE:*_*_IA32_CC_FLAGS   =3D -mmmx -msse -U_WIN32 -U_WI= N64 $(OPENSSL_FLAGS) -w -std=3Dc99 -Wno-error=3Duninitialized -DOPENSSL_NO_= APPLE_CRYPTO_RANDOM
+  XCODE:*_*_X64_CC_FLAGS    =3D -mmmx= -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=3Dc99 -Wno-error=3Duninit= ialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM

 

   #
   # AARCH64 uses = strict alignment and avoids SIMD registers for code that may execute=


Thanks,

<= /div>
Andrew Fish

On Mar 29, 2022, at 10:33 AM, = Rebecca Cran <quic_= rcran@quicinc.com> wrote:

A build of CryptoPkg with XCODE5 on macO= S 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
#  includ= e <Availability.h>
      =      ^~~~~~~~~~~~~~~~

This= is because of the following in CryptoPkg/Library/OpensslLib/openssl/includ= e/crypto/rand.h

# if defined(__APPLE__) &&= amp; !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
#  include= <Availability.h>
#  if (defined(__MAC_OS_X_VERSIO= N_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >=3D 101200) = || \
     (defined(__IPHONE_OS_VERSION_MI= N_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >=3D 80000)
#   define OPENSSL_APPLE_CRYPTO_RANDOM 1
= #   include <CommonCrypto/CommonCryptoError.h>
#   include <CommonCrypto/CommonRandom.h>
#=   endif
# endif

--
Rebecca Cran






--Apple-Mail=_C38BF9EF-250C-41F0-B48C-CC1E4ED266A5--