site  contact  subhomenews

Decrease size of libllvm

May 29, 2026 — BarryK

The Debian 'libllvm19' package has an enormous library file, 'libLLVM.so.19.1', size 124MiB. The package has a dependency, 'libz3-4', with a library file 'libz3.so.4', size 27MiB.

The download .img file in Easy 7.3.6 is 1113MiB, up from 1101MiB in Easy 7.3.4. The reason for the size bump is the change from Celluloid to SMPlayer; the latter requiring the Qt5 libraries. I would like to rein-in the .img download size; considering whether libllvm19 can be made smaller.

Yes it can, without breaking anything, at least not in my testing so far..

The way I did it is download the 'llvm-toolchain' source package and the patches, from here:

https://packages.debian.org/trixie/libllvm19

Applied the patches, and uploaded the patched source tarball here:

https://distro.ibiblio.org/easyos/source/alphabetical/l/

Then compiled the patched source, in the devx container in Easy 7.3.6:

# mkdir build
# cd build
# cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_SYSCONFDIR=/etc -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_Z3=OFF -DLLVM_TARGETS_TO_BUILD="host;AMDGPU" -DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF -DLLVM_ENABLE_PIC=ON \
-DLLVM_BINDINGS_LIST='' -DLLVM_ENABLE_RTTI=ON -DLLVM_OPTIMIZED_TABLEGEN=ON \
-DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_PROJECTS="" -S ../llvm
# make -j1
# DESTDIR='/mnt/sda2/downloads/downloads3/input694/0-libllvm2/out1' make install

...of course for the DESTDIR variable, you would need to substitute your own path.

Note, Google AI also recommended this, which I did not apply:

 -DLLVM_DYLIB_COMPONENTS="core;support;bitwriter;irreader"

I got all those "-D" settings from general reading and asking Google AI how to compile a smaller libllvm. The result is 'libLLVM.so.19.1' is 66MiB, and there is no dependency on 'libz3-4'. The saving is 85MiB, uncompressed, but it should result in the .img file being about one third of that smaller.

A small victory. Clawing back a bit of space, so that adding the Qt5 library files has not increased the size of the .img file; now a bit smaller. It does open the door to throwing in some other Qt5-based apps.    

Integrating this into woofQ2 though, haven't worked that out. Yes, the smaller libLLVM.so.19.1 in easy.sfs, but the devx SFS will probably want the full libLLVM.so.19.1, and maybe also libz3-4. Thinking about it.    

Tags: easy