unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Refactor binutils configure usage
@ 2022-12-06 16:02 Adhemerval Zanella via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella via Libc-alpha
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-06 16:02 UTC (permalink / raw)
  To: libc-alpha, Vineet Gupta, Ludovic Courtès,
	Carlos O'Donell

This patchset allows user to override all used binutils tools (ld, ar,
objcopy, gprof, nm, objdump, and readel), and remove unused options
for build-many-glibcs.py.

Adhemerval Zanella (3):
  configure: Allow user override LD, AR, OBJCOPY, and GPROF
  configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS
  scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option

 aclocal.m4                   |  28 +++-
 configure                    | 311 +++--------------------------------
 configure.ac                 |   4 -
 scripts/build-many-glibcs.py |   8 -
 4 files changed, 51 insertions(+), 300 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF
  2022-12-06 16:02 [PATCH v2 0/3] Refactor binutils configure usage Adhemerval Zanella via Libc-alpha
@ 2022-12-06 16:02 ` Adhemerval Zanella via Libc-alpha
  2023-01-11 20:25   ` Carlos O'Donell via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option Adhemerval Zanella via Libc-alpha
  2 siblings, 1 reply; 8+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-06 16:02 UTC (permalink / raw)
  To: libc-alpha, Vineet Gupta, Ludovic Courtès,
	Carlos O'Donell

The only way to override LD, AR, OBJCOPY, and GPROF is through
--with-binutils (setting the environments variables on configure is
overridden by LIBC_PROG_BINUTILS).

The build-many-glibcs.py (bmg) glibcs option generates a working config,
but not fully concise (some tools will be set from environment variable,
while other will be set from $CC --print-prog-name).  So remove the
environment variable set to always use the "$CC --print-prog-name".
---
 aclocal.m4                   | 16 ++++++++++++----
 configure                    | 16 ++++++++++++----
 scripts/build-many-glibcs.py |  3 ---
 3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 7ab8ac023b..cbe3c4698a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -118,12 +118,20 @@ case "$CC" in
     *fuse-ld=lld*) LDNAME=ld.lld;;
     *)             LDNAME=ld;;
 esac
-LD=`$CC -print-prog-name=$LDNAME`
-AR=`$CC -print-prog-name=ar`
+if test -z "$LD"; then
+    LD=`$CC -print-prog-name=$LDNAME`
+fi
+if test -z "$AR"; then
+    AR=`$CC -print-prog-name=ar`
+fi
 AC_SUBST(AR)
-OBJCOPY=`$CC -print-prog-name=objcopy`
+if test -z "$OBJCOPY"; then
+    OBJCOPY=`$CC -print-prog-name=objcopy`
+fi
 AC_SUBST(OBJCOPY)
-GPROF=`$CC -print-prog-name=gprof`
+if test -z "$GPROF"; then
+    GPROF=`$CC -print-prog-name=gprof`
+fi
 AC_SUBST(GPROF)
 ])
 
diff --git a/configure b/configure
index 62c2581cb0..8f91bb6e11 100755
--- a/configure
+++ b/configure
@@ -4145,12 +4145,20 @@ case "$CC" in
     *fuse-ld=lld*) LDNAME=ld.lld;;
     *)             LDNAME=ld;;
 esac
-LD=`$CC -print-prog-name=$LDNAME`
-AR=`$CC -print-prog-name=ar`
+if test -z "$LD"; then
+    LD=`$CC -print-prog-name=$LDNAME`
+fi
+if test -z "$AR"; then
+    AR=`$CC -print-prog-name=ar`
+fi
 
-OBJCOPY=`$CC -print-prog-name=objcopy`
+if test -z "$OBJCOPY"; then
+    OBJCOPY=`$CC -print-prog-name=objcopy`
+fi
 
-GPROF=`$CC -print-prog-name=gprof`
+if test -z "$GPROF"; then
+    GPROF=`$CC -print-prog-name=gprof`
+fi
 
 
 
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 9292a0d3ff..887ef7b6d5 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object):
             '--host=%s' % glibc.triplet,
             'CC=%s' % glibc.tool_name('gcc'),
             'CXX=%s' % glibc.tool_name('g++'),
-            'AR=%s' % glibc.tool_name('ar'),
-            'LD=%s' % glibc.tool_name('ld'),
             'NM=%s' % glibc.tool_name('nm'),
-            'OBJCOPY=%s' % glibc.tool_name('objcopy'),
             'OBJDUMP=%s' % glibc.tool_name('objdump'),
             'RANLIB=%s' % glibc.tool_name('ranlib'),
             'READELF=%s' % glibc.tool_name('readelf'),
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS
  2022-12-06 16:02 [PATCH v2 0/3] Refactor binutils configure usage Adhemerval Zanella via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella via Libc-alpha
@ 2022-12-06 16:02 ` Adhemerval Zanella via Libc-alpha
  2022-12-06 18:48   ` Adhemerval Zanella Netto via Libc-alpha
  2023-01-11 20:30   ` Carlos O'Donell via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option Adhemerval Zanella via Libc-alpha
  2 siblings, 2 replies; 8+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-06 16:02 UTC (permalink / raw)
  To: libc-alpha, Vineet Gupta, Ludovic Courtès,
	Carlos O'Donell

It allows to be overriden on configure tie the tools with the cross
compiler used.
---
 aclocal.m4                   |  12 ++
 configure                    | 295 ++---------------------------------
 configure.ac                 |   4 -
 scripts/build-many-glibcs.py |   3 -
 4 files changed, 27 insertions(+), 287 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index cbe3c4698a..213835e1d5 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
+    READELF=`$CC -print-prog-name=readelf`
+fi
+AC_SUBST(READELF)
+if test -z "$OBJDUMP"; then
+    OBJDUMP=`$CC -print-prog-name=objdump`
+fi
+AC_SUBST(OBJDUMP)
+if test -z "$NM"; then
+    NM=`$CC -print-prog-name=nm`
+fi
+AC_SUBST(NM)
 ])
 
 dnl Run a static link test with -nostdlib -nostartfiles.
diff --git a/configure b/configure
index 8f91bb6e11..efb891456a 100755
--- a/configure
+++ b/configure
@@ -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
+    READELF=`$CC -print-prog-name=readelf`
+fi
+
+if test -z "$OBJDUMP"; then
+    OBJDUMP=`$CC -print-prog-name=objdump`
+fi
+
+if test -z "$NM"; then
+    NM=`$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)
 
 # 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)
-
 if test "x$maintainer" = "xyes"; then
   AC_CHECK_PROGS(AUTOCONF, autoconf, no)
   case "x$AUTOCONF" in
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 887ef7b6d5..a49f50b792 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object):
             '--host=%s' % glibc.triplet,
             'CC=%s' % glibc.tool_name('gcc'),
             'CXX=%s' % glibc.tool_name('g++'),
-            'NM=%s' % glibc.tool_name('nm'),
-            'OBJDUMP=%s' % glibc.tool_name('objdump'),
             'RANLIB=%s' % glibc.tool_name('ranlib'),
-            'READELF=%s' % glibc.tool_name('readelf'),
             'STRIP=%s' % glibc.tool_name('strip'),
         ]
         if glibc.os == 'gnu':
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option
  2022-12-06 16:02 [PATCH v2 0/3] Refactor binutils configure usage Adhemerval Zanella via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella via Libc-alpha
  2022-12-06 16:02 ` [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella via Libc-alpha
@ 2022-12-06 16:02 ` Adhemerval Zanella via Libc-alpha
  2023-01-11 20:28   ` Carlos O'Donell via Libc-alpha
  2 siblings, 1 reply; 8+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-06 16:02 UTC (permalink / raw)
  To: libc-alpha, Vineet Gupta, Ludovic Courtès,
	Carlos O'Donell

---
 scripts/build-many-glibcs.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index a49f50b792..32f336366c 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -1521,8 +1521,6 @@ class GlibcPolicyDefault(object):
             '--host=%s' % glibc.triplet,
             'CC=%s' % glibc.tool_name('gcc'),
             'CXX=%s' % glibc.tool_name('g++'),
-            'RANLIB=%s' % glibc.tool_name('ranlib'),
-            'STRIP=%s' % glibc.tool_name('strip'),
         ]
         if glibc.os == 'gnu':
             self.configure_args.append('MIG=%s' % glibc.tool_name('mig'))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS
  2022-12-06 16:02 ` [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella via Libc-alpha
@ 2022-12-06 18:48   ` Adhemerval Zanella Netto via Libc-alpha
  2023-01-11 20:30   ` Carlos O'Donell via Libc-alpha
  1 sibling, 0 replies; 8+ messages in thread
From: Adhemerval Zanella Netto via Libc-alpha @ 2022-12-06 18:48 UTC (permalink / raw)
  To: libc-alpha, Vineet Gupta, Ludovic Courtès,
	Carlos O'Donell



On 06/12/22 13:02, Adhemerval Zanella wrote:
> It allows to be overriden on configure tie the tools with the cross
> compiler used.

I forgot to update the commit message with your suggestion Carlos, I will
use the following:

--
Allow the variables to be overriden or have the defaults come
from the compiler currently in use.
--

> ---
>  aclocal.m4                   |  12 ++
>  configure                    | 295 ++---------------------------------
>  configure.ac                 |   4 -
>  scripts/build-many-glibcs.py |   3 -
>  4 files changed, 27 insertions(+), 287 deletions(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index cbe3c4698a..213835e1d5 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
> +    READELF=`$CC -print-prog-name=readelf`
> +fi
> +AC_SUBST(READELF)
> +if test -z "$OBJDUMP"; then
> +    OBJDUMP=`$CC -print-prog-name=objdump`
> +fi
> +AC_SUBST(OBJDUMP)
> +if test -z "$NM"; then
> +    NM=`$CC -print-prog-name=nm`
> +fi
> +AC_SUBST(NM)
>  ])
>  
>  dnl Run a static link test with -nostdlib -nostartfiles.
> diff --git a/configure b/configure
> index 8f91bb6e11..efb891456a 100755
> --- a/configure
> +++ b/configure
> @@ -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
> +    READELF=`$CC -print-prog-name=readelf`
> +fi
> +
> +if test -z "$OBJDUMP"; then
> +    OBJDUMP=`$CC -print-prog-name=objdump`
> +fi
> +
> +if test -z "$NM"; then
> +    NM=`$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)
>  
>  # 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)
> -
>  if test "x$maintainer" = "xyes"; then
>    AC_CHECK_PROGS(AUTOCONF, autoconf, no)
>    case "x$AUTOCONF" in
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 887ef7b6d5..a49f50b792 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object):
>              '--host=%s' % glibc.triplet,
>              'CC=%s' % glibc.tool_name('gcc'),
>              'CXX=%s' % glibc.tool_name('g++'),
> -            'NM=%s' % glibc.tool_name('nm'),
> -            'OBJDUMP=%s' % glibc.tool_name('objdump'),
>              'RANLIB=%s' % glibc.tool_name('ranlib'),
> -            'READELF=%s' % glibc.tool_name('readelf'),
>              'STRIP=%s' % glibc.tool_name('strip'),
>          ]
>          if glibc.os == 'gnu':

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF
  2022-12-06 16:02 ` [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella via Libc-alpha
@ 2023-01-11 20:25   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 8+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-01-11 20:25 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Vineet Gupta,
	Ludovic Courtès

On 12/6/22 11:02, Adhemerval Zanella wrote:
> The only way to override LD, AR, OBJCOPY, and GPROF is through
> --with-binutils (setting the environments variables on configure is
> overridden by LIBC_PROG_BINUTILS).
> 
> The build-many-glibcs.py (bmg) glibcs option generates a working config,
> but not fully concise (some tools will be set from environment variable,
> while other will be set from $CC --print-prog-name).  So remove the
> environment variable set to always use the "$CC --print-prog-name".

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  aclocal.m4                   | 16 ++++++++++++----
>  configure                    | 16 ++++++++++++----
>  scripts/build-many-glibcs.py |  3 ---
>  3 files changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index 7ab8ac023b..cbe3c4698a 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -118,12 +118,20 @@ case "$CC" in
>      *fuse-ld=lld*) LDNAME=ld.lld;;
>      *)             LDNAME=ld;;
>  esac
> -LD=`$CC -print-prog-name=$LDNAME`
> -AR=`$CC -print-prog-name=ar`
> +if test -z "$LD"; then
> +    LD=`$CC -print-prog-name=$LDNAME`
> +fi

OK. Override from env first, then use $CC second.

> +if test -z "$AR"; then
> +    AR=`$CC -print-prog-name=ar`
> +fi

OK. Likewise.

>  AC_SUBST(AR)
> -OBJCOPY=`$CC -print-prog-name=objcopy`
> +if test -z "$OBJCOPY"; then
> +    OBJCOPY=`$CC -print-prog-name=objcopy`
> +fi

OK. Likewise.

>  AC_SUBST(OBJCOPY)
> -GPROF=`$CC -print-prog-name=gprof`
> +if test -z "$GPROF"; then
> +    GPROF=`$CC -print-prog-name=gprof`

OK. Likewise.

> +fi
>  AC_SUBST(GPROF)
>  ])
>  
> diff --git a/configure b/configure
> index 62c2581cb0..8f91bb6e11 100755
> --- a/configure
> +++ b/configure
> @@ -4145,12 +4145,20 @@ case "$CC" in
>      *fuse-ld=lld*) LDNAME=ld.lld;;
>      *)             LDNAME=ld;;
>  esac
> -LD=`$CC -print-prog-name=$LDNAME`
> -AR=`$CC -print-prog-name=ar`
> +if test -z "$LD"; then
> +    LD=`$CC -print-prog-name=$LDNAME`
> +fi
> +if test -z "$AR"; then
> +    AR=`$CC -print-prog-name=ar`
> +fi
>  
> -OBJCOPY=`$CC -print-prog-name=objcopy`
> +if test -z "$OBJCOPY"; then
> +    OBJCOPY=`$CC -print-prog-name=objcopy`
> +fi
>  
> -GPROF=`$CC -print-prog-name=gprof`
> +if test -z "$GPROF"; then
> +    GPROF=`$CC -print-prog-name=gprof`
> +fi
>  
>  
>  
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 9292a0d3ff..887ef7b6d5 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object):
>              '--host=%s' % glibc.triplet,
>              'CC=%s' % glibc.tool_name('gcc'),
>              'CXX=%s' % glibc.tool_name('g++'),
> -            'AR=%s' % glibc.tool_name('ar'),
> -            'LD=%s' % glibc.tool_name('ld'),
>              'NM=%s' % glibc.tool_name('nm'),
> -            'OBJCOPY=%s' % glibc.tool_name('objcopy'),

OK. Cleanup bmg usage to use $CC provided tools.

>              'OBJDUMP=%s' % glibc.tool_name('objdump'),
>              'RANLIB=%s' % glibc.tool_name('ranlib'),
>              'READELF=%s' % glibc.tool_name('readelf'),

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option
  2022-12-06 16:02 ` [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option Adhemerval Zanella via Libc-alpha
@ 2023-01-11 20:28   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 8+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-01-11 20:28 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Vineet Gupta,
	Ludovic Courtès

On 12/6/22 11:02, Adhemerval Zanella wrote:

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  scripts/build-many-glibcs.py | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index a49f50b792..32f336366c 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1521,8 +1521,6 @@ class GlibcPolicyDefault(object):
>              '--host=%s' % glibc.triplet,
>              'CC=%s' % glibc.tool_name('gcc'),
>              'CXX=%s' % glibc.tool_name('g++'),
> -            'RANLIB=%s' % glibc.tool_name('ranlib'),
> -            'STRIP=%s' % glibc.tool_name('strip'),

OK. Agreed, these aren't used and we should make this as concise as possible.

>          ]
>          if glibc.os == 'gnu':
>              self.configure_args.append('MIG=%s' % glibc.tool_name('mig'))

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS
  2022-12-06 16:02 ` [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella via Libc-alpha
  2022-12-06 18:48   ` Adhemerval Zanella Netto via Libc-alpha
@ 2023-01-11 20:30   ` Carlos O'Donell via Libc-alpha
  1 sibling, 0 replies; 8+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-01-11 20:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Vineet Gupta,
	Ludovic Courtès

On 12/6/22 11:02, Adhemerval Zanella wrote:
> It allows to be overriden on configure tie the tools with the cross
> compiler used.

Please repost just this patch with the right commit message and I'll ACK that.

The other two patches can go in right now IMO.

> ---
>  aclocal.m4                   |  12 ++
>  configure                    | 295 ++---------------------------------
>  configure.ac                 |   4 -
>  scripts/build-many-glibcs.py |   3 -
>  4 files changed, 27 insertions(+), 287 deletions(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index cbe3c4698a..213835e1d5 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
> +    READELF=`$CC -print-prog-name=readelf`
> +fi
> +AC_SUBST(READELF)
> +if test -z "$OBJDUMP"; then
> +    OBJDUMP=`$CC -print-prog-name=objdump`
> +fi
> +AC_SUBST(OBJDUMP)
> +if test -z "$NM"; then
> +    NM=`$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..efb891456a 100755
> --- a/configure
> +++ b/configure
> @@ -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
> +    READELF=`$CC -print-prog-name=readelf`
> +fi
> +
> +if test -z "$OBJDUMP"; then
> +    OBJDUMP=`$CC -print-prog-name=objdump`
> +fi
> +
> +if test -z "$NM"; then
> +    NM=`$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)
>  
>  # 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)
> -
>  if test "x$maintainer" = "xyes"; then
>    AC_CHECK_PROGS(AUTOCONF, autoconf, no)
>    case "x$AUTOCONF" in
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 887ef7b6d5..a49f50b792 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object):
>              '--host=%s' % glibc.triplet,
>              'CC=%s' % glibc.tool_name('gcc'),
>              'CXX=%s' % glibc.tool_name('g++'),
> -            'NM=%s' % glibc.tool_name('nm'),
> -            'OBJDUMP=%s' % glibc.tool_name('objdump'),
>              'RANLIB=%s' % glibc.tool_name('ranlib'),
> -            'READELF=%s' % glibc.tool_name('readelf'),

OK. Cleanup bmg. Nice! :-)

>              'STRIP=%s' % glibc.tool_name('strip'),
>          ]
>          if glibc.os == 'gnu':

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-11 20:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 16:02 [PATCH v2 0/3] Refactor binutils configure usage Adhemerval Zanella via Libc-alpha
2022-12-06 16:02 ` [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF Adhemerval Zanella via Libc-alpha
2023-01-11 20:25   ` Carlos O'Donell via Libc-alpha
2022-12-06 16:02 ` [PATCH v2 2/3] configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILS Adhemerval Zanella via Libc-alpha
2022-12-06 18:48   ` Adhemerval Zanella Netto via Libc-alpha
2023-01-11 20:30   ` Carlos O'Donell via Libc-alpha
2022-12-06 16:02 ` [PATCH v2 3/3] scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP option Adhemerval Zanella via Libc-alpha
2023-01-11 20:28   ` Carlos O'Donell via Libc-alpha

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).