From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web11.31083.1676605885788281122 for ; Thu, 16 Feb 2023 19:51:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QwgS9Jw/; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_rcran@quicinc.com) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31H1wse3002457; Fri, 17 Feb 2023 03:51:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Tdtz//NsWeHhH8quLmHNn9w23Q3kH0AmvViWSzH412w=; b=QwgS9Jw/31/a0B0bRn47fs61lqssi9MII/btusr1kFCvoYbiileLVvQD7gCoaIYG8jB3 YnzHXw2AfpNHuAUDYvKgMmUQiXR8D6X3IDkrznAHM77ndmF9vMCO3ZETOhRKo+ofG4TD gngvfb+XgnL4K2hGO9LG96IxwNcOqp6kg18xGrgqpX+jj8hccqDTTS7woCSYE1MHOc29 11Hc/qWO4NrJPE4DQdBLfY0RZUxDLt2zvadC5vIIptYU67VnOzBPC4NwJ6mL5MDu9+Fi j9SbJTOkWtZ4EiasI30LzzB2Gv6nt+UsJiKnY1srgEOBXImGTjD9pB+6k++k8ObMe1kt Tw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nswjpgjmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 03:51:14 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31H3pEuH001108 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 03:51:14 GMT Received: from linbox.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 16 Feb 2023 19:51:13 -0800 From: "Rebecca Cran" To: , Andrew Fish , Leif Lindholm , Michael D Kinney , Bob Feng , Liming Gao , "Yuwei Chen" CC: Rebecca Cran Subject: [PATCH 0/3] BaseTools: allow users to override CC and CXX on the make command line Date: Thu, 16 Feb 2023 20:50:58 -0700 Message-ID: <20230217035101.880854-1-rebecca@quicinc.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: BriY20sWTHY2iohp0z3BLJuDtxLbVND4 X-Proofpoint-ORIG-GUID: BriY20sWTHY2iohp0z3BLJuDtxLbVND4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-16_18,2023-02-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 mlxscore=0 impostorscore=0 mlxlogscore=812 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302170033 Content-Transfer-Encoding: 8bit Content-Type: text/plain Currently, the BaseTools Makefiles use BUILD_CC and BUILD_CXX, which doesn't allow users to override the compiler to use in the expected way by running e.g. "make CC=clang-17 CXX=clang++-17". clang/llvm support was added in https://bugzilla.tianocore.org/show_bug.cgi?id=2842 in a way that required users to run "make CXX=llvm" and have clang and clang++ executables under $(CLANG_BIN). As far as I know this isn't a standard way of telling a build system to use clang, and so is likely difficult to discover by users. This patch series fixes that, and as a side effect allows the clang analyzer to run via "scan-build make". Since clang 17 defaults to C++17 or newer where the 'register' keyword is deprecated and the warning turned into an error, override the version used when building C++ code via "-std=c++14". Rebecca Cran (3): BaseTools: Allow users to specify compiler to use with make CC= CXX= BaseTools: Improve detection of users wanting to build using clang BaseTools: Build against C++14 when building with clang BaseTools/Source/C/DevicePath/GNUmakefile | 7 ++- BaseTools/Source/C/LzmaCompress/GNUmakefile | 2 +- BaseTools/Source/C/Makefiles/app.makefile | 2 +- BaseTools/Source/C/Makefiles/footer.makefile | 6 +- BaseTools/Source/C/Makefiles/header.makefile | 59 ++++++++++---------- BaseTools/Source/C/VfrCompile/GNUmakefile | 19 ++++--- BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 20 +++---- BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile | 31 +++++----- BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +- 9 files changed, 76 insertions(+), 72 deletions(-) -- 2.30.2