mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: "Bernhard Rosenkränzer" <bero@lindev.ch>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Nathan Chancellor" <natechancellor@gmail.com>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	"Linux Kbuild mailing list" <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH] Fix ld-version.sh script if LLD was built with LLD_VENDOR
Date: Tue, 9 Mar 2021 10:31:40 -0700	[thread overview]
Message-ID: <20210309173140.qbd362rze2d5legg@archlinux-ax161> (raw)
In-Reply-To: <CAK7LNAQb2pCtFgebADigYoRJUo4M3i_4iwS=88QYZx5H+736Hw@mail.gmail.com>

On Wed, Mar 10, 2021 at 02:09:02AM +0900, Masahiro Yamada wrote:
> On Thu, Mar 4, 2021 at 12:34 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > On Thu, Mar 4, 2021 at 9:18 AM Bernhard Rosenkränzer <bero@lindev.ch> wrote:
> > >
> > > If LLD was built with -DLLD_VENDOR="xyz", ld.lld --version output
> > > will prefix LLD_VENDOR. Since LLD_VENDOR can contain spaces, the
> > > LLD identifier isn't guaranteed to be $2 either.
> > >
> > > Adjust the version checker to handle such versions of lld.
> > >
> > > Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
> > > ---
> >
> >
> > Bernhard,
> >
> > Could you senv v2
> > with the suggested code change?
> >
> > Please make sure to add
> > linux-kbuild@vger.kernel.org
> > in the To:
> 
> 
> I did not get v2, but never mind.
> I locally modified the code and applied.
> 
> I added Link: to your original patch
> just in case I make some mistake in the
> code refactoring.
> 
> 
> The final one looks as follows:
> 
> 
> 
> 
> 
> commit 0b2813ba7b0f0a9ff273177e85cbc93d92e76212
> Author: Bernhard Rosenkränzer <bero@lindev.ch>
> Date:   Tue Mar 2 23:12:11 2021 +0100
> 
>     kbuild: Fix ld-version.sh script if LLD was built with LLD_VENDOR
> 
>     If LLD was built with -DLLD_VENDOR="xyz", ld.lld --version output
>     will prefix LLD_VENDOR. Since LLD_VENDOR can contain spaces, the
>     LLD identifier isn't guaranteed to be $2 either.
> 
>     Adjust the version checker to handle such versions of lld.
> 
>     Link: https://lore.kernel.org/lkml/20210302221211.1620858-1-bero@lindev.ch/
>     Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
>     [masahiro yamada: refactor the code]

If it is not too late:

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>

>     Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> 
> diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
> index a463273509b5..30debf78aa09 100755
> --- a/scripts/ld-version.sh
> +++ b/scripts/ld-version.sh
> @@ -44,14 +44,20 @@ if [ "$1" = GNU -a "$2" = ld ]; then
>  elif [ "$1" = GNU -a "$2" = gold ]; then
>         echo "gold linker is not supported as it is not capable of
> linking the kernel proper." >&2
>         exit 1
> -elif [ "$1" = LLD ]; then
> -       version=$2
> -       min_version=$lld_min_version
> -       name=LLD
> -       disp_name=LLD
>  else
> -       echo "$orig_args: unknown linker" >&2
> -       exit 1
> +       while [ $# -gt 1 -a "$1" != "LLD" ]; do
> +               shift
> +       done
> +
> +       if [ "$1" = LLD ]; then
> +               version=$2
> +               min_version=$lld_min_version
> +               name=LLD
> +               disp_name=LLD
> +       else
> +               echo "$orig_args: unknown linker" >&2
> +               exit 1
> +       fi
>  fi
> 
>  # Some distributions append a package release number, as in 2.34-4.fc32
> 
> 
> 
> 
> --
> Best Regards
> Masahiro Yamada

      reply	other threads:[~2021-03-09 17:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 22:12 Bernhard Rosenkränzer
2021-03-03  4:02 ` Nathan Chancellor
2021-03-03 11:38   ` Masahiro Yamada
2021-03-03 17:45     ` Nathan Chancellor
2021-03-04  3:34 ` Masahiro Yamada
2021-03-09 17:09   ` Masahiro Yamada
2021-03-09 17:31     ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210309173140.qbd362rze2d5legg@archlinux-ax161 \
    --to=nathan@kernel.org \
    --cc=bero@lindev.ch \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=natechancellor@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®