new file mode 100644
@@ -0,0 +1,16 @@
+# Allow git to be wrappered in the environment
+GIT ?= git
+
+INSTALL = install
+INSTALL_DIR = $(INSTALL) -d -m0755 -p
+INSTALL_DATA = $(INSTALL) -m0644 -p
+INSTALL_PROG = $(INSTALL) -m0755 -p
+
+BOOT_DIR ?= /boot
+DEBUG_DIR ?= /usr/lib/debug
+
+SOCKET_LIBS =
+UTIL_LIBS = -lutil
+
+SONAME_LDFLAG = -soname
+SHLIB_LDFLAGS = -shared
@@ -1,3 +1,7 @@
+ifeq ($(llvm),y)
+include $(XEN_ROOT)/config/llvm.mk
+else
include $(XEN_ROOT)/config/StdGNU.mk
+endif
SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
@@ -19,20 +19,4 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
SIZEUTIL = $(CROSS_COMPILE)size
-# Allow git to be wrappered in the environment
-GIT ?= git
-
-INSTALL = install
-INSTALL_DIR = $(INSTALL) -d -m0755 -p
-INSTALL_DATA = $(INSTALL) -m0644 -p
-INSTALL_PROG = $(INSTALL) -m0755 -p
-
-BOOT_DIR ?= /boot
-DEBUG_DIR ?= /usr/lib/debug
-
-SOCKET_LIBS =
-UTIL_LIBS = -lutil
-
-SONAME_LDFLAG = -soname
-SHLIB_LDFLAGS = -shared
-
+include $(XEN_ROOT)/config/GNUCommon.mk
new file mode 100644
@@ -0,0 +1,17 @@
+AS = llvm-as
+LD = ld.lld
+CC = clang
+CXX = clang++
+LD_LTO = llvm-lto
+CPP = $(CC) -E
+ADDR2LINE = llvm-addr2line
+AR = llvm-ar
+RANLIB = llvm-ranlib
+NM = llvm-nm
+STRIP = llvm-strip
+OBJCOPY = llvm-objcopy
+OBJDUMP = llvm-objdump
+SIZEUTIL = llvm-size
+
+include $(XEN_ROOT)/config/GNUCommon.mk
+
Currently, even if we are using clang as a C compiler, we still use GNU binutils. This patch adds new option "llvm" that allows to use linker, objcopy and all other tools from LLVM project. As LLVM tools use different approach for cross-compilation, we don't need CROSS_COMPILE prefix in this case. Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> --- config/GNUCommon.mk | 16 ++++++++++++++++ config/Linux.mk | 4 ++++ config/StdGNU.mk | 18 +----------------- config/llvm.mk | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 config/GNUCommon.mk create mode 100644 config/llvm.mk