From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.11657.1595302150538616622 for ; Mon, 20 Jul 2020 20:29:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=OcUKXYs8; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: bob.c.feng@intel.com) IronPort-SDR: pJuJ/mMlknIpgEt8ijKXlUFJWa0h34DjDsqypWHdMiasgizLTZCEAz40F8rPoqwr5FyeQVGsuH QcrtP+4E9F5Q== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="211602107" X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="211602107" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 20:29:09 -0700 IronPort-SDR: fMgzRV6VkIksjE2rKjGoFMvuK+dV45ElCcTQ4DyVdILV1MNaE8C4XntuGnVvfAUiaIByA8kIZH ZuFNrj/CoJHw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="271606621" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 20 Jul 2020 20:29:09 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:29:08 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:29:08 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:29:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4CyzpmoVOvU8Cz+wqjuZy7G77VbJQ+89kdNQ1fzbJ/9ykyPjjFAzgCimRWw9Amz86iO46bkyRnhf9OzrlmVJwhaAJY6Tbm1OqF7V1Fj9hbXc4PegyLhXg+eWioD6dC1juJSfAi9vEW3JnkLb9nuVnuZWp8CfHnRqPmspvVwkmCjMfRo/b8cc+S5maYeGZl2rItzl6lPpYuYgLrtQFycYUOZApz6tjWKRhsRyc3sUr0T7XEqDXxqlX9o2YlwTch6uH+CKlgrLQkplDLFi0ru/QthPCInZOTDAxxaOBSFjMLRCIr1iz8T+stdcdbpFjtzFBU9LajHDGSOpp5kEAy0mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=biwDvsJcZPDdaaaUEFKuRQWX0LO2mCRAM1KdeDbNR5Y=; b=nFeL6oXCkNgfArTwWfv+B8DFEKhNm+/Y4X68gopfa8zndJgv16DEtuj1Xx12xhee9087MCLX29NnWGRfUNB66dNzJb06C7TcKGuHP1n9+X8WyDhe5o7PTlnlgrvaSBQOqO9zfgVCi51ohFK57E+l1ARoZGj808ciy1r9Fm4EMre4birqtA2CKuajrsE0rA1dfq0X4Q8riRzkvSjEkEshkFnLG+GVypHFg+kySDIQQzCCjfslnL4HQUwKyvXz3iA1/eAMg7EradqJ0GZSM7x29cbKFLA1eiXSpRQ4nnn+mXSN5q3oEaJBeRPmLOfJQIE077YvXbdk4lJ8QjpdYu1fUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=biwDvsJcZPDdaaaUEFKuRQWX0LO2mCRAM1KdeDbNR5Y=; b=OcUKXYs8mLAP/BFXv7EfPIywxth+SeTV+MHrSiqyE1BNPH3/2aG/wZpC8QWk2TXzSOeOuJ9UVYlTgz0Kyk6O1NGYv89iGrqJ5SDH1Y982vip2c1KAVx7uNES/aJc4y+H3xtU5UYE9Ht8vWeYCngTmIVN7coYNVr79eCipwv6vl8= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB4036.namprd11.prod.outlook.com (2603:10b6:405:82::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18; Tue, 21 Jul 2020 03:29:06 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069%3]) with mapi id 15.20.3195.026; Tue, 21 Jul 2020 03:29:06 +0000 From: "Bob Feng" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH] Using LLVM compiler set to build BaseTools in Linux Thread-Topic: [PATCH] Using LLVM compiler set to build BaseTools in Linux Thread-Index: AQHWU2AWFu5NUpqV1Ea2eTvRkaODFakRd1eQ Date: Tue, 21 Jul 2020 03:29:06 +0000 Message-ID: References: <20200706063821.1914-1-zhiguang.liu@intel.com> In-Reply-To: <20200706063821.1914-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a80ec88-1e1f-4441-a126-08d82d263964 x-ms-traffictypediagnostic: BN6PR11MB4036: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:565; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qnH8+ziaqoFVNjc2LK6N1WPO0GkdGe9nrNOkHHDGX0+VVoq/zhfXhSEc2XrU3pIYDpyHYtloSQHjjw0BVEHJKQ4+0jIUumJyw/dzBiq547LSmP/YRO+8yLRlendVoNoiPvAB/6e3qop85XWH4GYZaJn5xU1h3eH6+33waUDiNBAWf+oIWpEBfptOmjxl1/LuTHhL8+1H8DsSfN+5YaOKopGyman2fpvJY+Z0OTgysTNza7H6K8yt97qW/fIvGn3RUxLqDdjNiJEG7kO4Yhg/U2osGiGGXkoXplTreAxHanF46yStXiX02WPYxBN/wydqBoFHkP1OgGS4MWMPM+0AqhF1A6xvjyvnJM2chV+6WU4H/cmtzKxH7ZkOT03Ta/yEY5I7f8n7gnt6+GYTA0TD1g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(346002)(376002)(366004)(136003)(39860400002)(396003)(26005)(33656002)(8936002)(71200400001)(66946007)(316002)(107886003)(52536014)(9686003)(66476007)(66556008)(8676002)(55016002)(66446008)(64756008)(7696005)(83380400001)(966005)(4326008)(110136005)(5660300002)(2906002)(86362001)(6506007)(53546011)(76116006)(478600001)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: pmx1ni/r61XbLO8Kr/7V5Z0hsIJImhqzviPesyLEGx4ocDwbflEc/2VlntxO4IsUl9FvTGaWSTCQfKAl6CKthnKIHeXbP1W4s0mxTPKl7DaqHG+U2ah4DHtDYR9tLQJz7uwH1nngjawtvzBQ58usfyuhgQIzjta6ZCVaDKxiKu3Olh330Do79ox7PpzHrVvfUmXtKfDZGKUb0Dg2mcx117NYu73gv+mkCCE8tm2UcaGPdUT6ttZEJ99X9FOjs571drpMsXDSvKTGl9dLQre6MAYseoDTupEdaTuTZ/YmSM+iZBZMVJg6Bt1b2KaK6jGz0piyBMlx0bh98ug0xeIihsseQPOD6xzf1IDGIgjV9b740F5ZUsbixq1xPULnDYPHva6SE8QPikZHSNVMRQIdCcI2LXJ/y0DeSwFi/CriFQtBJpWHJw3Nk/H6TGVCB/q8l4nsHALK9rvbO4zEh+mxWfwhxMURkK12NI+Q9cpwRUejGKQT8VQqRwWneaU64U+N MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0068.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a80ec88-1e1f-4441-a126-08d82d263964 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 03:29:06.5639 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: E3uiVQkjXwPIWNOM0sX7kA98+fn8XBab6apDFz89/ZquN1+UZR30XlfOx92la6VDj78K5FS9a3cZsnTzE8zliw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4036 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Liu, Zhiguang =20 Sent: Monday, July 6, 2020 2:38 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming Subject: [PATCH] Using LLVM compiler set to build BaseTools in Linux Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2842 To use LLVM to build BaseTools, first set the CLANG_BIN environment value, = and add "CXX=3Dllvm" to choose LLVM compiler set when using make command. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiguang Liu --- BaseTools/Source/C/Makefiles/header.makefile | 22 ++++++++++++++++++= ++-- BaseTools/Source/C/VfrCompile/GNUmakefile | 6 ++++-- BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 4 ++++ BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile | 4 ++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Sourc= e/C/Makefiles/header.makefile index 4e9b36d98b..1c105ee7d4 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile @@ -38,12 +38,19 @@ endif CYGWIN:=3D$(findstring CYGWIN, $(shell uname -s)) LINUX:=3D$(findstring Li= nux, $(shell uname -s)) DARWIN:=3D$(findstring Darwin, $(shell uname -s))-+= ifeq ($(CXX), llvm)+BUILD_CC ?=3D $(CLANG_BIN)clang+BUILD_CXX ?=3D $(CLANG_= BIN)clang+++BUILD_AS ?=3D $(CLANG_BIN)clang+BUILD_AR ?=3D $(CLANG_BIN)llvm-= ar+BUILD_LD ?=3D $(CLANG_BIN)llvm-ld+else BUILD_CC ?=3D gcc BUILD_CXX ?=3D = g++ BUILD_AS ?=3D gcc BUILD_AR ?=3D ar BUILD_LD ?=3D ld+endif LINKER ?=3D $= (BUILD_CC) ifeq ($(HOST_ARCH), IA32) ARCH_INCLUDE =3D -I $(MAKEROOT)/Includ= e/Ia32/@@ -72,14 +79,25 @@ ifeq ($(DARWIN),Darwin) BUILD_CFLAGS =3D -MD -f= short-wchar -fno-strict-aliasing -Wall -Werror \ -Wno-deprecated-declaratio= ns -Wno-self-assign -Wno-unused-result -nostdlib -g else+ifeq ($(CXX), llvm= )+BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -fwrapv \+-fno-de= lete-null-pointer-checks -Wall -Werror \+-Wno-deprecated-declarations -Wno-= self-assign \+-Wno-unused-result -nostdlib -g+else BUILD_CFLAGS =3D -MD -fs= hort-wchar -fno-strict-aliasing -fwrapv \ -fno-delete-null-pointer-checks -= Wall -Werror \ -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-r= estrict \ -Wno-unused-result -nostdlib -g endif+endif+ifeq ($(CXX), llvm)+B= UILD_LFLAGS =3D+BUILD_CXXFLAGS =3D -Wno-deprecated-register -Wno-unused-res= ult+else BUILD_LFLAGS =3D BUILD_CXXFLAGS =3D -Wno-unused-result-+endif ifeq= ($(HOST_ARCH), IA32) # # Snow Leopard is a 32-bit and 64-bit environment.= uname -m returns i386, but gcc defaultsdiff --git a/BaseTools/Source/C/Vfr= Compile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile index 42e3d7da02..fc329944b9 100644 --- a/BaseTools/Source/C/VfrCompile/GNUmakefile +++ b/BaseTools/Source/C/VfrCompile/GNUmakefile @@ -16,9 +16,11 @@ TOOL_INCLUDE =3D -I Pccts/h #OBJECTS =3D VfrSyntax.o VfrServices.o DLGLexer.o EfiVfrParser.o ATokenBuf= fer.o DLexerBase.o AParser.o OBJECTS =3D AParser.o DLexerBase.o ATokenBuffe= r.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \ VfrFormPkg.o VfrError= .o VfrUtilityLib.o VfrCompiler.o-+ifeq ($(CXX), llvm)+VFR_CPPFLAGS =3D -Wno= -deprecated-register -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)+else VFR_C= PPFLAGS =3D -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)-+endif # keep BUILD= _OPTFLAGS last VFR_CXXFLAGS =3D $(BUILD_OPTFLAGS) diff --git a/BaseTools/So= urce/C/VfrCompile/Pccts/antlr/makefile b/BaseTools/Source/C/VfrCompile/Pcct= s/antlr/makefile index 8f2cc78c59..559b1c99f1 100644 --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile @@ -164,7 +164,11 @@ PCCTS_H=3D../h # # UNIX (default) #+ifeq ($(CXX), llvm)+BUILD_CC?=3D$(CLANG_BIN)clang+= else BUILD_CC?=3Dgcc+endif COPT=3D-O ANTLR=3D${BIN_DIR}/antlr DLG=3D${BIN_D= IR}/dlgdiff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile b/Base= Tools/Source/C/VfrCompile/Pccts/dlg/makefile index b3a34d3b46..5a3561edec 100644 --- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile @@ -114,7 +114,11 @@ PCCTS_H=3D../h # # UNIX #+ifeq ($(CXX), llvm)+BUILD_CC?=3D$(CLANG_BIN)clang+else BUILD_= CC?=3Dcc+endif COPT=3D-O ANTLR=3D${BIN_DIR}/antlr DLG=3D${BIN_DIR}/dlg--=20 2.25.1.windows.1