summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-06-03 18:19:41 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2019-06-03 18:33:53 +0200
commitf03859ea6c8fddeaa3a5cc3d9a3461728ce538aa (patch)
tree55de49ef0417e0603206ec0c35091c66b6f0e393
parentacfb90911840c38a0beb9bcfe0065668244d2b4d (diff)
downloadedk2-f03859ea6c8fddeaa3a5cc3d9a3461728ce538aa.tar.gz
edk2-f03859ea6c8fddeaa3a5cc3d9a3461728ce538aa.tar.bz2
edk2-f03859ea6c8fddeaa3a5cc3d9a3461728ce538aa.zip
CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue
Commit c51f8bae7cabe ("CryptoPkg: Fix possible build problem with Clang") added -std=c99 to the CLANG38 compiler command line of packages that incorporate parts of OpenSSL, to ensure that the new C atomics code used by OpenSSL for refcounting (which we don't care about) does not pull in system C library headers, which we cannot rely on when (cross)building EDK2 code. Unsurprisingly, CLANG35 (which is only defined for ARM and AARCH64) suffers from the exact same issue, so let's add the same flags there as well. Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-rw-r--r--CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf1
-rw-r--r--CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf1
-rw-r--r--CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf1
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf1
-rw-r--r--CryptoPkg/Library/OpensslLib/OpensslLib.inf1
-rw-r--r--CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf1
6 files changed, 6 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 2a581ceac7..4a76e7e653 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -97,4 +97,5 @@
# --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:*_CLANG35_*_CC_FLAGS = -std=c99
GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 8fdc6920ec..7827ff8755 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -94,4 +94,5 @@
# --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:*_CLANG35_*_CC_FLAGS = -std=c99
GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 9d639fd01e..c222bcaf2b 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -102,4 +102,5 @@
# --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:*_CLANG35_*_CC_FLAGS = -std=c99
GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index c9f4abb22a..987a6c743f 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -99,4 +99,5 @@
XCODE:*_*_*_CC_FLAGS = -mmmx -msse
+ GCC:*_CLANG35_*_CC_FLAGS = -std=c99
GCC:*_CLANG38_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 3974951802..ac7f6f6ca7 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -601,6 +601,7 @@
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:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
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:
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 8c290caacf..6fd31cbb37 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -557,6 +557,7 @@
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:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
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: