lxc: fix huge binary sizes by backporting upstream Meson dynlink fixes
authorPetr Štetiar <ynezz@true.cz>
Mon, 29 Jul 2024 18:04:06 +0000 (18:04 +0000)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Wed, 21 Aug 2024 14:14:41 +0000 (16:14 +0200)
commiteb6939fdeb5eecb321d40bc94d06ccd9df728658
tree34387362c5e37ceca79f68b90ea51e8776f906bd
parenta486e2ddb9d6042ae92c8d204f5015d1483b8e1e
lxc: fix huge binary sizes by backporting upstream Meson dynlink fixes

LXC after the switch to the Meson build system increased the binary sizes
significantly as each binary is basically static so shipping complete
liblxc which should be linked dynamically.

Upstream later fixed it with series of 10 commits and this fixes are
available in LXC release v6.0.0. Since we can't upstep to that release,
lets fix it by backporting those fixes only, basically making libxlc a
shared library again.

Package sizes before:

 384K lxc-user-nic_5.0.3-1_aarch64_cortex-a53.ipk
 383K lxc-ls_5.0.3-1_aarch64_cortex-a53.ipk
 382K lxc-top_5.0.3-1_aarch64_cortex-a53.ipk
 382K lxc-copy_5.0.3-1_aarch64_cortex-a53.ipk
 381K lxc-unshare_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-start_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-monitor_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-info_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-create_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-autostart_5.0.3-1_aarch64_cortex-a53.ipk
 380K lxc-attach_5.0.3-1_aarch64_cortex-a53.ipk
 379K lxc-execute_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-wait_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-usernsexec_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-unfreeze_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-stop_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-freeze_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-device_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-destroy_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-console_5.0.3-1_aarch64_cortex-a53.ipk
 378K lxc-cgroup_5.0.3-1_aarch64_cortex-a53.ipk
 376K liblxc_5.0.3-1_aarch64_cortex-a53.ipk
 375K lxc-config_5.0.3-1_aarch64_cortex-a53.ipk
 12K lxc-hooks_5.0.3-1_aarch64_cortex-a53.ipk
 11K lxc-templates_5.0.3-1_aarch64_cortex-a53.ipk
 3.7K lxc-checkconfig_5.0.3-1_aarch64_cortex-a53.ipk
 2.4K lxc-configs_5.0.3-1_aarch64_cortex-a53.ipk
 1.9K lxc-auto_5.0.3-1_aarch64_cortex-a53.ipk
 1.6K lxc-common_5.0.3-1_aarch64_cortex-a53.ipk
 1.2K lxc-unprivileged_5.0.3-1_aarch64_cortex-a53.ipk
 978 lxc_5.0.3-1_aarch64_cortex-a53.ipk

Sizes after:

 378K liblxc_5.0.3-2_aarch64_cortex-a53.ipk
 27K lxc-user-nic_5.0.3-2_aarch64_cortex-a53.ipk
 24K lxc-ls_5.0.3-2_aarch64_cortex-a53.ipk
 21K lxc-usernsexec_5.0.3-2_aarch64_cortex-a53.ipk
 21K lxc-top_5.0.3-2_aarch64_cortex-a53.ipk
 20K lxc-unshare_5.0.3-2_aarch64_cortex-a53.ipk
 20K lxc-copy_5.0.3-2_aarch64_cortex-a53.ipk
 20K lxc-attach_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-start_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-info_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-execute_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-device_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-create_5.0.3-2_aarch64_cortex-a53.ipk
 18K lxc-autostart_5.0.3-2_aarch64_cortex-a53.ipk
 17K lxc-destroy_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-wait_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-unfreeze_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-stop_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-freeze_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-console_5.0.3-2_aarch64_cortex-a53.ipk
 16K lxc-cgroup_5.0.3-2_aarch64_cortex-a53.ipk
 15K lxc-monitor_5.0.3-2_aarch64_cortex-a53.ipk
 13K lxc-config_5.0.3-2_aarch64_cortex-a53.ipk
 12K lxc-hooks_5.0.3-2_aarch64_cortex-a53.ipk
 11K lxc-templates_5.0.3-2_aarch64_cortex-a53.ipk
 3.7K lxc-checkconfig_5.0.3-2_aarch64_cortex-a53.ipk
 2.4K lxc-configs_5.0.3-2_aarch64_cortex-a53.ipk
 1.9K lxc-auto_5.0.3-2_aarch64_cortex-a53.ipk
 1.6K lxc-common_5.0.3-2_aarch64_cortex-a53.ipk
 1.1K lxc-unprivileged_5.0.3-2_aarch64_cortex-a53.ipk
 944 lxc_5.0.3-2_aarch64_cortex-a53.ipk

Sum of Package Sizes:

 Before: 8758.78K
 After:   814.64K

The total package size has decreased by approximately 90% after the fix.

References: https://github.com/lxc/lxc/pull/4401
Signed-off-by: Petr Štetiar <ynezz@true.cz>
utils/lxc/Makefile
utils/lxc/patches/001-confile-move-lxc_fill_elevated_privileges-to-tools-l.patch [new file with mode: 0644]
utils/lxc/patches/002-meson-introduce-IN_LIBLXC-preprocessor-macro.patch [new file with mode: 0644]
utils/lxc/patches/003-confile-unhide-lxc_config_define-helpers.patch [new file with mode: 0644]
utils/lxc/patches/004-conf-reorganize-split-code-to-idmap_utils.c.patch [new file with mode: 0644]
utils/lxc/patches/005-conf-reorganize-split-code-to-utils.c.patch [new file with mode: 0644]
utils/lxc/patches/006-confile-unhide-lxc_config_parse_arch-helper.patch [new file with mode: 0644]
utils/lxc/patches/007-storage_utils-unhide-and-rename-is_valid_storage_typ.patch [new file with mode: 0644]
utils/lxc/patches/008-storage_utils-move-get_fssize-to-utils.patch [new file with mode: 0644]
utils/lxc/patches/009-network-use-IN_LIBLXC.patch [new file with mode: 0644]
utils/lxc/patches/010-meson-link-with-liblxc-dynamically-everywhere-if-pos.patch [new file with mode: 0644]