From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.11928.1595303509313298541 for ; Mon, 20 Jul 2020 20:51:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=M5gvkCUb; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) IronPort-SDR: n1LZtWV2+SKDxzOOrhy7NL9TfKh3OJLdC/R9JAG0N2C6hVNju0Ela+vQ5DzoUI+Y+GAVcjfefH AzDHcJNjKt/g== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="129627443" X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="129627443" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 20:51:48 -0700 IronPort-SDR: qBPw2B6Wdtpe3I3tlFbFuYZYOz/c27gn0DQUbhwR3RjZOS4QqNLZUDkL9XVjMx6tkURg4L+bx9 GioEeb+io+qg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="319761717" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga002.fm.intel.com with ESMTP; 20 Jul 2020 20:51:48 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 20 Jul 2020 20:51:48 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 20 Jul 2020 20:51:48 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.51) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:51:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1NHnefOGfv6z1CVJFzQ5iOAqa76O7fvpccG0IHHkS6WUgT4RvZDZEWiPGGvoNuPoC/83DdwcYiBBEawqI4GX38aEXf6LPLY9b0/8YnYGhfykZYSNbo7t4mp7r4Id2XNSObuh90idT13220yDOb/nfZ55euDqf2FvFFJvSOEWpIFSsNZpH5N69SFty9qQ6/Nm0Oa0nNU0F/fOTkcD41SjfhkX1eWL1ITenwKe86ftGxacmxdqMoyRj6PQpWLXZV4JI9yEbxv502iOMqryCWfx8/CbokOZuXwSajcpwvkYhSE1OVPqvUCTtpnOBKHQtouPmsUzeJ3G89B7Ivb2o9wCw== 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=JJZEjlmRyTRzb2PUSnnRUGpACO2xK3/R0M5oulCBS7Q=; b=BNVeDoj4e34ezhLVsyeQAMWfDxEGbCsj41WNfPMmD5vpWWrAl/nI78dFzXPPwk9mGOgrm0j2Dw/VMTTUo2i6AAD8MIEp74bqvcZcp6SZWfONMAV/hMZQDcAIRxZ0738Rfljl+nmWZr6z7spT+gpFttPi9lHMsW7eLa8aKlVQIMwkTQjMMJ+CFiNP6BWp+yspFxgaTKGhZV2GDP8Ipf5Le9uxNNAUufS0TYq7Kak9V31CeLuqCacNrdVn4LTAzN28Jr9Bev1qdJJxKbeFEmG/SCvFqcN9uCpuU0OQBZjgSv41merlYsVvkxe62uBFUW4Tny5YNKZNat0AHGEmNbgOrw== 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=JJZEjlmRyTRzb2PUSnnRUGpACO2xK3/R0M5oulCBS7Q=; b=M5gvkCUbrVCZUnQ79In6RPQnDfcOZgGcHmDY61dTZCqoK1fWoijrbVPH4mQK4xlZ9xoTVRh3TPU4ixDEEponVpnO7ApqDUYfWJAtiuAm2/9cvVjJs10edlb7n1vU2RVS12p5C82KXHpYgQHxnp3MWZE++J/aBGlS1HGKBkn1OkU= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN8PR11MB3665.namprd11.prod.outlook.com (2603:10b6:408:91::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Tue, 21 Jul 2020 03:51:46 +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:51:46 +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: AQHWU2AWFu5NUpqV1Ea2eTvRkaODFakRfadA Date: Tue, 21 Jul 2020 03:51:46 +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: 3a63d558-e9f9-417c-603c-08d82d2963fe x-ms-traffictypediagnostic: BN8PR11MB3665: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3bAAQ+Q1v+YWIfPFL8TzLXzzrDb/vE6+UmjFctp2Iet656QgI1lLVdD3atriHcQr7qxXoNqn9DAeIydTbmYTzTf+m0+13jXhPlvOEe7fFHmkBMjf2Cfldi9szQT+MHJ9afkZR2yebSVPgT6da18YI1rnVIjMXdK7NpfZFgMTUg0bmb1ZrUcRYPX2BJ+ZydMmYTQSUD71Ocx0b+joeUZqpUKupyl4ShaMf+hYgqAe0qH3S22WDFyRM2kJ8fkg/xG6RmaIhlm0eqEzohxHYFRmC8TRPEUHMldfVLark/WG0nv7T2OIj7bB5YFK/ry9NZPrZVJsRDyoLm+TyN3PV7EuuIJtkTu171T4fKzlLhz5oHjFzS3PmymLDy1EMBK0F/JYL/qNq6SgsttfZR8ne8wiKA== 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)(136003)(396003)(39860400002)(376002)(366004)(66446008)(66556008)(64756008)(5660300002)(8936002)(4326008)(186003)(52536014)(66476007)(76116006)(33656002)(2906002)(66946007)(966005)(316002)(26005)(71200400001)(107886003)(53546011)(83380400001)(6506007)(8676002)(9686003)(7696005)(55016002)(478600001)(110136005)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: ZM/XxcfRoWsReq6VT/KU9+XtX0OJHAhsRyaBOe5AaisqzBpZPT5Z2N777QX0dSRSdqbPSkC+3P599l8qloEdBhOP1e+ONJBrG6BeztzQyA4y3h7wL2dtdKlgQNIT7WX0+Fty0aX1d5D6MwHFJ9WJcNVETCPNYyINTgeJtPuwf9LIYKfwmj8ReFy8pKndN33g/llGDkBA8ISDcUd1gS3n+sy4TWz/O63ZgSssPIx7yOdPAB5X4HmTIPdAT+05vcMrpIdzGyL2tWLFEVTZrT5hhjRuF7B37WiOpL0P4PXpPmH/xKLb+sR6nVZzPRu4keLkQ6HRsZTnVolMG0I5PAtVVEg/30sxiDPUch5Hd+uOwC/c7zmKM3iWTQa9e2CIfcwhK3Vzatl0Y0eaS9h/ft91CVVPtusuZjFzCWFCkyrwppHaDpQP6UiKKaIk35xgHlVOMVOld1SOKH2UYNjkuRtqWwxTPfxuPnCPwxgzR2/BnwRhxCRQ87Zi/QvS38VrOLF8 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: 3a63d558-e9f9-417c-603c-08d82d2963fe X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 03:51:46.5760 (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: daUs2dRk1BuwTPhK00nSRYk+TFIoFxb09Vc07gFNoCKhe+9u5pLQV1t3rGzPWHxW4wBKkEHFrwKWwFzw3ba6Rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3665 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 Zhiguang,=20 Please update the Bugzilla status. Thanks, Bob -----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