From patchwork Wed Dec 27 09:27:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 122768 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1949662qgn; Wed, 27 Dec 2017 01:27:15 -0800 (PST) X-Google-Smtp-Source: ACJfBosZLXyIaZswoxVsdH0nFB8GvwIqzbFi2XM2FIaMcThGY6zZGlAhwlTUN90bJSbV+0QfR+A7 X-Received: by 10.98.248.67 with SMTP id c3mr28044113pfm.205.1514366835224; Wed, 27 Dec 2017 01:27:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514366835; cv=none; d=google.com; s=arc-20160816; b=oIrOM8xAOwi0K3hZdTrVVFs/LfBQ/OqBdBJx3oIDv2ckIgHNfj5n9s4BJjjyHbX7mO QjnXNnVvKZJ9G81UJcWd2e1uvazptkP0h7wx9cwqx2p/5FMCpE+KRK4eVCKj2hp3qAA9 7G83OCtYSyjs44SDKykZ5prLe7VTCyy9ys4rOxwA0KvAs+Kf97EtmDOYnU4T5xqOGNox fINXoZkoODG1pTH8X8M+3S21oD4hqKZ4z9bCjow6vH5KAWK5osSpWc302fVWBmHUbB7W 99sBg2qjXWI/+awijY4ZV5Wptw1DtKd6jsKCDeUssFW3Ak9SympNvxiek09UKuW190vs +kAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=F96pvh6wSttk+gGzaJPgIeqAwsRdv50akbAG5ZKjdFc=; b=nBJ4KpFYAP7yYXX6vwyrhcwvUDeU/vyy6gdsOcQwmtXVZARaKSb4iWPvTcJp7BC/bC UJiLWdfzC7/cd7qmIHYqhJPUba9IUz0W+bAhYJdQVfQ+WnDt/bKBKclgrC0w5awGtqJh /xDdwKK61DTblI8MBSOcZRGvxgcnLJ00lrzv/kFH+fmDJSjKBTvNMRHsjAYrrhCi95yk Vye/unnRZRVjJm83s+nGKlLf82M94xThllAygOmuZ1AnC3Jl1aWIJP5U3vMldekBXZWc 7qDT7+LdF4su4CYzLxse+vhY9nT4lDgGHwzYuoTeFrgI/+5Kpzw+WkZJx6mwz3Uy9MoA jBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KTiqBtpS; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id g7si2891419pgq.707.2017.12.27.01.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Dec 2017 01:27:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KTiqBtpS; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66CBC22280C33; Wed, 27 Dec 2017 01:22:17 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Long Qin Signed-off-by: Ard Biesheuvel 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