]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.6] bpo-31625: Stop using ranlib (GH-10417)
authorstratakis <cstratak@redhat.com>
Thu, 29 Nov 2018 14:43:24 +0000 (15:43 +0100)
committerVictor Stinner <vstinner@redhat.com>
Thu, 29 Nov 2018 14:43:24 +0000 (15:43 +0100)
* stop using ranlib (closes bpo-31625) (#3815)

Instead, simply pass 's' to ar.

* explicitly list objects for the ar command (#3824)

$^ is not portable.

closes bpo-31625

Makefile.pre.in
Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst [new file with mode: 0644]
configure
configure.ac

index 82f7edd1014cff978868aa3d46396d6e2c34b76b..258236d3645096bd30abe929b8396991a3078736 100644 (file)
@@ -37,7 +37,6 @@ CXX=          @CXX@
 MAINCC=                @MAINCC@
 LINKCC=                @LINKCC@
 AR=            @AR@
-RANLIB=                @RANLIB@
 READELF=       @READELF@
 SOABI=         @SOABI@
 LDVERSION=     @LDVERSION@
@@ -593,16 +592,9 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
 
 
 # Build static library
-# avoid long command lines, same as LIBRARY_OBJS
 $(LIBRARY): $(LIBRARY_OBJS)
        -rm -f $@
-       $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
-       $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
-       $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) Python/frozen.o
-       $(AR) $(ARFLAGS) $@ $(MODULE_OBJS)
-       $(AR) $(ARFLAGS) $@ $(MODOBJS)
-       $(RANLIB) $@
+       $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
 
 libpython$(LDVERSION).so: $(LIBRARY_OBJS)
        if test $(INSTSONAME) != $(LDLIBRARY); then \
@@ -1435,7 +1427,6 @@ libainstall:      @DEF_MAKE_RULE@ python-config
                                $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
                        else \
                                $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-                               $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
                        fi; \
                else \
                        echo Skip install of $(LIBRARY) - use make frameworkinstall; \
diff --git a/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst b/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst
new file mode 100644 (file)
index 0000000..dbd078f
--- /dev/null
@@ -0,0 +1 @@
+Stop using ranlib on static libraries. Instead, we assume ar supports the 's' flag.
index 9b137c72603a2e1f7186094e34acbcc68b2e527a..ac29d65a6c08852ee91a653ca55f32f8afe675dc 100755 (executable)
--- a/configure
+++ b/configure
@@ -694,8 +694,6 @@ READELF
 ARFLAGS
 ac_ct_AR
 AR
-RANLIB
-USE_INLINE
 GNULD
 LINKCC
 LDVERSION
@@ -6029,98 +6027,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5
 $as_echo "$LDLIBRARY" >&6; }
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
-    $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
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; 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_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
-    $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  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
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
 
 if test -n "$ac_tool_prefix"; then
   for ac_prog in ar aal
@@ -6227,7 +6133,7 @@ fi
 
 if test -z "$ARFLAGS"
 then
-        ARFLAGS="rc"
+        ARFLAGS="rcs"
 fi
 
 if test -n "$ac_tool_prefix"; then
index f9d406e5e812e542f1268665e0bff527d8cc3f4b..c003025e3d9b5b50800c04cdcd44d5a33cbb5cb7 100644 (file)
@@ -1196,7 +1196,6 @@ fi
 
 AC_MSG_RESULT($LDLIBRARY)
 
-AC_PROG_RANLIB
 AC_SUBST(AR)
 AC_CHECK_TOOLS(AR, ar aal, ar)
 
@@ -1204,7 +1203,7 @@ AC_CHECK_TOOLS(AR, ar aal, ar)
 AC_SUBST(ARFLAGS)
 if test -z "$ARFLAGS"
 then
-        ARFLAGS="rc"
+        ARFLAGS="rcs"
 fi
 
 AC_CHECK_TOOLS([READELF], [readelf], [:])