From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jian.j.wang@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 03 Jun 2019 09:26:50 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2019 09:26:49 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 03 Jun 2019 09:26:49 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 09:26:48 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 09:26:48 -0700 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.98]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.188]) with mapi id 14.03.0415.000; Tue, 4 Jun 2019 00:26:47 +0800 From: "Wang, Jian J" To: Ard Biesheuvel , "devel@edk2.groups.io" CC: "leif.lindholm@linaro.org" , "lersek@redhat.com" , "Kinney, Michael D" , "Gao, Liming" , "Ye, Ting" , "Lu, XiaoyuX" Subject: Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Thread-Topic: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Thread-Index: AQHVGijkhBjyl24Eo0eQBCZVHpyQUKaKHdnQ Date: Mon, 3 Jun 2019 16:26:46 +0000 Message-ID: References: <20190603162442.3459-1-ard.biesheuvel@linaro.org> In-Reply-To: <20190603162442.3459-1-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDBlZmQxNGUtYTg1Ni00ODI3LWE5ODQtMGFkMzQ4ODE3MDUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRjB0TlNOV0ZEMWg5UzJuNG9QZTRoRzB3NDNNTkQwV3ptcnY5YWdMYWFwaWgzRTUrNjJXWmF2U01mbXA3T3BTbSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jian.j.wang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang > -----Original Message----- > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] > Sent: Tuesday, June 04, 2019 12:25 AM > To: devel@edk2.groups.io > Cc: leif.lindholm@linaro.org; lersek@redhat.com; Kinney, Michael D > ; Gao, Liming ; Ard > Biesheuvel ; Wang, Jian J ; > Ye, Ting ; Lu, XiaoyuX > Subject: [PATCH] CryptoPkg CLANG35: add -std=3Dc99 to dodge OpenSSL C > atomics issue >=20 > Commit c51f8bae7cabe ("CryptoPkg: Fix possible build problem with > Clang") added -std=3Dc99 to the compiler command line of packages > that incorporate parts of OpenSSL, to ensure that the new C atomics > code used by OpenSSL for refcounting (which we don't care about) > does not pull in system C library headers, which we cannot rely > on when (cross)building EDK2 code. >=20 > Unsurprisingly, CLANG35 (which is only defined for ARM and AARCH64) > suffers from the exact same issue, so let's add the same flags > there as well. >=20 > Cc: Jian J Wang > Cc: Ting Ye > Cc: Xiaoyu Lu > Signed-off-by: Ard Biesheuvel > --- > CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 + > CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 + > CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 + > CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 + > CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 + > CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 + > 6 files changed, 6 insertions(+) >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > index 2a581ceac70c..4a76e7e65377 100644 > --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > @@ -97,4 +97,5 @@ > # --diag_remark=3D1 : Reduce severity of "#1-D: last line of file = ends without a > newline" > RVCT:*_*_ARM_CC_FLAGS =3D -JCryptoPkg/Include --diag_remark=3D1 >=20 > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 > diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > index 8fdc6920ec2e..7827ff87553d 100644 > --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > @@ -94,4 +94,5 @@ > # --diag_remark=3D1 : Reduce severity of "#1-D: last line of file = ends without a > newline" > RVCT:*_*_ARM_CC_FLAGS =3D -JCryptoPkg/Include --diag_remark=3D1 >=20 > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 > diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > index 9d639fd01eae..c222bcaf2b69 100644 > --- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > @@ -102,4 +102,5 @@ > # --diag_remark=3D1 : Reduce severity of "#1-D: last line of file = ends without a > newline" > RVCT:*_*_ARM_CC_FLAGS =3D -JCryptoPkg/Include --diag_remark=3D1 >=20 > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 > diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > index c9f4abb22aea..987a6c743f2b 100644 > --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > @@ -99,4 +99,5 @@ >=20 > XCODE:*_*_*_CC_FLAGS =3D -mmmx -msse >=20 > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 > diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf > b/CryptoPkg/Library/OpensslLib/OpensslLib.inf > index 39749518027c..ac7f6f6ca7df 100644 > --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf > +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf > @@ -601,6 +601,7 @@ > GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno- > error=3Dmaybe-uninitialized -Wno-error=3Dformat -Wno-format -Wno- > error=3Dunused-but-set-variable -DNO_MSABI_VA_FUNCS > GCC:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe- > uninitialized -Wno-error=3Dunused-but-set-variable > GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe- > uninitialized -Wno-format -Wno-error=3Dunused-but-set-variable > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized >=20 > # suppress the following warnings in openssl so we don't break the bui= ld with > warnings-as-errors: > diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf > b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf > index 8c290caacf1b..6fd31cbb3767 100644 > --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf > +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf > @@ -557,6 +557,7 @@ > GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno- > error=3Dmaybe-uninitialized -Wno-error=3Dformat -Wno-format -Wno- > error=3Dunused-but-set-variable -DNO_MSABI_VA_FUNCS > GCC:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe- > uninitialized -Wno-error=3Dunused-but-set-variable > GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe- > uninitialized -Wno-format -Wno-error=3Dunused-but-set-variable > + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized > GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized >=20 > # suppress the following warnings in openssl so we don't break the bui= ld with > warnings-as-errors: > -- > 2.17.1