mirror of https://github.com/acidanthera/audk.git
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> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
This commit is contained in:
parent
b3ee616e67
commit
02539e9008
|
@ -38,12 +38,19 @@ endif
|
||||||
CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
|
CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
|
||||||
LINUX:=$(findstring Linux, $(shell uname -s))
|
LINUX:=$(findstring Linux, $(shell uname -s))
|
||||||
DARWIN:=$(findstring Darwin, $(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_CC ?= gcc
|
||||||
BUILD_CXX ?= g++
|
BUILD_CXX ?= g++
|
||||||
BUILD_AS ?= gcc
|
BUILD_AS ?= gcc
|
||||||
BUILD_AR ?= ar
|
BUILD_AR ?= ar
|
||||||
BUILD_LD ?= ld
|
BUILD_LD ?= ld
|
||||||
|
endif
|
||||||
LINKER ?= $(BUILD_CC)
|
LINKER ?= $(BUILD_CC)
|
||||||
ifeq ($(HOST_ARCH), IA32)
|
ifeq ($(HOST_ARCH), IA32)
|
||||||
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
|
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
|
||||||
|
@ -72,14 +79,25 @@ ifeq ($(DARWIN),Darwin)
|
||||||
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
|
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
|
||||||
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
|
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
|
||||||
else
|
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 \
|
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
|
||||||
-fno-delete-null-pointer-checks -Wall -Werror \
|
-fno-delete-null-pointer-checks -Wall -Werror \
|
||||||
-Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
|
-Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
|
||||||
-Wno-unused-result -nostdlib -g
|
-Wno-unused-result -nostdlib -g
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(CXX), llvm)
|
||||||
|
BUILD_LFLAGS =
|
||||||
|
BUILD_CXXFLAGS = -Wno-deprecated-register -Wno-unused-result
|
||||||
|
else
|
||||||
BUILD_LFLAGS =
|
BUILD_LFLAGS =
|
||||||
BUILD_CXXFLAGS = -Wno-unused-result
|
BUILD_CXXFLAGS = -Wno-unused-result
|
||||||
|
endif
|
||||||
ifeq ($(HOST_ARCH), IA32)
|
ifeq ($(HOST_ARCH), IA32)
|
||||||
#
|
#
|
||||||
# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
|
# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
|
||||||
|
|
|
@ -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 = 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 \
|
OBJECTS = AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \
|
||||||
VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.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)
|
VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)
|
||||||
|
endif
|
||||||
# keep BUILD_OPTFLAGS last
|
# keep BUILD_OPTFLAGS last
|
||||||
VFR_CXXFLAGS = $(BUILD_OPTFLAGS)
|
VFR_CXXFLAGS = $(BUILD_OPTFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,11 @@ PCCTS_H=../h
|
||||||
#
|
#
|
||||||
# UNIX (default)
|
# UNIX (default)
|
||||||
#
|
#
|
||||||
|
ifeq ($(CXX), llvm)
|
||||||
|
BUILD_CC?=$(CLANG_BIN)clang
|
||||||
|
else
|
||||||
BUILD_CC?=gcc
|
BUILD_CC?=gcc
|
||||||
|
endif
|
||||||
COPT=-O
|
COPT=-O
|
||||||
ANTLR=${BIN_DIR}/antlr
|
ANTLR=${BIN_DIR}/antlr
|
||||||
DLG=${BIN_DIR}/dlg
|
DLG=${BIN_DIR}/dlg
|
||||||
|
|
|
@ -114,7 +114,11 @@ PCCTS_H=../h
|
||||||
#
|
#
|
||||||
# UNIX
|
# UNIX
|
||||||
#
|
#
|
||||||
|
ifeq ($(CXX), llvm)
|
||||||
|
BUILD_CC?=$(CLANG_BIN)clang
|
||||||
|
else
|
||||||
BUILD_CC?=cc
|
BUILD_CC?=cc
|
||||||
|
endif
|
||||||
COPT=-O
|
COPT=-O
|
||||||
ANTLR=${BIN_DIR}/antlr
|
ANTLR=${BIN_DIR}/antlr
|
||||||
DLG=${BIN_DIR}/dlg
|
DLG=${BIN_DIR}/dlg
|
||||||
|
|
Loading…
Reference in New Issue