public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: "Adhemerval Zanella" <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org, "Vineet Gupta" <vineetg@rivosinc.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Subject: Re: [PATCH 6/6] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS
Date: Mon, 5 Dec 2022 10:57:06 -0500	[thread overview]
Message-ID: <f45a6902-6d2e-141c-ba4e-648b85a2b081@redhat.com> (raw)
In-Reply-To: <20221202190030.1671870-7-adhemerval.zanella@linaro.org>

On 12/2/22 14:00, Adhemerval Zanella via Libc-alpha wrote:
> It allows to be overriden on configure tie the tools with the cross
> compiler used.

Suggest:
~~~
Allow the variables to be overriden or have the defaults come
from the compiler currently in use.
~~~
Needs a v2 to clarify the commit message. Everything up to here can be committed.

> ---
>  aclocal.m4   |  12 +++
>  configure    | 295 +++------------------------------------------------
>  configure.ac |   4 -
>  3 files changed, 27 insertions(+), 284 deletions(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index cbe3c4698a..c7fea8a722 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -133,6 +133,18 @@ if test -z "$GPROF"; then
>      GPROF=`$CC -print-prog-name=gprof`
>  fi
>  AC_SUBST(GPROF)
> +if test -z "$READELF"; then
> +    GPROF=`$CC -print-prog-name=readelf`
> +fi
> +AC_SUBST(READELF)
> +if test -z "$OBJDUMP"; then
> +    GPROF=`$CC -print-prog-name=objdump`
> +fi
> +AC_SUBST(OBJDUMP)
> +if test -z "$NM"; then
> +    GPROF=`$CC -print-prog-name=nm`
> +fi
> +AC_SUBST(NM)

OK.

>  ])
>  
>  dnl Run a static link test with -nostdlib -nostartfiles.
> diff --git a/configure b/configure
> index 8f91bb6e11..5967e5bf67 100755
> --- a/configure
> +++ b/configure

Regenerate.

> @@ -646,7 +646,6 @@ libc_cv_with_fp
>  PYTHON
>  PYTHON_PROG
>  AUTOCONF
> -NM
>  BISON
>  AWK
>  SED
> @@ -654,6 +653,9 @@ MAKEINFO
>  MSGFMT
>  MAKE
>  LD
> +NM
> +OBJDUMP
> +READELF
>  GPROF
>  OBJCOPY
>  AR
> @@ -683,8 +685,6 @@ sysheaders
>  ac_ct_CXX
>  CXXFLAGS
>  CXX
> -OBJDUMP
> -READELF
>  CPP
>  cross_compiling
>  BUILD_CC
> @@ -2870,190 +2870,6 @@ if test -z "$CPP"; then
>    CPP="$CC -E"
>  fi
>  
> -if test -n "$ac_tool_prefix"; then
> -  # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
> -set dummy ${ac_tool_prefix}readelf; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_READELF+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$READELF"; then
> -  ac_cv_prog_READELF="$READELF" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_READELF="${ac_tool_prefix}readelf"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -READELF=$ac_cv_prog_READELF
> -if test -n "$READELF"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
> -$as_echo "$READELF" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -
> -fi
> -if test -z "$ac_cv_prog_READELF"; then
> -  ac_ct_READELF=$READELF
> -  # Extract the first word of "readelf", so it can be a program name with args.
> -set dummy readelf; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_ac_ct_READELF+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$ac_ct_READELF"; then
> -  ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_ac_ct_READELF="readelf"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
> -if test -n "$ac_ct_READELF"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
> -$as_echo "$ac_ct_READELF" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -  if test "x$ac_ct_READELF" = x; then
> -    READELF="false"
> -  else
> -    case $cross_compiling:$ac_tool_warned in
> -yes:)
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
> -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
> -ac_tool_warned=yes ;;
> -esac
> -    READELF=$ac_ct_READELF
> -  fi
> -else
> -  READELF="$ac_cv_prog_READELF"
> -fi
> -
> -if test -n "$ac_tool_prefix"; then
> -  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
> -set dummy ${ac_tool_prefix}objdump; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_OBJDUMP+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$OBJDUMP"; then
> -  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -OBJDUMP=$ac_cv_prog_OBJDUMP
> -if test -n "$OBJDUMP"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
> -$as_echo "$OBJDUMP" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -
> -fi
> -if test -z "$ac_cv_prog_OBJDUMP"; then
> -  ac_ct_OBJDUMP=$OBJDUMP
> -  # Extract the first word of "objdump", so it can be a program name with args.
> -set dummy objdump; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$ac_ct_OBJDUMP"; then
> -  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_ac_ct_OBJDUMP="objdump"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
> -if test -n "$ac_ct_OBJDUMP"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
> -$as_echo "$ac_ct_OBJDUMP" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -  if test "x$ac_ct_OBJDUMP" = x; then
> -    OBJDUMP="false"
> -  else
> -    case $cross_compiling:$ac_tool_warned in
> -yes:)
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
> -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
> -ac_tool_warned=yes ;;
> -esac
> -    OBJDUMP=$ac_ct_OBJDUMP
> -  fi
> -else
> -  OBJDUMP="$ac_cv_prog_OBJDUMP"
> -fi
> -
>  
>  # We need the C++ compiler only for testing.
>  ac_ext=cpp
> @@ -4160,6 +3976,18 @@ if test -z "$GPROF"; then
>      GPROF=`$CC -print-prog-name=gprof`
>  fi
>  
> +if test -z "$READELF"; then
> +    GPROF=`$CC -print-prog-name=readelf`
> +fi
> +
> +if test -z "$OBJDUMP"; then
> +    GPROF=`$CC -print-prog-name=objdump`
> +fi
> +
> +if test -z "$NM"; then
> +    GPROF=`$CC -print-prog-name=nm`
> +fi
> +
>  
>  
>  # Accept binutils 2.25 or newer.
> @@ -4781,99 +4609,6 @@ if test $libc_cv_compiler_ok != yes; then :
>    critic_missing="$critic_missing compiler"
>  fi
>  
> -if test -n "$ac_tool_prefix"; then
> -  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
> -set dummy ${ac_tool_prefix}nm; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_NM+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$NM"; then
> -  ac_cv_prog_NM="$NM" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_NM="${ac_tool_prefix}nm"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -NM=$ac_cv_prog_NM
> -if test -n "$NM"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
> -$as_echo "$NM" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -
> -fi
> -if test -z "$ac_cv_prog_NM"; then
> -  ac_ct_NM=$NM
> -  # Extract the first word of "nm", so it can be a program name with args.
> -set dummy nm; ac_word=$2
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -$as_echo_n "checking for $ac_word... " >&6; }
> -if ${ac_cv_prog_ac_ct_NM+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if test -n "$ac_ct_NM"; then
> -  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  test -z "$as_dir" && as_dir=.
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_ac_ct_NM="nm"
> -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi
> -fi
> -ac_ct_NM=$ac_cv_prog_ac_ct_NM
> -if test -n "$ac_ct_NM"; then
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
> -$as_echo "$ac_ct_NM" >&6; }
> -else
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -fi
> -
> -  if test "x$ac_ct_NM" = x; then
> -    NM="false"
> -  else
> -    case $cross_compiling:$ac_tool_warned in
> -yes:)
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
> -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
> -ac_tool_warned=yes ;;
> -esac
> -    NM=$ac_ct_NM
> -  fi
> -else
> -  NM="$ac_cv_prog_NM"
> -fi
> -
> -
>  if test "x$maintainer" = "xyes"; then
>    for ac_prog in autoconf
>  do
> diff --git a/configure.ac b/configure.ac
> index 022b8f68bc..011844a3d4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -51,8 +51,6 @@ if test $host != $build; then
>  fi
>  AC_SUBST(cross_compiling)
>  AC_PROG_CPP
> -AC_CHECK_TOOL(READELF, readelf, false)
> -AC_CHECK_TOOL(OBJDUMP, objdump, false)

OK. Move...

>  
>  # We need the C++ compiler only for testing.
>  AC_PROG_CXX
> @@ -632,8 +630,6 @@ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
>  AS_IF([test $libc_cv_compiler_ok != yes],
>        [critic_missing="$critic_missing compiler"])
>  
> -AC_CHECK_TOOL(NM, nm, false)

OK. Move...

> -
>  if test "x$maintainer" = "xyes"; then
>    AC_CHECK_PROGS(AUTOCONF, autoconf, no)
>    case "x$AUTOCONF" in

-- 
Cheers,
Carlos.


  parent reply	other threads:[~2022-12-05 15:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 19:00 [PATCH 0/6] Refactor binutils configure usage Adhemerval Zanella
2022-12-02 19:00 ` [PATCH 1/6] configure: Move locale tools early Adhemerval Zanella
2022-12-05 15:56   ` Carlos O'Donell
2022-12-02 19:00 ` [PATCH 2/6] configure: Remove check if as is GNU Adhemerval Zanella
2022-12-05 15:56   ` Carlos O'Donell
2022-12-02 19:00 ` [PATCH 3/6] configure: Remove check if ld " Adhemerval Zanella
2022-12-05 15:56   ` Carlos O'Donell
2022-12-02 19:00 ` [PATCH 4/6] configure: Remove AS check Adhemerval Zanella
2022-12-05 15:56   ` Carlos O'Donell
2022-12-06 13:45   ` Andreas Schwab
2022-12-06 15:59     ` Adhemerval Zanella Netto
2022-12-02 19:00 ` [PATCH 5/6] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella
2022-12-05 15:56   ` Carlos O'Donell
2022-12-07 20:04     ` Adhemerval Zanella Netto
2022-12-02 19:00 ` [PATCH 6/6] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella
2022-12-02 23:10   ` Rajalakshmi Srinivasaraghavan
2022-12-06 13:39     ` Adhemerval Zanella Netto
2022-12-05 15:57   ` Carlos O'Donell [this message]
2022-12-20 22:01 ` [PATCH 0/6] Refactor binutils configure usage Vineet Gupta
2022-12-22 12:54   ` Adhemerval Zanella Netto
2023-01-05 21:39     ` Vineet Gupta
2023-01-05 21:54       ` Adhemerval Zanella Netto

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=f45a6902-6d2e-141c-ba4e-648b85a2b081@redhat.com \
    --to=carlos@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=ludo@gnu.org \
    --cc=vineetg@rivosinc.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).