Skip to content

build: build a minimal libarchive for static builds - #4450

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
Micron-ITP-OSS:bgoing/static-minimal-libarchive
Nov 20, 2026
Merged

igaw merged 1 commit into
linux-nvme:masterfrom
Micron-ITP-OSS:bgoing/static-minimal-libarchive

Conversation

@brgoing

@brgoing brgoing commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

A static link of a system libarchive embeds everything it was built with, OpenSSL and libiconv included. Add the WrapDB libarchive and zlib wraps, and have a static build with -Dlibarchive=enabled always build them, with zlib as libarchive's only optional dependency. The plugins only write zip, tar and tar.gz. This adds about 400 KB to the stripped binary.

Other builds still use the system libarchive, and don't fall back to the wraps. The muon job disables libarchive, as muon ignores allow_fallback.

Enable libarchive in the Windows static build, so that the archive options of the vendor plugins work there. The static build is the primary Windows build, not a minimal build.

A static link of a system libarchive embeds everything it was built
with, OpenSSL and libiconv included. Add the WrapDB libarchive and
zlib wraps, and have a static build with -Dlibarchive=enabled always
build them, with zlib as libarchive's only optional dependency. The
plugins only write zip, tar and tar.gz. This adds about 400 KB to the
stripped binary.

Other builds still use the system libarchive, and don't fall back to the
wraps. The muon job disables libarchive, as muon ignores allow_fallback.

Enable libarchive in the Windows static build, so that the archive
options of the vendor plugins work there.  The static build is the
primary Windows build, not a minimal build.

Signed-off-by: Broc Going <bgoing@micron.com>
@igaw
igaw merged commit 9ed9735 into linux-nvme:master Nov 20, 2026
43 checks passed
@igaw

igaw commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Ah nice use of the wrap feature! Thanks!

@brgoing
brgoing deleted the bgoing/static-minimal-libarchive branch November 20, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants