From d15108a4789aa1e3c12b2890b770550c90a30913 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 29 Sep 2017 08:42:41 -0700 Subject: [PATCH] stop using ranlib (closes bpo-31625) (#3815) Instead, simply pass 's' to ar. --- Makefile.pre.in | 11 +-- .../2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst | 1 + configure | 95 +------------------ configure.ac | 3 +- 4 files changed, 4 insertions(+), 106 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index 8f4918dff6e..90eecd82173 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -38,7 +38,6 @@ CXX= @CXX@ MAINCC= @MAINCC@ LINKCC= @LINKCC@ AR= @AR@ -RANLIB= @RANLIB@ READELF= @READELF@ SOABI= @SOABI@ LDVERSION= @LDVERSION@ @@ -577,16 +576,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) $@ $^ libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ @@ -1422,7 +1414,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 index 00000000000..dbd078f0030 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst @@ -0,0 +1 @@ +Stop using ranlib on static libraries. Instead, we assume ar supports the 's' flag. diff --git a/configure b/configure index cef9b6f2189..8a763ef6e49 100755 --- a/configure +++ b/configure @@ -692,7 +692,6 @@ READELF ARFLAGS ac_ct_AR AR -RANLIB GNULD LINKCC LDVERSION @@ -5944,98 +5943,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 @@ -6142,7 +6049,7 @@ fi if test -z "$ARFLAGS" then - ARFLAGS="rc" + ARFLAGS="rcs" fi if test -n "$ac_tool_prefix"; then diff --git a/configure.ac b/configure.ac index 3218162f1be..41bd9effbfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1161,7 +1161,6 @@ fi AC_MSG_RESULT($LDLIBRARY) -AC_PROG_RANLIB AC_SUBST(AR) AC_CHECK_TOOLS(AR, ar aal, ar) @@ -1169,7 +1168,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], [:])