From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=dn5nGeTV; spf=pass (domain: linaro.org, ip: 209.85.166.195, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by groups.io with SMTP; Mon, 03 Jun 2019 09:39:18 -0700 Received: by mail-it1-f195.google.com with SMTP id a186so28590980itg.0 for ; Mon, 03 Jun 2019 09:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=biJ3N5qlBlhULSu39ZEikRXna6wF6grDgTOmKDCO4vk=; b=dn5nGeTVaPlRbBHy7RBnMwGy7alrxYN9iGyUVM4A1VCzHgHdGtjnoaBD327X9+ePQ/ iypkioQfL5h1qFScVrlyr4ekoPnqbxOveTQ19RDhdeWBuDJ7c6Qmlz6NKMMZWZh6G9KZ NT5gFnY8xpR2lJd0IhG36CDQxFcbLafXVfobJ3GWhsqD6bo8r2o+tTpo9ZCrZFNxdqwr 4SJVViN4k4lDSRLP8dMeLaaRnc+547kJFqH64im//veMGvggS4msneke4x/0LBtMBaZ7 AihFM7GFbnB8mauJStX3RmpWJkFiHZ9INz7j+L5G9C9duRa3zkWfq9AWXTByrfk37vib yh4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=biJ3N5qlBlhULSu39ZEikRXna6wF6grDgTOmKDCO4vk=; b=Y7DorqoM1g6xh/BquSas6BBNh2Nr1pfp35dSJTaEhWuOUqsH+CreftC3ymIAX8awWG 9RvPlkibj2KFxBFeGuNf4L4Dnv+V6laCJyHckOY007exQOu2Qb8q8RmQgE3ij/kN9c9O nJdCNdkU9ThjvwR4KkqMMHotAW8DNFd/JmRQ8lY05MXx3t8LMHi1gMBXKF38BCPU6jWp 1wMe6sxrvmWSzzlOK4b9DTB+LNaTdxnTZyCq1bSihBiJerwFrd76dJ7bFSXX/s/7WQJ+ BOyDEp+6MqzAirp6QiOPA7VL6isBdmNipXd4qkYIZZeSZlNzwNxNXnKZOmxxI9FPCv2l wNRA== X-Gm-Message-State: APjAAAW01vj+0WhWEpmQMSVcy6SEMhPPF9nznTVMZ0CWg7Glm/U76ibr kq/O/jWlcpa2Jck2xHvOyldULgBL89OCPuQ1kyE1vQ== X-Google-Smtp-Source: APXvYqwlPT1jrWJbfMRZ+b7sKVdCBUhQ/HA06Mv2VXgxyHhfdAsjF1KipBX1Zv79DkcCeeJw7MbT0izdQAnGSkdqeKM= X-Received: by 2002:a02:ce37:: with SMTP id v23mr17630869jar.2.1559579957193; Mon, 03 Jun 2019 09:39:17 -0700 (PDT) MIME-Version: 1.0 References: <20190603162442.3459-1-ard.biesheuvel@linaro.org> <20190603163234.6jgfhkj6ir4lvaoj@bivouac.eciton.net> In-Reply-To: <20190603163234.6jgfhkj6ir4lvaoj@bivouac.eciton.net> From: "Ard Biesheuvel" Date: Mon, 3 Jun 2019 18:39:06 +0200 Message-ID: Subject: Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue To: Leif Lindholm Cc: edk2-devel-groups-io , Laszlo Ersek , "Kinney, Michael D" , "Gao, Liming" , Jian J Wang , Ting Ye , Xiaoyu Lu Content-Type: text/plain; charset="UTF-8" On Mon, 3 Jun 2019 at 18:32, Leif Lindholm 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 > > Cc: Ting Ye > > Cc: Xiaoyu Lu > > Signed-off-by: Ard Biesheuvel > > Reviewed-by: Leif Lindholm > 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 > >