Sign in

ar(1) on Solnix vs Linux and the BSDs

On Solnix, ar is the illumos ar at /usr/bin/ar, which takes dashed operations such as -r, -q and -x and documents no long options. GNU ar is available as gar from pkgs.solnix.binutils, and FreeBSD's ar is llvm-ar, which writes zero timestamps and UIDs/GIDs by default.

What Solnix runs

A default Solnix system runs the illumos ar at /usr/bin/ar. /usr/xpg4/bin/ar is also shipped. Its synopsis has no stand-alone -s form and no -s on -q, and its -v writes no message to standard error when writing to an archive. GNU ar is not on PATH by default: add pkgs.solnix.binutils, which installs it as gar (its page calls it ar).

Differences

Compared withTopicWhat differs
Linuxsame program as garThe gar from pkgs.solnix.binutils is GNU ar, and its page matches the Linux binutils ar page. Where this note describes Linux ar, gar behaves the same; /usr/bin/ar does not.
Source: Solnix gar(1) NAME, SYNOPSIS, DESCRIPTION; Linux ar(1) SYNOPSIS, DESCRIPTION
Linux, FreeBSDlong optionsSolnix /usr/bin/ar documents no long options. GNU ar's synopsis has --plugin, --target, --output, --record-libdeps and --thin. The FreeBSD llvm-ar page mentions --format (output format when rebuilding) and --plugin (ignored).
Source: illumos ar(1) SYNOPSIS; Linux ar(1) SYNOPSIS; FreeBSD ar(1) DESCRIPTION
Linux, FreeBSDoperation syntaxSolnix ar documents each operation as a dashed option (ar -r, ar -x) with separate flags. GNU ar takes the operation and modifiers in any order in the first argument; llvm-ar writes the operation first. Both make the dash optional.
Source: illumos ar(1) SYNOPSIS; Linux ar(1) OPTIONS; FreeBSD ar(1) SYNOPSIS
FreeBSD-C and -T on extractSolnix -x accepts -C (do not replace like-named files) and -T (truncate over-long names); without -T a too-long name is an error. In llvm-ar, T applies to d, q and r, and x takes only o and P.
Source: illumos ar(1) SYNOPSIS, -C, -T; FreeBSD ar(1) Operations (d [NT], q [LT], r [abTu], x [oP])
Linuxqs and quick appendGNU ar treats the command qs as a synonym for r, replacing existing members. Solnix -q quickly appends without checking whether the files are already in the archive, and -s is a separate option.
Source: illumos ar(1) -q, -s; Linux ar(1) OPTIONS q
FreeBSDdeterministic archivesllvm-ar writes zero timestamps and UIDs/GIDs by default, and its U modifier writes the real values. The Solnix page documents no such default.
Source: FreeBSD ar(1) DESCRIPTION, Deterministic Archives; illumos ar(1) DESCRIPTION
FreeBSDarchive formatsFreeBSD llvm-ar reads SVR4, GNU, BSD, Big Archive and Darwin archives and writes all but SVR4; --format picks the format when it rebuilds an SVR4 archive. The Solnix page describes only the portable format in ar.h(3HEAD).
Source: FreeBSD ar(1) DESCRIPTION; illumos ar(1) DESCRIPTION
Linux-M script modeGNU ar documents -M, which reads an MRI librarian script from standard input. The Solnix page documents no -M.
Source: Linux ar(1) DESCRIPTION (-M); illumos ar(1) SYNOPSIS
FreeBSDdeleting a missing memberIn llvm-ar, deleting a file that is not in the archive is not an error. The Solnix page does not say what -d does with a missing file.
Source: FreeBSD ar(1) Operations d; illumos ar(1) -d

Everyday tasks

TaskSolnixLinuxFreeBSD
list the contents of an archivear -t archivear t archive—
add or replace files in an archivear -r archive filear r archive memberllvm-ar r archive files
delete files from an archivear -d archive filear d archive memberllvm-ar d archive files
quickly append files to an archivear -q archive filear q archive member—
print an archive member to standard outputar -p archive filear p archive member—
regenerate the archive symbol table/indexar -s archivear s archive—

Standards

  • POSIX: ar is a POSIX.1-2024 utility.
  • Solnix: ATTRIBUTES: Interface Stability for /usr/bin/ar is Committed.

Writing portable scripts

  • Write operations in the dashed form the Solnix synopsis shows (-d, -m, -p, -q, -r, -t, -x); the GNU ar and llvm-ar pages accept a leading dash too. Avoid long options, -M, -C, -T and -V.
  • Do not rely on timestamps in archives. llvm-ar zeroes them by default unless U is given, and Solnix does not document a default.

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.