From patchwork Fri Nov 29 01:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 13888392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5F00D70E06 for ; Fri, 29 Nov 2024 01:49:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.845648.1261013 (Exim 4.92) (envelope-from ) id 1tGq8L-0004oF-1E; Fri, 29 Nov 2024 01:49:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 845648.1261013; Fri, 29 Nov 2024 01:49:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tGq8K-0004o8-St; Fri, 29 Nov 2024 01:49:24 +0000 Received: by outflank-mailman (input) for mailman id 845648; Fri, 29 Nov 2024 01:49:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tGq8J-0004ZT-Kr for xen-devel@lists.xenproject.org; Fri, 29 Nov 2024 01:49:23 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061e.outbound.protection.outlook.com [2a01:111:f403:2614::61e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2566ee1b-adf4-11ef-a0cf-8be0dac302b0; Fri, 29 Nov 2024 02:49:18 +0100 (CET) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by PAVPR03MB8923.eurprd03.prod.outlook.com (2603:10a6:102:32c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.14; Fri, 29 Nov 2024 01:49:12 +0000 Received: from GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e]) by GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e%7]) with mapi id 15.20.8182.018; Fri, 29 Nov 2024 01:49:12 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2566ee1b-adf4-11ef-a0cf-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjYxNDo6NjFlIiwiaGVsbyI6IkVVUjA1LURCOC1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6IjI1NjZlZTFiLWFkZjQtMTFlZi1hMGNmLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyODQ0OTU4Ljc0ODQ4MSwic2VuZGVyIjoidm9sb2R5bXlyX2JhYmNodWtAZXBhbS5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== 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== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XCMS+YbSfAwyp6W6fe7rYKq/L/tFgk9e9zJ/1i+/t64=; b=HTm1s13zkgeDTWCqqWZU/MHES+bH3UDsin7LFh18mzqdw2XHqpgk0BxYYfdnX/ENO2Vqtl/fByj6vU980o6fBN09lfFWgx4IPtRblCOAuSqfvPi+pebdgUOi185QdeKjx75i2SqVPSfnSV49MpWaOaZ1lt6Fe3TstqYtzLOqAawSA4o8GH00qSKg8uA6UCe86f6cVigcjfZewNCgLSCZkfGCZ6qK4Z7NTWLeEytEpUoTyd+RicgpVlUiG+tiIw9SHYAObpb/N3RL0bPqLQ2dKR53RKL6QyISe44W1FLC1yNhB78fecJwyzhFJGKQw5RYM7vP2XZAd1fQOE5/mzRraw== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH 2/5] build: add possibility to use LLVM tools Thread-Topic: [PATCH 2/5] build: add possibility to use LLVM tools Thread-Index: AQHbQgDi2W51qDW1eEGcI05EH1vd3w== Date: Fri, 29 Nov 2024 01:49:09 +0000 Message-ID: <20241129014850.2852844-3-volodymyr_babchuk@epam.com> References: <20241129014850.2852844-1-volodymyr_babchuk@epam.com> In-Reply-To: <20241129014850.2852844-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.47.0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV1PR03MB10456:EE_|PAVPR03MB8923:EE_ x-ms-office365-filtering-correlation-id: 4ff18fe5-fb8b-4270-986f-08dd10180647 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?Aj7v19V43kX/iYnuK2zEVDerSU?= =?iso-8859-1?q?R7Fa8r/EdGiifgt9FWNnIplneFXSQPnrFfJgWYWhBx7T6eUerZQyuFqP4rJ/?= =?iso-8859-1?q?mep3yQjV5tUgm6LxSGag/+mX3uGNdemnLxkYAHEkZrt/P0jfLfhbd5I7llwq?= =?iso-8859-1?q?dxaNM93Lq9uMOCsyPj+FmW2ZyBnchkpCWlIMcex6NVIa994Ejsxcuw8TX086?= =?iso-8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qDXFKnQ2ubBCYLkS8M2mqpDbJm8NrGOZTciNq?= =?iso-8859-1?q?x+JCcRQx/1yL+7bmdG7DsDDu9KHAfpHELvfZK5vE4ygMHLYeNG5XSHpC9T+n?= =?iso-8859-1?q?MBSDYpJ0GfG2io+tOvtR8Po20Rx2cDpIRIyGnZlesNy43Ty6R9zAX28TmPel?= =?iso-8859-1?q?63Iw9xbXCFT9/qlm+FXmzS+uDVI/rKSbWKwrGeciETvyEUZQZi67ooK0hNNq?= =?iso-8859-1?q?LgEGfY32+3Prbds/rwnVBElXywbB06ZnTkXd6BvQvsdBlSEdoeK1nNEyg8uL?= =?iso-8859-1?q?+1zMqcPEzcbYCUEb9GOMFiUR1g4sI2gufkKljQRJErZkiZJYpJBHqUqD7RhB?= =?iso-8859-1?q?MtDNO/nZuTwuFWKgsOY7kRyg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR03MB10456.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?n88Tru2V4uwLK5QwMASGGCe?= =?iso-8859-1?q?d10iS+S+idx8EWtMd97IhZPaz1LlLumdHPvqaF35ds/XpxMd16aNczAGOjrD?= =?iso-8859-1?q?tspMQAcyIxyi0sXgs8RMZKP4O/f7eUhLgkXth9E2mwguyxmropACaD91RukL?= =?iso-8859-1?q?f5k3WNtVYTxle572l//ndyPyLDuhG1MLmWZXNPczpg3AhRU0gi7cJcaXmW1S?= =?iso-8859-1?q?H5Zet/fvQoN+TqxApksFpWaed21Xp/xUSK9BJMbiRB/2AhjtkySQ2tYYCNQk?= =?iso-8859-1?q?2j8jlwlviOtEIaDGG1OFj7YeMO++OPQjDcxmkM5jc6FfABLTuad8lidWxWzc?= =?iso-8859-1?q?oDAJXqq4NDeKzx3mSHkKbtOGA8TAUhG1g0jmVeKkFUOYmsgdBLCPixTB8c0U?= =?iso-8859-1?q?0u2kTIiuC1IlW/49RtlzVniBVxX0ICvIBYl+jT24mQpEeugRw0MCZfZaTXVZ?= =?iso-8859-1?q?X1no2p5RNCbJDE+UkmAvje8NGBMRxQpy0Y64AXoNXCke7TibcqxOG+uZa2zl?= =?iso-8859-1?q?nIeE5Q4PwQMSuAoRvHa75sA1OfJaxtl0cuxMypwTBQ8TMyOCMf3OmJSTvaJG?= =?iso-8859-1?q?MKd1DuS0uDpXbkDp68n/KsXvokJRMlMJVntE3r87Y7IawfjwfQpwDXHowl8t?= =?iso-8859-1?q?Ip7M76SnRr36r/WT4eVHdjaHfAGIM22xofU4F7jCK59IGXdgLJcHBuSa9Yas?= =?iso-8859-1?q?RC2Oer+Y/WaVnKQIbMv4HgdnrChEclWd/KWTBqjjT58BP614aTPZ1BSHt7K0?= =?iso-8859-1?q?jCU0V4cShF439DwxkrB80+CstI8hf+XeP6cevojxmg9jNnSOqu+mNhcaPF8e?= =?iso-8859-1?q?rifPBk5LT1ZBcYBpfZbIt+Y7XosPOe792K2yzI81dPClpYb9J0FKsRCOIb3z?= =?iso-8859-1?q?MNpOZeCM24SFpe97+/beytOzk6S4afAgzmA/yFmGV80K1ypat9RjDEjFCFWg?= =?iso-8859-1?q?etf1HWRJ7c7l7/JcMxheXZxWdZwfqK0QnUuEYaQ/v2bzS8DdoDDv8MLKJva5?= =?iso-8859-1?q?mXnmip70zg+wCxEHeI4G6T8E5XFBDo6lBbhmI31rscMPIwHodRC9kMgKobPO?= =?iso-8859-1?q?LEqp2Wpxp2K3nCQyGqUETsWyKctlOAdG981yp4T7GIqTAhf5z8iJkc14iPtz?= =?iso-8859-1?q?IHs+R+s3nxSJvO//mVnBtTMjb4EKkBpWtRgAal/iGg3GAH4Bnq3/GJTS+c+S?= =?iso-8859-1?q?SBmPyZl6GTtGo74ptZse/LGYr3b21jANdzN6hY5JqB1rTiv+hTh2v4K0/sUY?= =?iso-8859-1?q?b/7twvjq7KXdvdTwqLZFnGfjxpV4JVzYC3cEO93mY4EaQorcYWgnoNoij0ed?= =?iso-8859-1?q?IEQfd/maADhhFWwbnYCKy4BSWKkl3MFKOuuCm3rhCsV/hHsY7vQipX9OT48Q?= =?iso-8859-1?q?5I1sTG8cCw5ympuZDkbDx/h6uMIxHQdef/KKRnYrLM2GNe9EGE0PkYcurzXo?= =?iso-8859-1?q?0a3CwcBtvDAzrC1TurBIhYg6N7SeS8VMEEi8TffYFQmacvVMf+mj4Udw3EtM?= =?iso-8859-1?q?Q1s5pkUh23SPhaERv4rmafjNnKIASzI4GL7mtjwZnJwgleIuC45KNiaMDJN4?= =?iso-8859-1?q?hZjCw7tZRmteT1y/QEi7kv15mGArHQgJHVq/2be9fYEo1TMSCjvIFGF82onb?= =?iso-8859-1?q?qv4JaESLKdXlv+a48ndAHYiVE3XutvKJczMjkKw=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV1PR03MB10456.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ff18fe5-fb8b-4270-986f-08dd10180647 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2024 01:49:09.7274 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3oP/9zFhR+F77fJ3M0ZWmlV6pKb27QK59e0urS3Foyn+XXc3m+IOCy1NZXcZrDNrbYBMBHsbxu93ot9RaEDvJGO8sdRCGgKoVmapkgX+YA8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB8923 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 --- 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 +