ranlib(1) on Solnix vs Linux and the BSDs
On Solnix, ranlib is the illumos script at /usr/bin/ranlib, kept for portable Makefiles: the page says ar(1) already provides what ranlib used to do, and that ranlib has exit status 0. It takes only an archive argument, with none of the GNU options (-D, -U, -t, --plugin, @file) that Linux ranlib has.
The manual pages
- Solnix: ranlib(1) from
pkgs.solnix.illumos-world-man; the default on Solnix · illumos.org - Solnix: granlib(1) (its page calls it ranlib) from
pkgs.solnix.binutils; add the package to get it - Linux: ranlib(1) binutils-2.46
- FreeBSD: ranlib(1) 15.1-RELEASE
What Solnix runs
A default Solnix system runs the illumos ranlib at /usr/bin/ranlib; no other illumos variants are shipped. GNU ranlib is available from pkgs.solnix.binutils, installed as granlib (its page calls it ranlib).
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | what the command does | Solnix ranlib is a compatibility script. The page says ar(1) now provides the index automatically, so ranlib is not needed. Linux (GNU) ranlib generates the index and stores it in the archive; it is equivalent to ar -s.Source: illumos ranlib(1) DESCRIPTION; Linux ranlib(1) DESCRIPTION |
| Linux | options | The Solnix synopsis is ranlib archive, and the page documents no options. Linux ranlib accepts -D, -U, -t, -h/-H, -v/-V, --plugin and @file. What Solnix ranlib does with these is not documented.Source: illumos ranlib(1) SYNOPSIS; Linux ranlib(1) SYNOPSIS, OPTIONS |
| Linux | deterministic archives | Linux ranlib has -D (zero UID, GID and timestamp in the index header) and -U. Its default depends on how binutils was configured. The Solnix ranlib page offers no such switch.Source: Linux ranlib(1) -D, -U; illumos ranlib(1) SYNOPSIS |
| Linux | exit status | The Solnix page states that ranlib has exit status 0. Treat a zero exit as meaning nothing about the archive. The Linux page documents no exit status. Source: illumos ranlib(1) EXIT STATUS; Linux ranlib(1) DESCRIPTION, OPTIONS |
| Linux | granlib is GNU ranlib | The granlib installed by pkgs.solnix.binutils is the same program as Linux ranlib. The two pages have the same synopsis and options, including -D, -U, -t, --plugin and @file.Source: Solnix granlib(1) from pkgs.solnix.binutils SYNOPSIS, OPTIONS; Linux ranlib(1) SYNOPSIS, OPTIONS |
| FreeBSD | FreeBSD page is llvm-ar | The FreeBSD ranlib(1) page is the llvm-ar page, with ar-style operations (d, m, p, q, r, s, t, x) in its synopsis rather than a ranlib-only form. Source: FreeBSD ranlib(1) NAME, SYNOPSIS; illumos ranlib(1) SYNOPSIS |
| FreeBSD | deterministic mode | The FreeBSD page says llvm-ar writes zero timestamps and UIDs/GIDs by default, and the U modifier restores real values. The Solnix ranlib page documents no such mode. Source: FreeBSD ranlib(1) Deterministic Archives; illumos ranlib(1) DESCRIPTION |
Standards
- POSIX: ranlib is not a POSIX.1-2024 utility.
Writing portable scripts
- In Makefiles that run Solnix or Linux ranlib, pass only the archive argument:
-D,-U,-t,--pluginand @file are not documented for/usr/bin/ranlib.The FreeBSD page is llvm-ar, whose synopsis needs an operation letter. - Do not use ranlib's exit status to check that an archive was indexed. The Solnix page says it always exits 0.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.