Skip to content

Commit 757e0a7

Browse files
shinderexavierleroy
authored andcommitted
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 c8e41ba)
1 parent 9acf32a commit 757e0a7

16 files changed

Lines changed: 24 additions & 67 deletions

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch
2525
- #11392, #11392: assertion failure with -rectypes and external definitions
2626
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
2727

28+
### Compiler user-interface and warnings:
29+
30+
- #11184: Stop calling ranlib on created / installed libraries
31+
(Sébastien Hinderer, review by Xavier Leroy)
32+
2833
### Manual and documentation:
2934

3035
- #11045, #11409: document that the array argument to `caml_callbackN`

INSTALL.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
* Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary
4444
for shared library support.
4545

46-
* Binutils including `ar`, `ranlib`, and `strip` are required if your
47-
distribution does not already provide them with the C compiler.
46+
* Binutils including `ar` and `strip` are required if your distribution
47+
does not already provide them with the C compiler.
4848

4949
== Configuration
5050

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,6 @@ endif
585585
ifeq "$(INSTALL_OCAMLNAT)" "true"
586586
$(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
587587
endif
588-
cd "$(INSTALL_COMPLIBDIR)" && \
589-
$(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
590588

591589
# Installation of the *.ml sources of compiler-libs
592590
.PHONY: install-compiler-sources

Makefile.build_config.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# $(ROOTDIR) has been defined.
2121

2222
include $(ROOTDIR)/Makefile.config
23-
INSTALL ?= @INSTALL@
23+
INSTALL ?= @INSTALL@ -p
2424
INSTALL_DATA ?= @INSTALL_DATA@
2525
INSTALL_PROG ?= @INSTALL_PROGRAM@
2626

Makefile.config.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@
8888
### How to invoke the C preprocessor through the C compiler
8989
CPP=@CPP@
9090

91-
### How to invoke ranlib
92-
RANLIB=@RANLIB@
93-
RANLIBCMD=@RANLIBCMD@
94-
9591
### How to invoke ar
9692
ARCMD=@AR@
9793

configure

Lines changed: 4 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ AC_SUBST([bootstrapping_flexdll])
119119
AC_SUBST([long_shebang])
120120
AC_SUBST([shebangscripts])
121121
AC_SUBST([AR])
122-
AC_SUBST([RANLIB])
123-
AC_SUBST([RANLIBCMD])
124122
AC_SUBST([mklib])
125123
AC_SUBST([supports_shared_libraries])
126124
AC_SUBST([natdynlink])
@@ -474,32 +472,24 @@ AS_CASE([$enable_dependency_generation],
474472
[compute_deps=true])],
475473
[compute_deps=false])])
476474

477-
# Extracting information from libtool's configuration
478-
AS_IF([test -n "$RANLIB" ],
479-
[RANLIBCMD="$RANLIB"],
480-
[RANLIB="$AR rs"; RANLIBCMD=""]
481-
)
482-
483475
AS_CASE([$host],
484476
# In config/Makefile.mingw*, we had:
485477
# TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
486478
# TOOLPREF=$(TARGET)-
487479
# ARCMD=$(TOOLPREF)ar
488-
# RANLIB=$(TOOLPREF)ranlib
489-
# RANLIBCMD=$(TOOLPREF)ranlib
490-
# However autoconf and libtool seem to use ar and ranlib
480+
# However autoconf and libtool seem to use ar
491481
# So we let them do, at the moment
492482
[*-pc-windows],
493483
[
494484
libext=lib
495-
AR=""; RANLIB=echo; RANLIBCMD=""
485+
AR=""
496486
AS_IF([test "$host_cpu" = "x86_64" ],
497487
[machine="-machine:AMD64 "],
498488
[machine=""])
499489
mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
500490
],
501491
[
502-
mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2) && ${RANLIB} \$(1)"
492+
mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
503493
])
504494

505495
## Find vendor of the C compiler

otherlibs/Makefile.otherlibs.common

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ install::
9595
fi
9696
ifneq "$(STUBSLIB)" ""
9797
$(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
98-
cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
9998
endif
10099

101100
$(INSTALL_DATA) \
@@ -115,7 +114,6 @@ installopt:
115114
$(INSTALL_DATA) \
116115
$(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
117116
"$(INSTALL_LIBDIR)/"
118-
cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
119117
if test -f $(LIBNAME).cmxs; then \
120118
$(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
121119
fi

otherlibs/dynlink/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,11 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
249249
endif
250250

251251
installopt:
252-
if $(NATDYNLINK); then \
253-
$(INSTALL_DATA) \
254-
$(NATOBJS) dynlink.cmxa dynlink.$(A) \
255-
"$(INSTALL_LIBDIR)" && \
256-
cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
257-
fi
252+
ifeq "$(strip $(NATDYNLINK))" "true"
253+
$(INSTALL_DATA) \
254+
$(NATOBJS) dynlink.cmxa dynlink.$(A) \
255+
"$(INSTALL_LIBDIR)"
256+
endif
258257

259258
partialclean:
260259
rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \

otherlibs/systhreads/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ install:
121121
$(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
122122
fi
123123
$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
124-
cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
125124
mkdir -p "$(INSTALL_THREADSLIBDIR)"
126125
$(INSTALL_DATA) \
127126
$(CMIFILES) threads.cma \
@@ -136,11 +135,9 @@ endif
136135

137136
installopt:
138137
$(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
139-
cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
140138
$(INSTALL_DATA) \
141139
$(THREADS_NCOBJS) threads.cmxa threads.$(A) \
142140
"$(INSTALL_THREADSLIBDIR)"
143-
cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
144141

145142
%.cmi: %.mli
146143
$(CAMLC) -c $(COMPFLAGS) $<

0 commit comments

Comments
 (0)