From: "Xiaoyu Lu" <xiaoyux.lu@intel.com>
To: devel@edk2.groups.io
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>, Ting Ye <ting.ye@intel.com>,
Jian J Wang <jian.j.wang@intel.com>
Subject: [PATCH v5 6/9] CryptoPkg: Fix possible build problem with Clang
Date: Wed, 29 May 2019 06:40:35 -0400 [thread overview]
Message-ID: <1559126438-9211-7-git-send-email-xiaoyux.lu@intel.com> (raw)
In-Reply-To: <1559126438-9211-1-git-send-email-xiaoyux.lu@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1089
When building CryptoPkg with Clang, blow error may result
* /usr/lib/llvm-3.8/lib/clang/3.8.0/include/stdatomic.h:105:17: error:
unknown type name 'wchar_t'
Since the C native atomics are C11 feature we can explicitly
use C99 to work around it.
add -std=c99 to avoid it
* openssl/crypto/conf/conf_sap.c:71:12: error: variable 'ret' is
uninitialized
when used here [-Werror,-Wuninitialized]
Suppress warnings in OpenSSL so we don't break the build with -Werror.
add -Wno-error=uninitialized to disalbe this warning
Cc: Ting Ye <ting.ye@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
---
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 2 ++
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 2 ++
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 2 ++
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 2 ++
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 +
6 files changed, 10 insertions(+)
diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 38e25372b4b0..2a581ceac70c 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -96,3 +96,5 @@ [BuildOptions]
# -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
# --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
+
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 415dda3078a8..8fdc6920ec2e 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -93,3 +93,5 @@ [BuildOptions]
# -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
# --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
+
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 5da5b31947bd..9d639fd01eae 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -101,3 +101,5 @@ [BuildOptions]
# -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
# --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
+
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index f5dd213d1ba1..c9f4abb22aea 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -98,3 +98,5 @@ [BuildOptions]
MSFT:*_*_*_CC_FLAGS = /wd4090
XCODE:*_*_*_CC_FLAGS = -mmmx -msse
+
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index f4d7772c068c..ce04d441552f 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -559,6 +559,7 @@ [BuildOptions]
GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -DNO_MSABI_VA_FUNCS
GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
# suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
# 1295: Deprecated declaration <entity> - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index fd12d112edb2..35430e77d344 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -520,6 +520,7 @@ [BuildOptions]
GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -DNO_MSABI_VA_FUNCS
GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
+ GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
# suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
# 1295: Deprecated declaration <entity> - give arg types
--
2.7.4
next prev parent reply other threads:[~2019-05-29 10:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 10:40 [PATCH v5 0/9] Crypto: Upgrade OpenSSL to 1.1.1b Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 1/9] CryptoPkg/OpensslLib: Modify process_files.pl for upgrading OpenSSL Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 2/9] CryptoPkg/OpensslLib: Exclude unnecessary files in process_files.pl Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 3/9] CryptoPkg/IntrinsicLib: Fix possible unresolved external symbol issue Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 4/9] CryptoPkg/OpensslLib: Prepare for upgrading OpenSSL Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 5/9] CryptoPkg/OpensslLib: Fix cross-build problem for AARCH64 Xiaoyu Lu
2019-05-29 10:40 ` Xiaoyu Lu [this message]
2019-05-29 10:40 ` [PATCH v5 7/9] CryptoPkg/OpensslLib: Add functions for upgrading OpenSSL1_1_1b Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 8/9] CryptoPkg: Upgrade OpenSSL to 1.1.1b Xiaoyu Lu
2019-05-29 10:40 ` [PATCH v5 9/9] CryptoPkg/BaseCryptLib: Make HMAC_CTX size backward compatible Xiaoyu Lu
2019-05-29 15:39 ` [edk2-devel] [PATCH v5 0/9] Crypto: Upgrade OpenSSL to 1.1.1b Wang, Jian J
2019-06-03 0:48 ` Wang, Jian J
2019-06-03 11:45 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1559126438-9211-7-git-send-email-xiaoyux.lu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox