Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically load compression libraries #31550

Merged
merged 3 commits into from Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions TODO
Expand Up @@ -1400,8 +1400,8 @@ Features:
- kmod-libs (only when called from PID 1)
- libblkid (only in RootImage= handling in PID 1, but not elsewhere)
- libpam (only when called from PID 1)
- bzip2, xz, lz4 (always — gzip and zstd should probably stay static deps the way they are,
since they are so basic and our defaults)
teknoraver marked this conversation as resolved.
Show resolved Hide resolved
- bzip2 (always — gzip should probably stay static dep the way it is,
since it's so basic and our defaults)

* seccomp: maybe use seccomp_merge() to merge our filters per-arch if we can.
Apparently kernel performance is much better with fewer larger seccomp
Expand Down
13 changes: 7 additions & 6 deletions meson.build
Expand Up @@ -1371,16 +1371,19 @@ conf.set10('HAVE_BZIP2', libbzip2.found())
libxz = dependency('liblzma',
required : get_option('xz'))
conf.set10('HAVE_XZ', libxz.found())
libxz_cflags = libxz.partial_dependency(includes: true, compile_args: true)

liblz4 = dependency('liblz4',
version : '>= 1.3.0',
required : get_option('lz4'))
conf.set10('HAVE_LZ4', liblz4.found())
liblz4_cflags = liblz4.partial_dependency(includes: true, compile_args: true)

libzstd = dependency('libzstd',
version : '>= 1.4.0',
required : get_option('zstd'))
conf.set10('HAVE_ZSTD', libzstd.found())
libzstd_cflags = libzstd.partial_dependency(includes: true, compile_args: true)

conf.set10('HAVE_COMPRESSION', libxz.found() or liblz4.found() or libzstd.found())

Expand Down Expand Up @@ -1951,8 +1954,7 @@ libsystemd = shared_library(
link_args : ['-shared',
'-Wl,--version-script=' + libsystemd_sym_path],
link_with : [libbasic,
libbasic_gcrypt,
libbasic_compress],
libbasic_gcrypt],
link_whole : [libsystemd_static],
dependencies : [librt,
threads,
Expand All @@ -1969,7 +1971,6 @@ install_libsystemd_static = static_library(
libsystemd_sources,
basic_sources,
basic_gcrypt_sources,
basic_compress_sources,
fundamental_sources,
include_directories : libsystemd_includes,
build_by_default : static_libsystemd != 'false',
Expand All @@ -1981,12 +1982,12 @@ install_libsystemd_static = static_library(
libcap,
libdl,
libgcrypt,
liblz4,
liblz4_cflags,
libmount,
libopenssl,
librt,
libxz,
libzstd,
libxz_cflags,
libzstd_cflags,
threads,
userspace],
c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
Expand Down