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=t3lZCEUZ; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by groups.io with SMTP; Mon, 03 Jun 2019 09:32:38 -0700 Received: by mail-wm1-f65.google.com with SMTP id s3so4568261wms.2 for ; Mon, 03 Jun 2019 09:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Gn9wnDTOdZi5l6OKDbhzRMchWzC1HwOAmaFSbYQvFi8=; b=t3lZCEUZeodZdExSZgr/9qMYh7tZh++fth3+B01LaV/ics7WWd56TFxXgBE1x15QEI fiKH+2iaBJUeYsWajcB5HZGPKP+9PQU2YVA/TM2hGDBM2PpeeAjlEjdALUZVqw2zsOat +6Q7eTdJKcwsm5rKD4jxWRC9G4LQB+qo0mlXFRZfNmCnTZHr2BSsKXZhb6OvR2ojF+8/ U51gzclxhO6ybcP5XaSY0e+wW1nhcCYC/FUa1gnxbltHG3DrJpctPM7lQuGp3Q7PGNTu OkSYK8uYOsVPJC7vcRRqVqaMIplHkdwJ2lFqiBr/9IanFQA0uLIb+WLxyG98fEBHjNFW yGCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Gn9wnDTOdZi5l6OKDbhzRMchWzC1HwOAmaFSbYQvFi8=; b=UI8OfNwZUrW5nh9cX4wIR/EkUy7wrKl1nGT9WSqOW15MQ4GJYPUwT4goFfNQntwp1e 5V0zYxIKlZDmkzki4JZNDjneSDJPvKswGl3LiiXrLbCmqOyIy6qzR4O0KG5i51nSvKZV i90xk2eJmbfui0vdW8DMZE6uj9/m9hP1bHeUpeGPCfJwC3l2QFxGEwhl3EJnDUhAN4dy Zm/K/WFQE2XqHs61q/29TgxeSZQeHlBLIqvVHqGgbVz/VFQ7PrtW//F4clQAStfxpTsB /wieJhEWRdyrr/3T+bzFIqxBNXN/f3c46+6w6GH+rbB7jc8pK13WXERLRp3YmuAJXbtJ 7Q/Q== X-Gm-Message-State: APjAAAWPs5kZY5OimbaRcFnVyAHr+a3D31mZhS5XujgiOuTBKLKhH5uE xRuQ1498SixuF5ApV/Y75E/2pw== X-Google-Smtp-Source: APXvYqzxM+F+j5ljnleCCUqT4I9Lkk8/TVlxiKua8RG1jfnPSIFFFiNYS7bdk9Hk7qIlt/s5sofCeg== X-Received: by 2002:a1c:6a11:: with SMTP id f17mr14081799wmc.110.1559579556375; Mon, 03 Jun 2019 09:32:36 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id x129sm10704027wmg.44.2019.06.03.09.32.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jun 2019 09:32:35 -0700 (PDT) Date: Mon, 3 Jun 2019 17:32:34 +0100 From: "Leif Lindholm" To: Ard Biesheuvel Cc: devel@edk2.groups.io, lersek@redhat.com, michael.d.kinney@intel.com, liming.gao@intel.com, Jian J Wang , Ting Ye , Xiaoyu Lu Subject: Re: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Message-ID: <20190603163234.6jgfhkj6ir4lvaoj@bivouac.eciton.net> References: <20190603162442.3459-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20190603162442.3459-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 >