From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=qin.long@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9B9FD22280C22 for ; Wed, 27 Dec 2017 01:54:31 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Dec 2017 01:59:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,464,1508828400"; d="scan'208";a="19226718" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 27 Dec 2017 01:59:26 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Dec 2017 01:59:25 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002; Wed, 27 Dec 2017 17:59:23 +0800 From: "Long, Qin" To: Ard Biesheuvel , "edk2-devel@lists.01.org" , "Ye, Ting" Thread-Topic: [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote format warning Thread-Index: AQHTfvThS9ECUSMx2UiZQFmp5zA6CaNW8ljQ Date: Wed, 27 Dec 2017 09:59:23 +0000 Message-ID: References: <20171227092701.8690-1-ard.biesheuvel@linaro.org> In-Reply-To: <20171227092701.8690-1-ard.biesheuvel@linaro.org> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDk4YTEwODQtYjlkOC00MjVkLWEyNjktYTVkNjI1ZTUxZWJiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJMcitTVHE2TXJtM2tUcVByOUlYWStiTHB2Y1k3b0lDKzFxREJrcUVObnJ1bHNaQW9cL1dmTTRoQ053RyswZXRYMyJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote format warning X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 09:54:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This makes sense to me.=20 Reviewed-by: Long Qin Best Regards & Thanks, LONG, Qin -----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]=20 Sent: Wednesday, December 27, 2017 5:27 PM To: edk2-devel@lists.01.org; Long, Qin ; Ye, Ting Cc: Ard Biesheuvel Subject: [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote f= ormat warning We recently added -Wno-error=3Dformat to the OpenSslLib build script to wor= k around an issue in the upstream OpenSSL code. This does not inhibit the w= arning, but prevents it from breaking the build by not treating it as a fat= al error. Unfortunately, this interacts poorly with the -Wno-unused-const-variable op= tion that we added to GCC49 and later. Those versions of GCC ignore -Wno-xx= xx options that they don't understand, unless warnings are emitted for anot= her reason, in which case the warning is emitted after all, and in our case= , this breaks the build when the non-fatal format warning is emitted. CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: In function 'ui= nt64_print': CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:105:32: warning:= format '%ld' expects argument of type 'long int', but argument 3 has type = 'int64_t {aka long long int}' [-Wformat=3D] return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval); ^ CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:106:28: warning:= format '%lu' expects argument of type 'long unsigned int', but argument 3 = has type 'uint64_t {aka long long unsigned int}' [-Wformat=3D] return BIO_printf(out, "%"BIO_PRI64"u\n", **(uint64_t **)pval); ^ CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: At top level: cc1: error: unrecognized command line option '-Wno-unused-const-variable' [= -Werror] cc1: all warnings being treated as errors So replace -Wno-error=3Dformat with -Wno-format to suppress the warning ent= irely. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- CryptoPkg/Library/OpensslLib/OpensslLib.inf | 6 +++--- CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Librar= y/OpensslLib/OpensslLib.inf index 602953eefff7..f3eb19afd34e 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -557,10 +557,10 @@ [BuildOptions] # types appropriate to the format string specified. # GCC:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized - GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-error=3Dformat -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-error=3Dformat + GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS + GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) - GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dformat + GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-format =20 # suppress the following warnings in openssl so we don't break the build= with warnings-as-errors: # 1295: Deprecated declaration - give arg types diff --git a/Cr= yptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/Openssl= Lib/OpensslLibCrypto.inf index f697243f9787..88134b5b5ff3 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf @@ -518,10 +518,10 @@ [BuildOptions] # types appropriate to the format string specified. # GCC:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized - GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-error=3Dformat -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-error=3Dformat + GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS + GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-err= or=3Dmaybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) - GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dformat + GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-format =20 # suppress the following warnings in openssl so we don't break the build= with warnings-as-errors: # 1295: Deprecated declaration - give arg types -- 2.11.0