]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg: Fix possible build problem with Clang
authorXiaoyuX Lu <xiaoyux.lu@intel.com>
Wed, 29 May 2019 18:40:35 +0000 (18:40 +0000)
committerJian J Wang <jian.j.wang@intel.com>
Mon, 3 Jun 2019 00:28:02 +0000 (08:28 +0800)
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>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
CryptoPkg/Library/OpensslLib/OpensslLib.inf
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf

index 38e25372b4b0dc835e0742acb6ed5f37655db001..2a581ceac70c0531f892ddc94210e6716bb1eb4a 100644 (file)
@@ -96,3 +96,5 @@
   # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT\r
   # --diag_remark=1     : Reduce severity of "#1-D: last line of file ends without a newline"\r
   RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1\r
+\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99\r
index 415dda3078a805b1926a71c237c21f83dd7d1cee..8fdc6920ec2ed3d1004f7df6ea8e52ceef7f2eda 100644 (file)
@@ -93,3 +93,5 @@
   # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT\r
   # --diag_remark=1     : Reduce severity of "#1-D: last line of file ends without a newline"\r
   RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1\r
+\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99\r
index 5da5b31947bdd8b74f79887831e1d06ca510c5e3..9d639fd01eaec4a09ff0337346ad0185c0412053 100644 (file)
   # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT\r
   # --diag_remark=1     : Reduce severity of "#1-D: last line of file ends without a newline"\r
   RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1\r
+\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99\r
index f5dd213d1ba1f1e9ac1ed8ced9edc1e474d94f57..c9f4abb22aeaae206fd993b57cb3d7d129fe6d03 100644 (file)
@@ -98,3 +98,5 @@
   MSFT:*_*_*_CC_FLAGS = /wd4090\r
 \r
   XCODE:*_*_*_CC_FLAGS = -mmmx -msse\r
+\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99\r
index f4d7772c068c5503b5e1745356c8b5f0c0720781..ce04d441552fe881b21fbf3c77ada35c0e79fe1c 100644 (file)
   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\r
   GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
   GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized\r
 \r
   # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:\r
   # 1295: Deprecated declaration <entity> - give arg types\r
index fd12d112edb2af8999cde370b62ba26a7dd7cbc2..35430e77d344c4e396e381d0bbc3d696c912170c 100644 (file)
   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\r
   GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
   GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable\r
+  GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized\r
 \r
   # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:\r
   # 1295: Deprecated declaration <entity> - give arg types\r