public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Fangrui Song <maskray@google.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 1/3] configure: Allow LD to be a linker other than GNU ld and gold
Date: Mon, 28 Dec 2020 12:46:19 -0800	[thread overview]
Message-ID: <CAMe9rOojQnskkXgiQcy+cO7myYHKp7y-TzR7r6w3tHK=8xRi2Q@mail.gmail.com> (raw)
In-Reply-To: <20201228194855.510315-2-maskray@google.com>

On Mon, Dec 28, 2020 at 11:49 AM Fangrui Song via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> When using lld as the linker, configure prints a confusing message.
>
> *** These critical programs are missing or too old: GNU ld
>
> lld>=8 can build glibc with very few patches. lld may be built with a
> custom version information (e.g. git commit ID), so a version check is not
> useful at all.

But not all versions of lld can be used to build glibc.  Please find a way
to check the working lld version.

> ---
>  configure    | 13 ++++++++-----
>  configure.ac | 13 ++++++++-----
>  2 files changed, 16 insertions(+), 10 deletions(-)
>
> diff --git a/configure b/configure
> index 6a35553805..6dcd2270f8 100755
> --- a/configure
> +++ b/configure
> @@ -4601,9 +4601,10 @@ if test $ac_verc_fail = yes; then
>  fi
>
>
> -if test -n "`$LD --version | sed -n 's/^GNU \(gold\).*$/\1/p'`"; then
> +case $($LD --version) in
> +  "GNU gold"*)
>    # Accept gold 1.14 or higher
> -  for ac_prog in $LD
> +    for ac_prog in $LD
>  do
>    # Extract the first word of "$ac_prog", so it can be a program name with args.
>  set dummy $ac_prog; ac_word=$2
> @@ -4666,8 +4667,9 @@ if test $ac_verc_fail = yes; then
>    LD=: critic_missing="$critic_missing GNU gold"
>  fi
>
> -else
> -  for ac_prog in $LD
> +    ;;
> +  "GNU ld"*)
> +    for ac_prog in $LD
>  do
>    # Extract the first word of "$ac_prog", so it can be a program name with args.
>  set dummy $ac_prog; ac_word=$2
> @@ -4730,7 +4732,8 @@ if test $ac_verc_fail = yes; then
>    LD=: critic_missing="$critic_missing GNU ld"
>  fi
>
> -fi
> +    ;;
> +esac
>
>  # These programs are version sensitive.
>
> diff --git a/configure.ac b/configure.ac
> index 43cfac9d48..1a2054cd1a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -979,18 +979,21 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
>                   [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>                   AS=: critic_missing="$critic_missing as")
>
> -if test -n "`$LD --version | sed -n 's/^GNU \(gold\).*$/\1/p'`"; then
> +case $($LD --version) in
> +  "GNU gold"*)
>    # Accept gold 1.14 or higher
> -  AC_CHECK_PROG_VER(LD, $LD, --version,
> +    AC_CHECK_PROG_VER(LD, $LD, --version,
>                     [GNU gold.* \([0-9][0-9]*\.[0-9.]*\)],
>                     [1.1[4-9]*|1.[2-9][0-9]*|1.1[0-9][0-9]*|[2-9].*|[1-9][0-9]*],
>                     LD=: critic_missing="$critic_missing GNU gold")
> -else
> -  AC_CHECK_PROG_VER(LD, $LD, --version,
> +    ;;
> +  "GNU ld"*)
> +    AC_CHECK_PROG_VER(LD, $LD, --version,
>                     [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
>                     [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>                     LD=: critic_missing="$critic_missing GNU ld")
> -fi
> +    ;;
> +esac
>
>  # These programs are version sensitive.
>  AC_CHECK_TOOL_PREFIX
> --
> 2.29.2.729.g45daf8777d-goog
>


-- 
H.J.

  reply	other threads:[~2020-12-28 20:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 19:48 [PATCH 0/3] Make glibc build with LLD Fangrui Song
2020-12-28 19:48 ` [PATCH 1/3] configure: Allow LD to be a linker other than GNU ld and gold Fangrui Song
2020-12-28 20:46   ` H.J. Lu [this message]
2020-12-28 21:15     ` [PATCH 1/3] configure: Allow LD to be LLD 9.0.0 or above " Fangrui Song
2020-12-28 19:48 ` [PATCH 2/3] elf: Replace a --defsym trick with an object file to be compatible with lld Fangrui Song
2021-01-11 20:06   ` Fāng-ruì Sòng
2021-01-18 22:08     ` Fāng-ruì Sòng
2021-01-19  0:03   ` H.J. Lu
2021-01-19  8:50     ` Fāng-ruì Sòng
2021-01-19 12:30       ` H.J. Lu
2021-01-20 18:51         ` Fāng-ruì Sòng
2021-01-28  1:03           ` Fāng-ruì Sòng
2021-01-29 14:38             ` Adhemerval Zanella
2021-01-29 15:29               ` H.J. Lu
2021-01-29 18:04                 ` Adhemerval Zanella
2021-01-29 19:28                   ` [PATCH v2] elf: Replace a --defsym trick with an object file to be compatible with LLD Fangrui Song
2021-02-01 13:19                     ` Adhemerval Zanella
2021-02-01 13:45                       ` H.J. Lu
2021-02-01 13:43                     ` Florian Weimer
2020-12-28 19:48 ` [PATCH 3/3] install: Replace scripts/output-format.sed with objdump -f [BZ #26559] Fangrui Song
2021-01-08 19:38   ` Adhemerval Zanella
2021-01-12 11:20     ` Florian Weimer
2021-01-12 12:00       ` Adhemerval Zanella
2021-01-12 17:46         ` Fāng-ruì Sòng
2021-01-12 11:32   ` Andreas Schwab
2021-01-12 11:58     ` Florian Weimer
2020-12-28 21:11 ` [PATCH 0/3] Make glibc build with LLD H.J. Lu
2020-12-28 21:45   ` Fangrui Song
2020-12-28 21:49     ` H.J. Lu
2020-12-28 22:54       ` H.J. Lu
2021-01-05 23:03         ` Fāng-ruì Sòng
2021-01-05 23:33           ` H.J. Lu
2021-01-05 23:41             ` Fāng-ruì Sòng
2021-01-05 23:51               ` H.J. Lu
2021-01-06  0:50                 ` Fāng-ruì Sòng
2021-01-06  1:43                   ` H.J. Lu
2021-01-06  2:00                     ` Fāng-ruì Sòng
2021-01-06  2:14                       ` H.J. Lu
2021-01-05 22:57       ` Fāng-ruì Sòng
2021-01-08  5:04 ` Fāng-ruì Sòng
2021-01-08 17:09   ` H.J. Lu
2021-01-08 18:04     ` Fāng-ruì Sòng

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='CAMe9rOojQnskkXgiQcy+cO7myYHKp7y-TzR7r6w3tHK=8xRi2Q@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).