[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] kconfig: detect LD implementation
- To: Michal Orzel <michal.orzel@xxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 17 Mar 2022 08:52:30 +0100
- 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=PoyyrdDumEhsF7RjQ9qbWjxO0DhwMSSye0BgW8p7cNk=; b=gzyKLMLOxb8BcfGl0lFUlTYAYWIZy+qwc8htmxxg721eaFlEZ2f1EXfPV6GVkJ0ddacRLB4ATIt90Zsym7oWcZdKTwMwdpFRlGGW2HKAiZ8XwJQsy81AiX4blitEJAwo7aTytSkRrU9UlbQ9NJ97W321bsuWfNfFFPguPSKlUtXt1m39M1RyVNSTkmbkOX110UjJms/Ska8ZPKgqSZeGMpVGVWmyIDgWBNVY9KfaXOwLJItCdee9MVBYxMPdtbsb0LJXKBr7fGxvDDFznbqMda0zKdAGef4Xi8YzOv/Zsj8682B2yQGgroKmpu/QxU/AhB3GqVhfx6l8biCLB4KALA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHB50wz0/yrtQkajHsEUi4uM1jqPrtdqLR0gVtwIGgLrFrixvlB7vw3w9TwGTv5XY+grB/VuYnZ8bg+nNAnfEiYgu7il5o5d8Sc35SM9WHDimVAnXPUgrAFUSFrKkUNyxW46Ks4ccRCP1CCRJeyHKiKxQ8FWUUXX1hRlCp9i+sjIUilpCpovMSDqK7B65DaEbej+kicK+6k1dDP/P491jU0nKbCTmowU5iib+C4QscHnMTfbKra198dzxN12cCjEyTAdygFLXO7RKb8QPkNLH7onAM8O4kOErXZtnIjBkAbVUw2CFMsrHxiTzsQw2JKtP4+MH5P52mT2jaNEz64csQ==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, 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>
- Delivery-date: Thu, 17 Mar 2022 07:53:06 +0000
- Ironport-data: A9a23:TmQjbKyt2WFKTxwORSR6t+fixirEfRIJ4+MujC+fZmUNrF6WrkUGx 2tKUW3XPfrbMTPyLoggaNjg8x9QuJTdmtNhSQE6/CAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnj/0bv656yMUOZigHtIQMsadUsxKbVIiGX9JZS5LwbZj2NYz2IfhWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ Nplraa1bBx4L7X3nvVAWj98LDEjL4xK5+qSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY2J4STa2DO JpxhTxHYEjsegdEAXksCpsErcyMg1/vTDcHpwfAzUYwyzeKl1EguFT3C/LXZ9iLSMN9jkue4 GXc8AzRGQoGPdaSzT6E9HOEheLVmy7/HoUIG9WQ6fpCkFCVgGsJB3U+UFqwofC9zEmkSd9bA 0UO/2wlqq1a3FymSJzxUg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YTb7dXsMg24F5VKpEdByj3gbpXXN WGNPuspcq+TGnqL0ww5gJUsZ+RtzUIb1q7q3E5y4KoO2M8pgE686MarPZv6kvouqhNDqWs3N 60QZiApIs+PvP+UpgNdtvpYfHHfFAlEii8eV57HzzcZdQ60jT22trK3Ik=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Mar 16, 2022 at 11:28:48AM +0100, Michal Orzel wrote:
> Hi Roger,
>
> On 14.03.2022 11:55, Roger Pau Monne wrote:
> > 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>
> > ---
> > xen/Kconfig | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/xen/Kconfig b/xen/Kconfig
> > index d134397a0b..e8d5e70d46 100644
> > --- a/xen/Kconfig
> > +++ b/xen/Kconfig
> > @@ -23,6 +23,12 @@ config CLANG_VERSION
> > int
> > default $(shell,$(BASEDIR)/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)
>
> NIT: You do not really need to use head especiialy if grep for the beginning
> of a line.
I'm afraid I don't agree. We use head because we only want to match
against the first line of the output, and then we use '^' to match at
the beginning of such line. Without using head we would end up
matching at the beginning of any line present in the output.
Thanks, Roger.
|