ranlib(1) on Solnix vs Linux and the BSDs
The ranlib on PATH in a default Solnix system is the illumos /usr/bin/ranlib, a compatibility script that takes only an archive name and always exits 0. The published page describes GNU binutils ranlib (pkgs.solnix.binutils), which is the same program as on Linux and has -D, -U, -t and @file.
The manual pages
What Solnix runs
A default Solnix system runs the illumos ranlib at /usr/bin/ranlib, and no other variants are shipped. The illumos page says ar(1) now builds the archive table automatically, so ranlib is only a convenience for portable Makefiles. The published page is for the GNU binutils ranlib in pkgs.solnix.binutils. The bundle does not say where that package installs it or whether it comes first on PATH.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | GNU vs illumos ranlib on Solnix | The published Solnix page and Linux ranlib(1) have the same synopsis and options, so the GNU binutils ranlib behaves the same on both. The default /usr/bin/ranlib on Solnix is the illumos script, which is not the same program.Source: Solnix ranlib(1) SYNOPSIS/OPTIONS; Linux ranlib(1) SYNOPSIS/OPTIONS; illumos ranlib(1) SYNOPSIS |
| Linux | options accepted | The illumos ranlib synopsis is only `ranlib archive`. It documents none of -D, -U, -t, -h, -v, --plugin or @file, all of which GNU ranlib on Linux documents. A Linux script passing these flags may not work against the default Solnix binary.Source: illumos ranlib(1) SYNOPSIS; Linux ranlib(1) SYNOPSIS, OPTIONS |
| Linux | what ranlib does | GNU ranlib builds a symbol index and stores it in the archive, and is equivalent to ar -s. The illumos page says the table of contents is now provided automatically by ar(1), and describes ranlib as a convenience script.Source: Linux ranlib(1) DESCRIPTION; Solnix ranlib(1) DESCRIPTION; illumos ranlib(1) DESCRIPTION |
| Linux | exit status | The illumos page says ranlib has exit status 0. A script that expects a non-zero status from ranlib on a bad archive will not get one from the default Solnix binary. The GNU page documents no exit status. Source: illumos ranlib(1) EXIT STATUS; Linux ranlib(1) (no EXIT STATUS section) |
| Linux | deterministic archives | GNU ranlib's default depends on how binutils was configured (--enable-deterministic-archives). -D forces zero UID, GID and timestamp, and -U forces real values. The illumos page does not mention deterministic mode.Source: Solnix ranlib(1) -D, -U; Linux ranlib(1) -D, -U; illumos ranlib(1) DESCRIPTION |
| FreeBSD | different program | The FreeBSD ranlib(1) page is the llvm-ar page (NAME: llvm-ar), not a separate GNU-style ranlib page. The visible text has no ranlib synopsis, and the GNU options -D, -t, -U, -h, -H, -v do not appear in it.Source: FreeBSD ranlib(1) NAME, SYNOPSIS; Solnix ranlib(1) OPTIONS |
| FreeBSD | deterministic default | llvm-ar always writes zero timestamps and UIDs/GIDs by default, and the U modifier restores real values. GNU ranlib on Solnix and Linux follows its build configuration, and its -D and -U flags switch the mode.Source: FreeBSD ranlib(1) Deterministic Archives; Solnix ranlib(1) -D, -U |
| FreeBSD | --plugin | The FreeBSD page says llvm-ar ignores --plugin=<string> for compatibility. The GNU ranlib on Solnix and Linux lists --plugin name in its synopsis, and the page does not say it is ignored.Source: FreeBSD ranlib(1) 'ignored for compatibility'; Solnix ranlib(1) SYNOPSIS |
| FreeBSD | symbol table contents | llvm-ar's symbol table includes both native and bitcode symbols, and it generates a symbol table by default. The GNU page describes only symbols from relocatable object files. Source: FreeBSD ranlib(1) Symbol Table, DESCRIPTION; Solnix ranlib(1) DESCRIPTION |
| FreeBSD | @file | GNU ranlib on Solnix and Linux reads options from @file. The visible FreeBSD text does not document @file for ranlib, and the page is trimmed. Source: Solnix ranlib(1) @file; Linux ranlib(1) @file; FreeBSD ranlib(1) (not in visible text) |
| OpenBSD, NetBSD | no counterpart in bundle | The bundle has no OpenBSD or NetBSD ranlib page, so nothing here says how ranlib behaves there. Source: Bundle header lists only linux and freebsd counterparts |
Standards
- POSIX: ranlib is not a POSIX.1-2024 utility.
- Solnix: The illumos ranlib page lists attributes(7) under SEE ALSO but states no interface stability level in the text provided.
Writing portable scripts
- Do not pass flags to ranlib in portable scripts. The default Solnix ranlib takes only an archive name, and on FreeBSD the page is llvm-ar.
- For a symbol index that works on every system, use ar with the s modifier or a plain `ar rcs`. The bundle shows GNU ranlib equals ar
-s, and illumos ar adds the table automatically.
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.