public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yuwei Chen" <yuwei.chen@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Liu, Zhiguang" <zhiguang.liu@intel.com>
Subject: Re: [edk2-devel] [PATCH] Using LLVM compiler set to build BaseTools in Linux
Date: Wed, 15 Jul 2020 04:13:03 +0000	[thread overview]
Message-ID: <DM5PR11MB1594B97FF831D0638F39CAEB967E0@DM5PR11MB1594.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200706063821.1914-1-zhiguang.liu@intel.com>

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Zhiguang Liu
> Sent: Monday, July 6, 2020 2:38 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH] Using LLVM compiler set to build BaseTools in
> Linux
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2842
> 
> To use LLVM to build BaseTools, first set the CLANG_BIN environment value,
> and add "CXX=llvm" to choose LLVM compiler set when using make
> command.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> 
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  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/Source/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:=$(findstring CYGWIN, $(shell uname -s)) LINUX:=$(findstring Linux,
> $(shell uname -s)) DARWIN:=$(findstring Darwin, $(shell uname -s))-+ifeq
> ($(CXX), llvm)+BUILD_CC ?= $(CLANG_BIN)clang+BUILD_CXX ?=
> $(CLANG_BIN)clang+++BUILD_AS ?= $(CLANG_BIN)clang+BUILD_AR ?=
> $(CLANG_BIN)llvm-ar+BUILD_LD ?= $(CLANG_BIN)llvm-ld+else BUILD_CC ?=
> gcc BUILD_CXX ?= g++ BUILD_AS ?= gcc BUILD_AR ?= ar BUILD_LD ?=
> ld+endif LINKER ?= $(BUILD_CC) ifeq ($(HOST_ARCH), IA32) ARCH_INCLUDE
> = -I $(MAKEROOT)/Include/Ia32/@@ -72,14 +79,25 @@ ifeq
> ($(DARWIN),Darwin)  BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing
> -Wall -Werror \ -Wno-deprecated-declarations -Wno-self-assign -Wno-
> unused-result -nostdlib -g else+ifeq ($(CXX), llvm)+BUILD_CFLAGS = -MD -
> fshort-wchar -fno-strict-aliasing -fwrapv \+-fno-delete-null-pointer-checks -
> Wall -Werror \+-Wno-deprecated-declarations -Wno-self-assign \+-Wno-
> unused-result -nostdlib -g+else BUILD_CFLAGS = -MD -fshort-wchar -fno-
> strict-aliasing -fwrapv \ -fno-delete-null-pointer-checks -Wall -Werror \ -
> Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \ -
> Wno-unused-result -nostdlib -g endif+endif+ifeq ($(CXX),
> llvm)+BUILD_LFLAGS =+BUILD_CXXFLAGS = -Wno-deprecated-register -
> Wno-unused-result+else BUILD_LFLAGS = BUILD_CXXFLAGS = -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/VfrCompile/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 = -I Pccts/h
>  #OBJECTS = VfrSyntax.o VfrServices.o DLGLexer.o EfiVfrParser.o
> ATokenBuffer.o DLexerBase.o AParser.o OBJECTS = AParser.o DLexerBase.o
> ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \           VfrFormPkg.o
> VfrError.o VfrUtilityLib.o VfrCompiler.o-+ifeq ($(CXX), llvm)+VFR_CPPFLAGS
> = -Wno-deprecated-register -DPCCTS_USE_NAMESPACE_STD
> $(BUILD_CPPFLAGS)+else VFR_CPPFLAGS = -
> DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)-+endif # keep
> BUILD_OPTFLAGS last VFR_CXXFLAGS = $(BUILD_OPTFLAGS) diff --git
> a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
> b/BaseTools/Source/C/VfrCompile/Pccts/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=../h
>  # #   UNIX  (default) #+ifeq ($(CXX),
> llvm)+BUILD_CC?=$(CLANG_BIN)clang+else BUILD_CC?=gcc+endif COPT=-O
> ANTLR=${BIN_DIR}/antlr DLG=${BIN_DIR}/dlgdiff --git
> a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
> b/BaseTools/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=../h
>  # #   UNIX #+ifeq ($(CXX), llvm)+BUILD_CC?=$(CLANG_BIN)clang+else
> BUILD_CC?=cc+endif COPT=-O ANTLR=${BIN_DIR}/antlr
> DLG=${BIN_DIR}/dlg--
> 2.25.1.windows.1
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#62063): https://edk2.groups.io/g/devel/message/62063
> Mute This Topic: https://groups.io/mt/75328235/4546272
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [yuwei.chen@intel.com] -=-=-=-=-=-=


  reply	other threads:[~2020-07-15  4:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  6:38 [PATCH] Using LLVM compiler set to build BaseTools in Linux Zhiguang Liu
2020-07-15  4:13 ` Yuwei Chen [this message]
2020-07-21  3:29 ` Bob Feng
2020-07-21  3:51 ` Bob Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR11MB1594B97FF831D0638F39CAEB967E0@DM5PR11MB1594.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox