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

[PATCH 1/2] kconfig: detect LD implementation


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 29 Apr 2022 11:36:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ma9YKJQlDCAv1sCb57FfMX4fSZLJmr+FZCfb9h8i2+U=; b=XZJkJi+1GT4SQJg3p86IGNdze5lbEKfSnRy2RZY9GHOb8tdOBD/zgSd+7DA5oX2FNkX6brXjY2yVvwRL0ah3w8O1h89C4NY7NkpgN7e2QmYfOtAnViuQTb8SJdBpQ6bV7xyasTXYyFRPRh2I/5I3Sn8kDH41vNOW3+C1ATPejiud8ryS45XDLAS2+e9lAGpnhnCvWK1yyFxw5KMgYHgaIY9uZcauFHFyKc2SasbuMI0tRqS4deh2sMjNJujuv6SUJBiiBpqhTG3kmq2hevkXLC2wTbIHFEX0G3rwvNDBhzT1lp61sbbNNAlCikG3pVQyyKkHsx0obAff412TC8K6Ww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eiQiqoyzttdTj8MO3eamdXC9fyp13+9fsfF4/55v9Fp01qJf0fj/d9dcBfQ395HruJhSeNSkHy+TET31hSAZjAT0b/kelYg+rshyFiMyLkCRtiLLYnk/nCvpn1AyRRcJoJjkkBcn11DOgD4Mc+lID7NNWH3mDIWnGdU/du3GMSJNffU7B5NS3ytemNbw0KnCPzaUGOMJ5tbDWQKUjTIGngAhSQsxv/zsQsDjegEJYpdRgDF5O4jhZKVEUEGJXv0YyDs9J4t/FZL2XyOak4/d0m4EqgG+OlDGMTJtdR4U6pbPyuFnwFEdaql67QLGWFtj7vSXeDm1AMt8qhVQEk7TXA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 29 Apr 2022 09:37:12 +0000
  • Ironport-data: A9a23:BhmC/6qIEAPOLQaXdd4PrFhAXjBeBmIyZBIvgKrLsJaIsI4StFCzt garIBnSO62Iamv9Ko0jYYS08UgP75DXydRrHQM4pCs8ESIRoJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvR4 4Kq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBfbDFmu4/dDlkOjAlIpAe4qHZHD+imJnGp6HGWyOEL/RGKmgTZdddwcAuRGZE+ LofNSwHaQ2Fi6Su2rWnR+Jwh8Mlas72IIcYvXImxjbcZRokacmbH+OWupkFg3Fs2KiiHt6HD yYdQSBoYxnaJQVGJ38cCY4knffujX76G9FdgA3N/ftnvjOMpOB3+LWzb9TTZYKkfNpMmmOJq 0v5/ULzDR5PYbRzzhLAqBpAnNTnjS79HY4fCrC83vprm0GIgHweDgUMUlm2quX/jVSxM/pdI UEJ/islrYAp6VemCNL6WnWQomOAvxMac8pdFas98g7l4rHP/w+TC2wATzhAQN8rrsk7QXotz FDht8ztLSxitvuSU3313rKVpjO7PW4SN30PYQcNVw5D6N7myLzflTrKR9dnVbWz19TzEDSom TSS9nBi2fMUkNIB0Li98RbfmTWwq5PVTwkzoALKQmai6QA/b4mgD2C11WXmAT97BN7xZjG8U LIswqByMMhm4UmxqRGw
  • Ironport-hdrordr: A9a23:p1zsXqlBl2S2ft28g7Q41UoI/mbpDfOlimdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcLC7V5Voj0msl6KdhrNhR4tKPTOWw1dASbsP0WKM+UyFJ8STzI5gPO JbAtFD4b7LfCdHZLjBkW6F+r8bqbHokZxAx92ut0uFJTsaF52IhD0JbzpzfHcGJzWvUvECZe ehD4d81nKdUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpizAWVlzun5JPzDhDdh34lInly6IZn1V KAvx3y562lvf3+4hjA11XL55ATvNf60NNMCOGFl8BQADTxjQSDYphnRtS5zXsIidDqzGxvvM jHoh8mMcg2w3TNflutqR+o4AXk2CZG0Q6U9bc16UGT0vDRdXYfMY5slIhZehzW5w4Lp9dnyp 9G2Gqfqt5+EQ7AtD6V3amHazha0m6P5VYym+8aiHJSFaEEbqVKkIAZ9ERJVL8dASPB7pw9Gu UGNrCS2B9vSyLbU5nlhBgt/DT1NU5DXCtuA3Jy9vB96gIm3UyQlCAjtYkidnRpzuNId3AL3Z WBDk1SrsA+ciYnV9MCOA4/e7rGNoW0e2OrDIuzGyWQKEhVAQOFl3bIiI9Flt2CSdgv8KYYvq jnfRdxiVMSEniefPFmmqc7vyzwfA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Detect GNU and LLVM ld implementations. This is required for further
patches that will introduce diverging behaviour depending on the
linker implementation in use.

Note that LLVM ld returns "compatible with GNU linkers" as part of the
version string, so be on the safe side and use '^' to only match at
the start of the line in case LLVM ever decides to change the text to
use "compatible with GNU ld" instead.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
This was discussed with Jan in:

https://lore.kernel.org/xen-devel/fbe0e0f0-85dd-434b-aca5-fa513b720c0b@xxxxxxxx/

While he would be fine to use the option if it was present, he isn't
convinced tools capabilities should be recorded in Kconfig, and hence
doesn't want to introduce the option himself (I hope I got this worded
right).
---
 xen/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/Kconfig b/xen/Kconfig
index ec2bd9fbcf..134e6e68ad 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -23,6 +23,12 @@ config CLANG_VERSION
        int
        default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
 
+config LD_IS_GNU
+       def_bool $(success,$(LD) --version | head -n 1 | grep -q "^GNU ld")
+
+config LD_IS_LLVM
+       def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
+
 # -fvisibility=hidden reduces -fpic cost, if it's available
 config CC_HAS_VISIBILITY_ATTRIBUTE
        def_bool $(cc-option,-fvisibility=hidden)
-- 
2.35.1




 


Rackspace

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