Long,

Thanks, my RVCT is up to date at build 925 and I think the issue described only 
applies to 'goto' and 'case' statements.

I updated the --diag_suppress as you suggested to ignore warning 128.  Next 
issue are these two warnings:
        
edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\evp\p_sign.c(89,9): 
error #546-D: transfer of control bypasses initialization of:
              variable "sltmp" (declared at line 95)
edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\evp\p_sign.c(91,9): 
error #546-D: transfer of control bypasses initialization of:
              variable "sltmp" (declared at line 95)

These are strange because sltmp is not in scope at the point of the goto.

I can suppress this warning as well for now.

Next error is this:

edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\x509\x509_vfy.c(860): 
error C3017: ok may be used before being set

This seems like it would be best solved by just initializing the variable 
beforehand.


In the future I'd like to see ARM and the OpenSSL maintainers try to get 
openssl building without warnings with RVCT if possible (if edk2 can do it, 
openssl should be able to as well, right?).


Here's a patch with this changes:

---
 edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf                        | 2 +-
 edk2/CryptoPkg/Library/OpensslLib/openssl-1.0.2d/crypto/x509/x509_vfy.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 2e74f6c..261861b 100644
--- a/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -889,6 +889,6 @@
   #  513: a value of type <type> cannot be assigned to an entity of type <type>
   #  188: enumerated type mixed with another type (i.e. passing an integer as 
an enum without a cast)
   # 1296: Extended constant initialiser used
-  RVCT:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) 
--library_interface=aeabi_clib99 --fpu=vfpv3 
--diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188
+  RVCT:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) 
--library_interface=aeabi_clib99 --fpu=vfpv3 
--diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188,128,546
   XCODE:*_*_IA32_CC_FLAGS   = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
   XCODE:*_*_X64_CC_FLAGS    = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
diff --git 
a/edk2/CryptoPkg/Library/OpensslLib/openssl-1.0.2d/crypto/x509/x509_vfy.c 
b/edk2/CryptoPkg/Library/OpensslLib/openssl-1.0.2d/crypto/x509/x509_vfy.c
index 35dde28..35e3b39 100644
--- a/edk2/CryptoPkg/Library/OpensslLib/openssl-1.0.2d/crypto/x509/x509_vfy.c
+++ b/edk2/CryptoPkg/Library/OpensslLib/openssl-1.0.2d/crypto/x509/x509_vfy.c
@@ -859,6 +859,7 @@ static int check_cert(X509_STORE_CTX *ctx)
     X509 *x;
     int ok, cnum;
     unsigned int last_reasons;
+    ok = 0;
     cnum = ctx->error_depth;
     x = sk_X509_value(ctx->chain, cnum);
     ctx->current_cert = x;
-- 


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen < eug...@hp.com>

Thanks,

Eugene

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Long, Qin
Sent: Monday, November 23, 2015 10:21 AM
To: Cohen, Eugene <eug...@hp.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] CryptoPkg: OpenSSL build issue with RVCT

Hi, Eugene,

Sorry, I have no RVCT environment for more investigations. 
Could you help to double-check if this is caused by any CryptoPkg updates? Or 
It is one OpenSSL-native issue?

Could we silence this simply with any build flag, such as " --diag_suppress"? 
Moreover, some old RVCT release may produce the spurious occurrences of 
compiler warning #128-D, which may need the patch to remove it 
(http://www.arm.com/products/tools/software-tools/rvds/updates-patches/rvct-40-patch-for-windows.php)

If it's one OpenSSL-native build issue, we can apply some kind of patch (e.g. 
applying OPENSSL_SYS_UEFI) to silence it in our package, and then submit the 
ticket in OpenSSL RT for the native fix. 


Best Regards & Thanks,
LONG, Qin

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cohen, 
> Eugene
> Sent: Monday, November 23, 2015 11:01 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] CryptoPkg: OpenSSL build issue with RVCT
> 
> Using RVCT 4, I get the following error building openssl-1.0.2d:
> 
> 1>  Building ... c:\bios_24s\edk2\CryptoPkg\Library\OpensslLib\OpensslLib.inf 
> [ARM]
> [snip]
> c:\bios_24s\edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\cryptlib.c
> 1>c:\bios_24s\edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\cryptlib.c(462,5):
>  error #128-D: loop is not reachable from
> preceding code
> 1>  armcc : 
> c:\bios_24s\edk2\CryptoPkg\Library\OpensslLib\openssl-1.0.2d\crypto\cryptlib.c:
>  0 warnings, 1 error
> 
> I presume this is due to the compiler pre-processing this statement so that 
> it's unconditional:
> 
>   if (sizeof(id->val) >= sizeof(id->ptr)) {
>         /*
>          * 'ptr' can be embedded in 'val' without loss of uniqueness
>          */
>         id->val = (unsigned long)id->ptr;
>         return;
>     }
> 
> Suggestions for a maintainable fix?
> 
> Thanks,
> 
> Eugene
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to