From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web10.20616.1590696232412468793 for ; Thu, 28 May 2020 13:03:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bX+9yXLD; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590696231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sk9l/424PEtaHT4/ugaAmM4Jn3k4jGCbd+1CWsHvnKw=; b=bX+9yXLDImYrDCjsnZloNf6XxuPdX+uSworVp7dXZ01/iGUV44EEpweeQIEZ7HGxdcCKyR r8pNNDVVG3QP2mbwkTQKt/mJPKZhxxFs/mSmzXZQ78BlyEwVwjqhLZ0LoIUvdvmh5H3ajM 2kAwHGL7Z/JsN4AGnH79CaF6gZT6gGg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-FkO4qgasOR6u7sjdjVUf1g-1; Thu, 28 May 2020 16:03:43 -0400 X-MC-Unique: FkO4qgasOR6u7sjdjVUf1g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC1FB2C21; Thu, 28 May 2020 20:03:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-101.ams2.redhat.com [10.36.112.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42914A1035; Thu, 28 May 2020 20:03:40 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 1/1] CryptoPkg: Fix VS2017 build problem for ARM/AARCH64 To: Leif Lindholm Cc: devel@edk2.groups.io, rebecca@bsdio.com, Jian J Wang , Xiaoyu Lu , "Ard Biesheuvel (ARM address)" References: <20200527160412.42938-1-rebecca@bsdio.com> <20200528101541.GD1923@vanye> From: "Laszlo Ersek" Message-ID: Date: Thu, 28 May 2020 22:03:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200528101541.GD1923@vanye> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/28/20 12:15, Leif Lindholm wrote: > On Wed, May 27, 2020 at 20:34:02 +0200, Laszlo Ersek wrote: >> +Ard, +Leif, and maybe we should consider this for edk2-stable202005? > > Hmm, if this has never worked on MSFT:ARM/AArch64, I don't think it > would qualify even during soft freeze? (Whereas if it was a question > of making it work on vs2019 afer having worked with vs2017 it would.) > > Don't get me wrong, I think this is excellent, but I think it can wait > until after release. > > Will have a look at the patch itself on the original thread. Thanks for reviewing the situation! Laszlo > > Regards, > > Leif > >> Thanks, >> Laszlo >> >> On 05/27/20 18:04, 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 >>> --- >>> 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, 8 insertions(+) >>> >>> diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf >>> index 4aae2aba95d6..4ed5b8265563 100644 >>> --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf >>> +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf >>> @@ -94,6 +94,8 @@ [BuildOptions] >>> # C4090: 'function' : different 'const' qualifiers >>> # >>> MSFT:*_*_*_CC_FLAGS = /wd4090 >>> + 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..0e66d935ead8 100644 >>> --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf >>> +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf >>> @@ -84,6 +84,8 @@ [BuildOptions] >>> # C4718: 'function call' : recursive call has no side effects, deleting >>> # >>> MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718 >>> + MSFT:*_*_ARM_CC_FLAGS = /wd4090 /wd4718 /U_M_ARM /U_M_ARM64 >>> + MSFT:*_*_AARCH64_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 >>> >> >