From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 EEE6B22280C23 for ; Wed, 27 Dec 2017 01:22:15 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id w68so23852691wrc.10 for ; Wed, 27 Dec 2017 01:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Lexq07AT0gG0I0Hq7fOTeGn3+3t72KE+G+FMfZiinJY=; b=KTiqBtpSUoHDuyN0LNr5njcgqIG0PNisH9aZkFcsoswIE6k7pEunJkqfodvQWG6/9o hycb8n8631Ejuge69oPKvgJp3n3f5M2skQ7cOW6sNOuHYTb94GQEr963t4A83EqOjRCM w4DsdXah7L4xG49Cjds8VADXm8q1+qDkzUmC0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Lexq07AT0gG0I0Hq7fOTeGn3+3t72KE+G+FMfZiinJY=; b=p5CQaBgW/tLAoEAoyDHafiMsYPvW0jW5vrOczhMIakQwXsEK5bI/uAVJ4xfTcq/nW6 LybQFzQ3uVZd/gwCFv1Olx8cPAxX2boVl8ulBienPlHJCqhSC30eBA5/8NcX/uK3CWMg rv/sU6souardwC7jsBa13l9gjofuApIFp2eo6HbprRpPAqK5tQbVPaRXc+4wS5M2fPc1 mvEStqGwqI2Wp3xIg2SM+EIsT1C386V+e+9Q3Ix5RBEBSyL+2qcX+bC7PkyCPNsIEhty YscB9S6yoFL3Wv5DHINnxN6IiCDU0wEJI0/PM8oBou0sjCqKhmigbhcNDp8rASC7YPko 8ASg== X-Gm-Message-State: AKGB3mJLB4SZUz1oXEUYFd+7Y2rUjtnQfudQTT55kDUw9ZwJZVdiOCww ctVr+kEDzXPfhBhmzPnwr4uECYmd6fc= X-Google-Smtp-Source: ACJfBosKHE8WHOcIzxEENOo1cN7MXVKH8ru5oKxzLgYcdyWJ8YirTsDFHyXa7JsNfGhaRcXEkB6J9A== X-Received: by 10.223.185.61 with SMTP id k58mr28521796wrf.40.1514366829549; Wed, 27 Dec 2017 01:27:09 -0800 (PST) Received: from localhost.localdomain ([105.137.110.132]) by smtp.gmail.com with ESMTPSA id r68sm44453680wmd.47.2017.12.27.01.27.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Dec 2017 01:27:08 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, qin.long@intel.com, ting.ye@intel.com Cc: Ard Biesheuvel Date: Wed, 27 Dec 2017 09:27:01 +0000 Message-Id: <20171227092701.8690-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [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:22:16 -0000 We recently added -Wno-error=format to the OpenSslLib build script to work 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 fatal 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 another 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 'uint64_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=] 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=] 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=format with -Wno-format to suppress the warning entirely. 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/Library/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 = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized - GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format + GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS + GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) - GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format + GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format # 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/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/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 = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized - GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format + GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS + GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) - GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format + GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format # 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