From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::243; helo=mail-io0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4ED5122280C22 for ; Wed, 27 Dec 2017 01:56:29 -0800 (PST) Received: by mail-io0-x243.google.com with SMTP id e204so34879809iof.12 for ; Wed, 27 Dec 2017 02:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=weHrUJdmzM+avgwGQfuG4TkImgEwz8InmjAQx6FYzqg=; b=LBYEd6AEqwhrLIV0Y/SLkkzZhpiwFKy6pbHlq2qr/Ox9Y5cTHmiugnBEofYOwicVs8 9NJHV2HQD2JxGdTtphbZm5ke+VbsHvb4aQ2O/HrmflOWhzBq7fswoQije5TPNI7p2Gy3 skueCgBeEtY+jn0iBPCR4v9RvsIKXLmaLbr1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=weHrUJdmzM+avgwGQfuG4TkImgEwz8InmjAQx6FYzqg=; b=rCUIwe3Mlgv23lmEIUncvPlJCG7ZoRvTkFQClJzCFsQ9I41rmeXKNywAUuXkZmVNCk fiyeeosYHFmlQ1b8ehhBMkZzt9wyreSS899eMNiYOa/dbbJPb5rRsvFvONh+9fEPiuE4 XBJOPJGl5UZjBouNzqxIDY+5pSEekhL1B5k3quUbCVXFUc6uuvCPrv3yHtpQ+T8NU378 DJLZ0ng+S8+4b+gp9EVHCdXYKSjPZNUFIm1Y3WEKueGH8//xa5yT4TtBvOoJjlMWnY5d 9OUw0JrWXULzdLMlUygQRUsqbEAkHRMlNmTvbCvR8OATZF8vqXcUa5yG3SNOBMwnnkkm UWVQ== X-Gm-Message-State: AKGB3mIWV8EnG5VKLTjW7sB9fynuqv9/tch6xBWeJ7qHmSd6iagO9EK0 BdLW1aA72FfPGJsMJ7zLutfKaKrL7Y+cXlr+po2TYAdaoYM= X-Google-Smtp-Source: ACJfBove9fieT/t80ttzdQwpVLbNQRT886hRFGOZ+R344jbBedpyQrXQ+ZJf7gLtS65glZqTr/bVwAJLXu+jmePjDYc= X-Received: by 10.107.151.142 with SMTP id z136mr37418292iod.248.1514368884663; Wed, 27 Dec 2017 02:01:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.52.14 with HTTP; Wed, 27 Dec 2017 02:01:24 -0800 (PST) In-Reply-To: References: <20171227092701.8690-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Wed, 27 Dec 2017 10:01:24 +0000 Message-ID: To: "Long, Qin" Cc: "edk2-devel@lists.01.org" , "Ye, Ting" 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:56:30 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 27 December 2017 at 09:59, Long, Qin wrote: > This makes sense to me. > Reviewed-by: Long Qin > Thanks. Pushed as c24d664dca26 > -----Original Message----- > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] > 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= format warning > > We recently added -Wno-error=3Dformat to the OpenSslLib build script to w= ork around an issue in the upstream OpenSSL code. This does not inhibit the= warning, but prevents it from breaking the build by not treating it as a f= atal error. > > Unfortunately, this interacts poorly with the -Wno-unused-const-variable = option that we added to GCC49 and later. Those versions of GCC ignore -Wno-= xxxx options that they don't understand, unless warnings are emitted for an= other reason, in which case the warning is emitted after all, and in our ca= se, this breaks the build when the non-fatal format warning is emitted. > > CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: In function '= uint64_print': > CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:105:32: warnin= g: format '%ld' expects argument of type 'long int', but argument 3 has typ= e '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: warnin= g: 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 e= ntirely. > > 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/Libr= ary/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-e= rror=3Dmaybe-uninitialized > - GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-error=3Dformat -DNO_MSABI_VA_FUNCS > - GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-error=3Dformat > + GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS > + GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=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 > > # suppress the following warnings in openssl so we don't break the bui= ld with warnings-as-errors: > # 1295: Deprecated declaration - give arg types diff --git a/= CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/Opens= slLib/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-e= rror=3Dmaybe-uninitialized > - GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-error=3Dformat -DNO_MSABI_VA_FUNCS > - GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-error=3Dformat > + GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=3Dmaybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS > + GCC:*_*_IPF_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-e= rror=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 > > # suppress the following warnings in openssl so we don't break the bui= ld with warnings-as-errors: > # 1295: Deprecated declaration - give arg types > -- > 2.11.0 >