Re: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix VS2017 build problem for ARM/AARCH64

2020-05-24 Thread Guomin Jiang
Add comment inline

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca
> Cran
> Sent: Thursday, May 21, 2020 4:26 AM
> To: devel@edk2.groups.io
> Cc: Rebecca Cran ; Wang, Jian J
> ; Lu, XiaoyuX 
> Subject: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix VS2017 build problem for
> ARM/AARCH64
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2029
> 
> 1. CryptPkcs7VerifyEku.c contains internal/x509_int.h header file, this
>file contains internal/refcount.h file, if _M_ARM or _M_ARM64
>defined, it will contains (intrin.h).
>So we undef these flags for MSVC. It will fix include header
>dependence problem(intrin.h).
> 
> 2. ARM with MSFT toolchain was not enabled in BuildOptions, So
>add CC_FLAGS for ARM/AARCH64 into OpensslLib[Crypto].inf BuildOptions
>section to fix build problem.
> 
> Cc: Jian J Wang 
> Signed-off-by: Xiaoyu Lu 
> ---
>  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   | 2 +-
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf| 2 +-
>  CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 2 ++
>  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 ++
>  4 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> index 4aae2aba95d6..6512f3188499 100644
> --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> @@ -93,7 +93,7 @@ [BuildOptions]
># suppress the following warnings so we do not break the build with
> warnings-as-errors:
># C4090: 'function' : different 'const' qualifiers
>#
> -  MSFT:*_*_*_CC_FLAGS = /wd4090
> +  MSFT:*_*_*_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64

It will have confusion for those who not building for ARM, I suggest that use 
replace with below
+ MSFT: *_*_ARM_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64
+ MSFT: *_*_AARCH64_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64

> 
># -JCryptoPkg/Include : To disable the use of the system includes provided
> by RVCT
># --diag_remark=1 : Reduce severity of "#1-D: last line of file ends
> without a newline"
> diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> index dc28e3a11d48..7838b0f3e14b 100644
> --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> @@ -83,7 +83,7 @@ [BuildOptions]
># C4090: 'function' : different 'const' qualifiers
># C4718: 'function call' : recursive call has no side effects, deleting
>#
> -  MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718
> +  MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718 /U_M_ARM /U_M_ARM64

It will have confusion for those who not building for ARM, I suggest that use 
replace with below
+ MSFT: *_*_ARM_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64
+ MSFT: *_*_AARCH64_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64

> 
># -JCryptoPkg/Include : To disable the use of the system includes provided
> by RVCT
># --diag_remark=1 : Reduce severity of "#1-D: last line of file ends
> without a newline"
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> index c8ec9454bd90..c43c7bad4982 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> @@ -619,6 +619,8 @@ [BuildOptions]
>#
>MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER
> $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4310
> /wd4389 /wd4700 /wd4702 /wd4706 /wd4819
>MSFT:*_*_X64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER
> $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306
> /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819
> +  MSFT:*_*_ARM_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER
> $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306
> /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819
> +  MSFT:*_*_AARCH64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER
> $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306
> /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819
> 
>INTEL:*_*_IA32_CC_FLAGS  = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC
> $(OPENSSL_FLAGS) /w
>INTEL:*_*_X64_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC
> $(OPENSSL_FLAGS) /w
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> index 2f232e3e1289..594717331f68 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> @@ -568,6 +568,8 @@ [BuildOptions]
>#
>MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER
> 

Re: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix VS2017 build problem for ARM/AARCH64

2020-05-20 Thread Rebecca Cran

On 5/20/2020 2:26 PM, Rebecca Cran wrote:


REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2029

1. CryptPkcs7VerifyEku.c contains internal/x509_int.h header file, this
file contains internal/refcount.h file, if _M_ARM or _M_ARM64
defined, it will contains (intrin.h).
So we undef these flags for MSVC. It will fix include header
dependence problem(intrin.h).

2. ARM with MSFT toolchain was not enabled in BuildOptions, So
add CC_FLAGS for ARM/AARCH64 into OpensslLib[Crypto].inf BuildOptions
section to fix build problem.

Cc: Jian J Wang 
Signed-off-by: Xiaoyu Lu 


I fixed a couple of trailing whitespace errors in the BZ patch, and 
build-tested for AARCH64 and ARM.


This patch fixes the ARM build, but it looks like the AARCH64 build 
needs more work because it still fails.



--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60001): https://edk2.groups.io/g/devel/message/60001
Mute This Topic: https://groups.io/mt/74359578/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] CryptoPkg: Fix VS2017 build problem for ARM/AARCH64

2020-05-20 Thread Rebecca Cran
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2029

1. CryptPkcs7VerifyEku.c contains internal/x509_int.h header file, this
   file contains internal/refcount.h file, if _M_ARM or _M_ARM64
   defined, it will contains (intrin.h).
   So we undef these flags for MSVC. It will fix include header
   dependence problem(intrin.h).

2. ARM with MSFT toolchain was not enabled in BuildOptions, So
   add CC_FLAGS for ARM/AARCH64 into OpensslLib[Crypto].inf BuildOptions
   section to fix build problem.

Cc: Jian J Wang 
Signed-off-by: Xiaoyu Lu 
---
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   | 2 +-
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf| 2 +-
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 2 ++
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 4aae2aba95d6..6512f3188499 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -93,7 +93,7 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   # C4090: 'function' : different 'const' qualifiers
   #
-  MSFT:*_*_*_CC_FLAGS = /wd4090
+  MSFT:*_*_*_CC_FLAGS = /wd4090 /U_M_ARM /U_M_ARM64
 
   # -JCryptoPkg/Include : To disable the use of the system includes provided 
by RVCT
   # --diag_remark=1 : Reduce severity of "#1-D: last line of file ends 
without a newline"
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index dc28e3a11d48..7838b0f3e14b 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -83,7 +83,7 @@ [BuildOptions]
   # C4090: 'function' : different 'const' qualifiers
   # C4718: 'function call' : recursive call has no side effects, deleting
   #
-  MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718
+  MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718 /U_M_ARM /U_M_ARM64
 
   # -JCryptoPkg/Include : To disable the use of the system includes provided 
by RVCT
   # --diag_remark=1 : Reduce severity of "#1-D: last line of file ends 
without a newline"
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index c8ec9454bd90..c43c7bad4982 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -619,6 +619,8 @@ [BuildOptions]
   #
   MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 
/wd4819
   MSFT:*_*_X64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
+  MSFT:*_*_ARM_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
+  MSFT:*_*_AARCH64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
 
   INTEL:*_*_IA32_CC_FLAGS  = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC 
$(OPENSSL_FLAGS) /w
   INTEL:*_*_X64_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC 
$(OPENSSL_FLAGS) /w
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 2f232e3e1289..594717331f68 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -568,6 +568,8 @@ [BuildOptions]
   #
   MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 
/wd4819
   MSFT:*_*_X64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
+  MSFT:*_*_ARM_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
+  MSFT:*_*_AARCH64_CC_FLAGS= -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) 
/wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 
/wd4706 /wd4819
 
   INTEL:*_*_IA32_CC_FLAGS  = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC 
$(OPENSSL_FLAGS) /w
   INTEL:*_*_X64_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC 
$(OPENSSL_FLAGS) /w
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#6): https://edk2.groups.io/g/devel/message/6
Mute This Topic: https://groups.io/mt/74359578/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-