* [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue
@ 2019-06-03 16:24 Ard Biesheuvel
2019-06-03 16:26 ` Wang, Jian J
2019-06-03 16:32 ` Leif Lindholm
0 siblings, 2 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2019-06-03 16:24 UTC (permalink / raw)
To: devel
Cc: leif.lindholm, lersek, michael.d.kinney, liming.gao,
Ard Biesheuvel, Jian J Wang, Ting Ye, Xiaoyu Lu
Commit c51f8bae7cabe ("CryptoPkg: Fix possible build problem with
Clang") added -std=c99 to the 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.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 +
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 +
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 +
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 +
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 +
6 files changed, 6 insertions(+)
diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 2a581ceac70c..4a76e7e65377 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 8fdc6920ec2e..7827ff87553d 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 9d639fd01eae..c222bcaf2b69 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 c9f4abb22aea..987a6c743f2b 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 39749518027c..ac7f6f6ca7df 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 8c290caacf1b..6fd31cbb3767 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:
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue
2019-06-03 16:24 [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Ard Biesheuvel
@ 2019-06-03 16:26 ` Wang, Jian J
2019-06-03 16:32 ` Leif Lindholm
1 sibling, 0 replies; 4+ messages in thread
From: Wang, Jian J @ 2019-06-03 16:26 UTC (permalink / raw)
To: Ard Biesheuvel, devel@edk2.groups.io
Cc: leif.lindholm@linaro.org, lersek@redhat.com, Kinney, Michael D,
Gao, Liming, Ye, Ting, Lu, XiaoyuX
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
> -----Original Message-----
> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> Sent: Tuesday, June 04, 2019 12:25 AM
> To: devel@edk2.groups.io
> Cc: leif.lindholm@linaro.org; lersek@redhat.com; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>; Ard
> Biesheuvel <ard.biesheuvel@linaro.org>; Wang, Jian J <jian.j.wang@intel.com>;
> Ye, Ting <ting.ye@intel.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>
> Subject: [PATCH] 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 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.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ting Ye <ting.ye@intel.com>
> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 +
> CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 +
> 6 files changed, 6 insertions(+)
>
> diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> index 2a581ceac70c..4a76e7e65377 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 8fdc6920ec2e..7827ff87553d 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 9d639fd01eae..c222bcaf2b69 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 c9f4abb22aea..987a6c743f2b 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 39749518027c..ac7f6f6ca7df 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 8c290caacf1b..6fd31cbb3767 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:
> --
> 2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue
2019-06-03 16:24 [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Ard Biesheuvel
2019-06-03 16:26 ` Wang, Jian J
@ 2019-06-03 16:32 ` Leif Lindholm
2019-06-03 16:39 ` Ard Biesheuvel
1 sibling, 1 reply; 4+ messages in thread
From: Leif Lindholm @ 2019-06-03 16:32 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: devel, lersek, michael.d.kinney, liming.gao, Jian J Wang, Ting Ye,
Xiaoyu Lu
On Mon, Jun 03, 2019 at 06:24:42PM +0200, Ard Biesheuvel wrote:
> Commit c51f8bae7cabe ("CryptoPkg: Fix possible build problem with
> Clang") added -std=c99 to the 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.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ting Ye <ting.ye@intel.com>
> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 +
> CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 +
> CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 +
> 6 files changed, 6 insertions(+)
>
> diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> index 2a581ceac70c..4a76e7e65377 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 8fdc6920ec2e..7827ff87553d 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 9d639fd01eae..c222bcaf2b69 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 c9f4abb22aea..987a6c743f2b 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 39749518027c..ac7f6f6ca7df 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 8c290caacf1b..6fd31cbb3767 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:
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue
2019-06-03 16:32 ` Leif Lindholm
@ 2019-06-03 16:39 ` Ard Biesheuvel
0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2019-06-03 16:39 UTC (permalink / raw)
To: Leif Lindholm
Cc: edk2-devel-groups-io, Laszlo Ersek, Kinney, Michael D,
Gao, Liming, Jian J Wang, Ting Ye, Xiaoyu Lu
On Mon, 3 Jun 2019 at 18:32, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
> On Mon, Jun 03, 2019 at 06:24:42PM +0200, Ard Biesheuvel wrote:
> > Commit c51f8bae7cabe ("CryptoPkg: Fix possible build problem with
> > Clang") added -std=c99 to the 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.
> >
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Ting Ye <ting.ye@intel.com>
> > Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
Pushed as acfb90911840..f03859ea6c8f
Thanks all
> > ---
> > CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 +
> > CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 +
> > CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 +
> > CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 +
> > CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
> > CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 1 +
> > 6 files changed, 6 insertions(+)
> >
> > diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> > index 2a581ceac70c..4a76e7e65377 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 8fdc6920ec2e..7827ff87553d 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 9d639fd01eae..c222bcaf2b69 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 c9f4abb22aea..987a6c743f2b 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 39749518027c..ac7f6f6ca7df 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 8c290caacf1b..6fd31cbb3767 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:
> > --
> > 2.17.1
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-03 16:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-03 16:24 [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Ard Biesheuvel
2019-06-03 16:26 ` Wang, Jian J
2019-06-03 16:32 ` Leif Lindholm
2019-06-03 16:39 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox