From nobody Wed Dec 17 04:31:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+41430+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41430+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1558990317; cv=none; d=zoho.com; s=zohoarc; b=DdbHZIQ+sVqa4Zxh25W8gD61kynRd5dL4mYAXR0jlmmvDGhfAnnq0bR/kabNI9AkHAIX7F5ojY2R0wSuxBpfcTffAuDxcfR53b1lMnF9S7XknZxsQp4UREswYZZL4gFfAUyhpiu0rZLB1mde8NhWZUiZHWYu1YR6o4CeABB3wH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558990317; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=rBQwgudQ6TA+3tgxsMmfGniEtxKn0qxB4abfq2UxMYg=; b=KHaK2hOGphp/1tLAjwxurBQBYgoCK8mdwvxm00B9rhJCZsdHdq1ozecFXcVVO6t0osdjGu9HC5dUan4fIh80FrujakikR08JEe/U1V+R7vj86m6w3ZzDOJOIirX0JS2JGU9TuG/JRxsJIMRKCbhz0d9zQcFVZh/H9G3RTA2uGC4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41430+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1558990317706879.9381504544596; Mon, 27 May 2019 13:51:57 -0700 (PDT) Return-Path: X-Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by groups.io with SMTP; Mon, 27 May 2019 13:51:56 -0700 X-Received: by mail-wm1-f68.google.com with SMTP id 7so614019wmo.2 for ; Mon, 27 May 2019 13:51:56 -0700 (PDT) X-Gm-Message-State: APjAAAUARiqx9uDXnB9UZnwEwp8VxL8mkrrdSj9s+3cL7g33VtdhJdtL 7+PGtz6Umrg2buXlC/x2vdoE1vrkB8graw== X-Google-Smtp-Source: APXvYqyXK6zWckbLHmkXo8a05jaUhTwjjWBk7zzRAA0ZbXuLC/JtAOjyEOAS9fSPEFeHyz0WvQW5aw== X-Received: by 2002:a1c:f009:: with SMTP id a9mr534812wmb.110.1558990314713; Mon, 27 May 2019 13:51:54 -0700 (PDT) X-Received: from sudo.home ([2a01:cb1d:112:6f00:ccdd:dadc:1517:f416]) by smtp.gmail.com with ESMTPSA id n1sm894808wrx.39.2019.05.27.13.51.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 13:51:54 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Laszlo Ersek , "Gao, Liming" , "Wang, Jian J" , Leif Lindholm , Michael D Kinney Subject: [edk2-devel] [PATCH v2 6/7] BaseTools/tools_def CLANG3x ARM AARCH64: force use of C99 standard Date: Mon, 27 May 2019 22:51:40 +0200 Message-Id: <20190527205141.12344-7-ard.biesheuvel@linaro.org> In-Reply-To: <20190527205141.12344-1-ard.biesheuvel@linaro.org> References: <20190527205141.12344-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1558990317; bh=dZlhlN81b1y/pHjdX246QiaevLT1HLUr2AIQJYK5O8A=; h=Cc:Date:From:Reply-To:Subject:To; b=iMxqalvrxniOfJLkSjKdkKH0jdA27S7wXHcDNOUcJQmGan1nmlLylUoWz9pmjxspTcj oeM9NaMupi+2fRY1jpsAhjimLTGJkHwaiK7bspi5h/xsxH48y4j4SsBL0yRVzogX8E1LZ CRu+Z399nN9Sv8i81Mt2orsH825vy4Z6+zw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" When building OpenSSL for ARM or AARCH64 with recent Clang, the following error may result: In file included from .../CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Ver= ifyEku.c:18: In file included from .../CryptoPkg/Library/OpensslLib/openssl/crypto/inc= lude/internal/x509_int.h:10: In file included from .../CryptoPkg/Library/OpensslLib/openssl/include/in= ternal/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 ^~~~~~~~~~~~~~~~~~~~~~~~~~ 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 --- 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.t= emplate index 26a2cf604f74..7fe6f4406a72 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2280,8 +2280,8 @@ DEFINE CLANG35_ARM_TARGET =3D -target arm-linu= x-gnueabi DEFINE CLANG35_AARCH64_TARGET =3D -target aarch64-linux-gnu =20 DEFINE CLANG35_WARNING_OVERRIDES =3D -Wno-parentheses-equality -Wno-tautol= ogical-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-b= ody -Wno-unknown-warning-option -DEFINE CLANG35_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM= _TARGET) DEF(CLANG35_WARNING_OVERRIDES) -DEFINE CLANG35_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35= _AARCH64_TARGET) -mcmodel=3Dsmall DEF(CLANG35_WARNING_OVERRIDES) +DEFINE CLANG35_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM= _TARGET) DEF(CLANG35_WARNING_OVERRIDES) -std=3Dc99 +DEFINE CLANG35_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35= _AARCH64_TARGET) -mcmodel=3Dsmall DEF(CLANG35_WARNING_OVERRIDES) -std=3Dc99 =20 ################## # CLANG35 ARM definitions @@ -2430,7 +2430,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS =3D DEF(GCC5_X64_D= LINK2_FLAGS) -O0 # CLANG38 ARM definitions ################## DEFINE CLANG38_ARM_TARGET =3D -target arm-linux-gnueabi -DEFINE CLANG38_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM= _TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt +DEFINE CLANG38_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM= _TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt -std=3Dc99 DEFINE CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_D= LINK_FLAGS) =20 *_CLANG38_ARM_PP_FLAGS =3D DEF(GCC_PP_FLAGS) @@ -2474,7 +2474,7 @@ RELEASE_CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_= DLINK_FLAGS) -flto -Wl,-O3 -L # CLANG38 AARCH64 definitions ################## DEFINE CLANG38_AARCH64_TARGET =3D -target aarch64-linux-gnu -DEFINE CLANG38_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG38= _AARCH64_TARGET) -mcmodel=3Dsmall DEF(CLANG38_WARNING_OVERRIDES) +DEFINE CLANG38_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG38= _AARCH64_TARGET) -mcmodel=3Dsmall DEF(CLANG38_WARNING_OVERRIDES) -std=3Dc99 DEFINE CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_TARGET) DEF(GC= C_AARCH64_DLINK_FLAGS) -z common-page-size=3D0x1000 =20 *_CLANG38_AARCH64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41430): https://edk2.groups.io/g/devel/message/41430 Mute This Topic: https://groups.io/mt/31813772/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-