From 50fbd6685ec88f1dc81451923d7c80fb0d18ca8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Thu, 14 Apr 2022 19:19:46 +0200 Subject: [PATCH 12/24] Stop calling ranlib on created / installed libraries (#11184) `ranlib` seems unnecessary if a POSIX-compliant `ar` is used and time stamps are preserved when a `.a` file is installed. (cherry picked from commit c8e41bade529998c4e66975c88fabf3ac47d7078) --- Changes | 5 +++++ INSTALL.adoc | 4 ++-- Makefile | 2 -- Makefile.build_config.in | 2 +- Makefile.config.in | 4 ---- configure | Bin 581827 -> 581549 bytes configure.ac | 16 +++------------- otherlibs/Makefile.otherlibs.common | 2 -- otherlibs/dynlink/Makefile | 11 +++++------ otherlibs/systhreads/Makefile | 3 --- stdlib/Makefile | 1 - tools/ocamlmklib.ml | 6 ++---- utils/Makefile | 1 - utils/ccomp.ml | 8 ++------ utils/config.mli | 3 --- utils/config.mlp | 2 -- 16 files changed, 20 insertions(+), 50 deletions(-) diff --git a/Changes b/Changes index 13eb7fef98..6f92ee9965 100644 --- a/Changes +++ b/Changes @@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch - #11392, #11392: assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) +### Compiler user-interface and warnings: + +- #11184: Stop calling ranlib on created / installed libraries + (Sébastien Hinderer, review by Xavier Leroy) + ### Manual and documentation: - #11045, #11409: document that the array argument to `caml_callbackN` diff --git a/INSTALL.adoc b/INSTALL.adoc index f4199ca49a..08d67ebbbe 100644 --- a/INSTALL.adoc +++ b/INSTALL.adoc @@ -43,8 +43,8 @@ * Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary for shared library support. -* Binutils including `ar`, `ranlib`, and `strip` are required if your - distribution does not already provide them with the C compiler. +* Binutils including `ar` and `strip` are required if your distribution + does not already provide them with the C compiler. == Configuration diff --git a/Makefile b/Makefile index 3c74bc79df..0e92785da2 100644 --- a/Makefile +++ b/Makefile @@ -585,8 +585,6 @@ endif ifeq "$(INSTALL_OCAMLNAT)" "true" $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" endif - cd "$(INSTALL_COMPLIBDIR)" && \ - $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A) # Installation of the *.ml sources of compiler-libs .PHONY: install-compiler-sources diff --git a/Makefile.build_config.in b/Makefile.build_config.in index eeac09dd76..4d6705d252 100644 --- a/Makefile.build_config.in +++ b/Makefile.build_config.in @@ -20,7 +20,7 @@ # $(ROOTDIR) has been defined. include $(ROOTDIR)/Makefile.config -INSTALL ?= @INSTALL@ +INSTALL ?= @INSTALL@ -p INSTALL_DATA ?= @INSTALL_DATA@ INSTALL_PROG ?= @INSTALL_PROGRAM@ diff --git a/Makefile.config.in b/Makefile.config.in index eb3d85eb1d..4badb74c3f 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@ ### How to invoke the C preprocessor through the C compiler CPP=@CPP@ -### How to invoke ranlib -RANLIB=@RANLIB@ -RANLIBCMD=@RANLIBCMD@ - ### How to invoke ar ARCMD=@AR@ diff --git a/configure b/configure index 8a2c007fd221bc897a255b4aa80c7f23710fcb10..73ce66bfa0a3de5e886a88c973b2db288b5e4d03 100755 GIT binary patch delta 91 zcmX?nP-EJyt==60{S#P(`nZ^plY(UJueamx2P^N?Ror2wRCOHK#ZgE(H{K3{og6RYK zU>4b?CTHZsIKV)ezG4dNJs|}(H3gMwh?TVpF)A8{?X6Q;ftU@5*|)b&< assert(String.length Config.ar > 0); - let r1 = - command(Printf.sprintf "%s rc %s %s" - Config.ar quoted_archive (quote_files file_list)) in - if r1 <> 0 || String.length Config.ranlib = 0 - then r1 - else command(Config.ranlib ^ " " ^ quoted_archive) + command(Printf.sprintf "%s rc %s %s" + Config.ar quoted_archive (quote_files file_list)) let expand_libname cclibs = cclibs |> List.map (fun cclib -> diff --git a/utils/config.mli b/utils/config.mli index 7f70a52d52..94dee3cb92 100644 --- a/utils/config.mli +++ b/utils/config.mli @@ -82,9 +82,6 @@ val mkexe: string val mkmaindll: string (** The linker command line to build main programs as dlls. *) -val ranlib: string -(** Command to randomize a library, or "" if not needed *) - val default_rpath: string (** Option to add a directory to be searched for libraries at runtime (used by ocamlmklib) *) diff --git a/utils/config.mlp b/utils/config.mlp index 44c6ff8fa5..f758a9b483 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -54,7 +54,6 @@ let native_c_compiler = c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags let native_c_libraries = "%%NATIVECCLIBS%%" let native_pack_linker = "%%PACKLD%%" -let ranlib = "%%RANLIBCMD%%" let default_rpath = "%%RPATH%%" let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" let ar = "%%ARCMD%%" @@ -177,7 +176,6 @@ let configuration_variables = p "bytecomp_c_libraries" bytecomp_c_libraries; p "native_c_libraries" native_c_libraries; p "native_pack_linker" native_pack_linker; - p "ranlib" ranlib; p "architecture" architecture; p "model" model; p_int "int_size" Sys.int_size; -- 2.37.0.rc2