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.120, mailfrom: liming.gao@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 27 May 2019 17:17:24 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 17:17:24 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 27 May 2019 17:17:23 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 27 May 2019 17:17:23 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 27 May 2019 17:17:23 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.33]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.136]) with mapi id 14.03.0415.000; Tue, 28 May 2019 08:17:21 +0800 From: "Liming Gao" To: Ard Biesheuvel , "devel@edk2.groups.io" CC: Laszlo Ersek , "Wang, Jian J" , Leif Lindholm , "Kinney, Michael D" Subject: Re: [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard Thread-Topic: [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard Thread-Index: AQHVFM4JmJ/GA7xFAkqS8ROa6L/lMaZ/qzTQ Date: Tue, 28 May 2019 00:17:20 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4549B5@SHSMSX104.ccr.corp.intel.com> References: <20190527205141.12344-1-ard.biesheuvel@linaro.org> <20190527205141.12344-7-ard.biesheuvel@linaro.org> In-Reply-To: <20190527205141.12344-7-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ard: Is there any impact with new option? If no behavior change, I am OK for t= his patch. Reviewed-by: Liming Gao =20 Thanks Liming >-----Original Message----- >From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >Sent: Tuesday, May 28, 2019 4:52 AM >To: devel@edk2.groups.io >Cc: Ard Biesheuvel ; Laszlo Ersek >; Gao, Liming ; Wang, Jian J >; Leif Lindholm ; Kinney, >Michael D >Subject: [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force >use of C99 standard > >When building OpenSSL for ARM or AARCH64 with recent Clang, the following >error may result: > > In file included >from .../CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c:18: > In file included >from .../CryptoPkg/Library/OpensslLib/openssl/crypto/include/internal/x509= _ >int.h:10: > In file included >from .../CryptoPkg/Library/OpensslLib/openssl/include/internal/refcount.h:= 2 >1: > In file included from /usr/lib/llvm-7/lib/clang/7.0.1/include/stdatomic.= h:35: > In file included from /usr/lib/llvm-7/lib/clang/7.0.1/include/stdint.h:6= 1: > /usr/include/stdint.h:26:10: fatal error: 'bits/libc-header-start.h' fil= e not >found > #include > ^~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. > >This is caused by the fact that the refcount.h header includes compiler >headers that in turn rely on system headers, which we don't support. > >Since the C native atomics are a C11 feature, let's explicitly use the >C99 standard instead to work around this issue. > >Signed-off-by: Ard Biesheuvel >--- > BaseTools/Conf/tools_def.template | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/BaseTools/Conf/tools_def.template >b/BaseTools/Conf/tools_def.template >index 26a2cf604f74..7fe6f4406a72 100755 >--- a/BaseTools/Conf/tools_def.template >+++ b/BaseTools/Conf/tools_def.template >@@ -2280,8 +2280,8 @@ DEFINE CLANG35_ARM_TARGET =3D -target arm- >linux-gnueabi > DEFINE CLANG35_AARCH64_TARGET =3D -target aarch64-linux-gnu > > DEFINE CLANG35_WARNING_OVERRIDES =3D -Wno-parentheses-equality - >Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare >-Wno-empty-body -Wno-unknown-warning-option >-DEFINE CLANG35_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) >DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES) >-DEFINE CLANG35_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) >DEF(CLANG35_AARCH64_TARGET) -mcmodel=3Dsmall >DEF(CLANG35_WARNING_OVERRIDES) >+DEFINE CLANG35_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) >DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES) - >std=3Dc99 >+DEFINE CLANG35_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) >DEF(CLANG35_AARCH64_TARGET) -mcmodel=3Dsmall >DEF(CLANG35_WARNING_OVERRIDES) -std=3Dc99 > > ################## > # CLANG35 ARM definitions >@@ -2430,7 +2430,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS =3D >DEF(GCC5_X64_DLINK2_FLAGS) -O0 > # CLANG38 ARM definitions > ################## > DEFINE CLANG38_ARM_TARGET =3D -target arm-linux-gnueabi >-DEFINE CLANG38_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) >DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno- >movt >+DEFINE CLANG38_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) >DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno- >movt -std=3Dc99 > DEFINE CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_TARGET) >DEF(GCC_ARM_DLINK_FLAGS) > > *_CLANG38_ARM_PP_FLAGS =3D DEF(GCC_PP_FLAGS) >@@ -2474,7 +2474,7 @@ RELEASE_CLANG38_ARM_DLINK_FLAGS =3D >DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L > # CLANG38 AARCH64 definitions > ################## > DEFINE CLANG38_AARCH64_TARGET =3D -target aarch64-linux-gnu >-DEFINE CLANG38_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) >DEF(CLANG38_AARCH64_TARGET) -mcmodel=3Dsmall >DEF(CLANG38_WARNING_OVERRIDES) >+DEFINE CLANG38_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) >DEF(CLANG38_AARCH64_TARGET) -mcmodel=3Dsmall >DEF(CLANG38_WARNING_OVERRIDES) -std=3Dc99 > DEFINE CLANG38_AARCH64_DLINK_FLAGS =3D >DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH64_DLINK_FLAGS) -z >common-page-size=3D0x1000 > > *_CLANG38_AARCH64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) >-- >2.20.1