Sign in

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.

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 withTopicWhat differs
Linuxwhat the command doesSolnix 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
LinuxoptionsThe 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
Linuxdeterministic archivesLinux 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
Linuxexit statusThe 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
Linuxgranlib is GNU ranlibThe 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
FreeBSDFreeBSD page is llvm-arThe 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
FreeBSDdeterministic modeThe 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

Writing portable scripts

  • In Makefiles that run Solnix or Linux ranlib, pass only the archive argument: -D, -U, -t, --plugin and @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.