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=TouI2NMA; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Mon, 03 Jun 2019 09:24:49 -0700 Received: by mail-wr1-f65.google.com with SMTP id m3so12768062wrv.2 for ; Mon, 03 Jun 2019 09:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=/xoXhuVRET3StX8JgwxH7RVKXDEoappu8Yp2OUfwbM0=; b=TouI2NMAixYP/10iOpRs3nhN6Uv5SUCL/cwQLntVtnJ9+OE9tyoSO7gMmXJ6a77iNi 87A3ra5DEdkXN7iREu5uewV6R/JbjUpkmdrM525gLf90qTkV1SQOXHE+urvEbmsZdzBW JqFWeBrrh6wRStPRZehf6gEcd5+cgl0bMR5+6t4ZD2LdQocoCFnLfrqkL+NHeMDb2iHV tuxt1RNO2IPYK/mcCBmVrgs+0qlMHzHr1AWjWLpnmyeHmxeRFxL/MEhpXV84rCvTx9X0 nixUkpWCOzSYYr4Bf/yVxvmQeak2BCx3DlC42X8h5NbohVPpWTEwdbygk5Z8qIpTb+a8 +sMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/xoXhuVRET3StX8JgwxH7RVKXDEoappu8Yp2OUfwbM0=; b=GkaR38dKVZLX7j5S4R1R8imvYB3DJ9+Bx8XVoLZZb2Ew0gDrD9c8lhcYnwHiaZF/1y geE1rdbYjlK4GR6/2u8hQhdP2jGAoKBSIDAbNCTUKgY1xL2r2KiLhNsdFCe7PRPIGEfQ w3E4C95a0UJ9ndO50mM//CRLg7e/xLELjVVrUMoY66cysFjs/xTx/ua1YKMkMba4XXDA mup8GAw3YCXcM+Z6TJsAZx4VPpfjo6UHgkXPvFPVfeN6FGOfwNONlJHhE1kpjzm6F7+h r1z+fxtKcoARByII50BLWW7/paGVhMzHba3sCDvBuvPhMTtjo1PgMfWP9jwx1dxV2Vim 3lsg== X-Gm-Message-State: APjAAAW7Zy32mtJddoJlKporQfKCRJatQfexEfYYXJ56p1v3z78W2cVS G7W3liDFlCptudBnVCRDa9FWf7PxJ0CNPw== X-Google-Smtp-Source: APXvYqxbK7uJB6N8twvP8nKd/MCThaK264szLVOpnqtCr0Xd4bHlo3HQ91TlrpFiCTuF/JNXQZQUmA== X-Received: by 2002:adf:ce03:: with SMTP id p3mr18239241wrn.94.1559579087604; Mon, 03 Jun 2019 09:24:47 -0700 (PDT) Return-Path: Received: from e111045-lin.nice.arm.com (206.red-79-157-180.dynamicip.rima-tde.net. [79.157.180.206]) by smtp.gmail.com with ESMTPSA id s63sm6532618wme.17.2019.06.03.09.24.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 09:24:46 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, lersek@redhat.com, michael.d.kinney@intel.com, liming.gao@intel.com, Ard Biesheuvel , Jian J Wang , Ting Ye , Xiaoyu Lu Subject: [PATCH] CryptoPkg CLANG35: add -std=c99 to dodge OpenSSL C atomics issue Date: Mon, 3 Jun 2019 18:24:42 +0200 Message-Id: <20190603162442.3459-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 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 --- 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