[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/5] build: add possibility to use LLVM tools


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 29 Nov 2024 01:49:09 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XCMS+YbSfAwyp6W6fe7rYKq/L/tFgk9e9zJ/1i+/t64=; b=vFfGgkDrldWQXo0G91Zqi0w2OFu+ed4Rod6A4fwECjFbqn6kQ0oHXG759itTYQ9OsuhifbEIsGoFZm9p/dbpNNqeb/n3eypHahWCmV+zzHpTpSxRP4AZlA2wE97WJMms3amnjowCSB/n4mjvhVJeWzq8r4pbcszQnvsM/N0t4SAhzAbn1WwyS2H9gVd81ZEmhqqbZpkChy2C0o0PiiN4Y3PXfDjw+y4tDxzl+89vWa8mZSpZmw3PShOZoLL2shF9HvK+sfIeVRNocj5oay2YawwSyhyY2rUQEZQk9noCFh+bLuRpAFXSsiO0dd/lZ3VQEb6UQ7iIxIcuub2KtrJqng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F/NYeoodPX6aIEZ1u9xgqbM3jXW3ytc5leLStUgMZGoU8I/cBqvSmPhVLt5OOk8SHeogz3udzN9UP+x8i9/J40JMcqJDHvVyAsfTvm1WWAD1z+KMbKYw5+A/MsnLY20BeWvutVF+Hk30t9DLaCV1IxSHzcDw3mSGYF4i3GCy/hRmlBH/OmWakgEf2FknxgQ/0tZwglWnJeEcF/0Rqto+ZHZ2blmQLwwkPu8XXwlZ13Jw6yPfMlUugNUuTlnH/4VbnRkdVWVv0kG9rHYeKlEFMpb32gVtAZL3GadTTe92Mc/u/mdPbUZK1965UVt1ZO+Rpy4wkiYvKmpdFnkRSPo+LQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 29 Nov 2024 01:49:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbQgDi2W51qDW1eEGcI05EH1vd3w==
  • Thread-topic: [PATCH 2/5] build: add possibility to use LLVM tools

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@xxxxxxxx>
---
 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

diff --git a/config/GNUCommon.mk b/config/GNUCommon.mk
new file mode 100644
index 0000000000..71c2303166
--- /dev/null
+++ b/config/GNUCommon.mk
@@ -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
diff --git a/config/Linux.mk b/config/Linux.mk
index 2a84b6b0f3..6f4dc865a2 100644
--- a/config/Linux.mk
+++ b/config/Linux.mk
@@ -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)
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index aaa0d007f7..d723bc274e 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -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
diff --git a/config/llvm.mk b/config/llvm.mk
new file mode 100644
index 0000000000..e474428286
--- /dev/null
+++ b/config/llvm.mk
@@ -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
+
-- 
2.47.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.