From: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Laszlo Ersek <lersek@redhat.com>,
"Gao, Liming" <liming.gao@intel.com>,
"Wang, Jian J" <jian.j.wang@intel.com>,
Leif Lindholm <leif.lindholm@linaro.org>,
Michael D Kinney <michael.d.kinney@intel.com>
Subject: [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard
Date: Mon, 27 May 2019 22:51:40 +0200 [thread overview]
Message-ID: <20190527205141.12344-7-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20190527205141.12344-1-ard.biesheuvel@linaro.org>
When building OpenSSL for ARM or AARCH64 with recent Clang, the following
error may result:
In file included from .../CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c:18:
In file included from .../CryptoPkg/Library/OpensslLib/openssl/crypto/include/internal/x509_int.h:10:
In file included from .../CryptoPkg/Library/OpensslLib/openssl/include/internal/refcount.h:21:
In file included from /usr/lib/llvm-7/lib/clang/7.0.1/include/stdatomic.h:35:
In file included from /usr/lib/llvm-7/lib/clang/7.0.1/include/stdint.h:61:
/usr/include/stdint.h:26:10: fatal error: 'bits/libc-header-start.h' file not found
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
This is caused by the fact that the refcount.h header includes compiler
headers that in turn rely on system headers, which we don't support.
Since the C native atomics are a C11 feature, let's explicitly use the
C99 standard instead to work around this issue.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
BaseTools/Conf/tools_def.template | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 26a2cf604f74..7fe6f4406a72 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2280,8 +2280,8 @@ DEFINE CLANG35_ARM_TARGET = -target arm-linux-gnueabi
DEFINE CLANG35_AARCH64_TARGET = -target aarch64-linux-gnu
DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unknown-warning-option
-DEFINE CLANG35_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
-DEFINE CLANG35_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35_AARCH64_TARGET) -mcmodel=small DEF(CLANG35_WARNING_OVERRIDES)
+DEFINE CLANG35_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES) -std=c99
+DEFINE CLANG35_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35_AARCH64_TARGET) -mcmodel=small DEF(CLANG35_WARNING_OVERRIDES) -std=c99
##################
# CLANG35 ARM definitions
@@ -2430,7 +2430,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) -O0
# CLANG38 ARM definitions
##################
DEFINE CLANG38_ARM_TARGET = -target arm-linux-gnueabi
-DEFINE CLANG38_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt
+DEFINE CLANG38_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt -std=c99
DEFINE CLANG38_ARM_DLINK_FLAGS = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLAGS)
*_CLANG38_ARM_PP_FLAGS = DEF(GCC_PP_FLAGS)
@@ -2474,7 +2474,7 @@ RELEASE_CLANG38_ARM_DLINK_FLAGS = DEF(CLANG38_ARM_DLINK_FLAGS) -flto -Wl,-O3 -L
# CLANG38 AARCH64 definitions
##################
DEFINE CLANG38_AARCH64_TARGET = -target aarch64-linux-gnu
-DEFINE CLANG38_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG38_AARCH64_TARGET) -mcmodel=small DEF(CLANG38_WARNING_OVERRIDES)
+DEFINE CLANG38_AARCH64_CC_FLAGS = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG38_AARCH64_TARGET) -mcmodel=small DEF(CLANG38_WARNING_OVERRIDES) -std=c99
DEFINE CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_TARGET) DEF(GCC_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000
*_CLANG38_AARCH64_PP_FLAGS = DEF(GCC_PP_FLAGS)
--
2.20.1
next prev parent reply other threads:[~2019-05-27 20:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 20:51 [PATCH v2 0/7] update ArmSoftFloatLib to latest upstream version Ard Biesheuvel
2019-05-27 20:51 ` [PATCH v2 1/7] ArmPkg: import latest version (3e) of the Berkeley Softfloat library Ard Biesheuvel
2019-05-27 20:51 ` [PATCH v2 2/7] ArmPkg/ArmSoftFloatLib: switch to new version of softfloat library Ard Biesheuvel
2019-05-27 20:51 ` [PATCH v2 3/7] ArmPkg/ArmSoftFloatLib: remove source files that are no longer used Ard Biesheuvel
2019-05-27 20:51 ` [PATCH v2 4/7] ArmPkg/ArmSoftFloatLib: remove new source files that are not used Ard Biesheuvel
2019-05-27 20:51 ` [PATCH v2 5/7] ArmPkg/ArmSoftFloatLib: add SPDX identifiers Ard Biesheuvel
2019-05-28 11:27 ` Laszlo Ersek
2019-05-28 11:28 ` Ard Biesheuvel
2019-05-28 12:22 ` Leif Lindholm
2019-05-27 20:51 ` Ard Biesheuvel [this message]
2019-05-28 0:17 ` [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard Liming Gao
2019-05-28 6:10 ` [edk2-devel] " Ard Biesheuvel
2019-05-28 7:37 ` Wang, Jian J
2019-05-28 8:25 ` Leif Lindholm
2019-05-27 20:51 ` [PATCH v2 7/7] ArmPkg/ArmLib ARM: set .fpu to let Clang 7 assemble ArmV7Support.S Ard Biesheuvel
2019-05-30 9:24 ` [edk2-devel] " Philippe Mathieu-Daudé
2019-05-28 6:35 ` [PATCH v2 0/7] update ArmSoftFloatLib to latest upstream version Ard Biesheuvel
2019-05-28 11:21 ` Laszlo Ersek
2019-05-28 11:29 ` Laszlo Ersek
2019-05-28 11:39 ` Laszlo Ersek
2019-05-28 13:56 ` Ard Biesheuvel
2019-05-28 16:57 ` [edk2-devel] " Michael D Kinney
2019-05-28 15:40 ` Leif Lindholm
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=20190527205141.12344-7-ard.biesheuvel@linaro.org \
--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