shaka-packager/packager
Joey Parrish 9be7c2b1ac
feat: Portable, fully-static release executables on Linux (#1351)
This adds the option FULLY_STATIC to create fully-static executables.

To create portable, fully-static release executables on Linux, we need
to use musl instead of glibc. Static executables from glibc are not
portable.

The popular musl-gcc wrapper does not support C++, so instead we use a
full musl cross-compiler toolchain in the build workflow.

To build FULLY_STATIC, the user must point to the appropriate
cross-compiler, as we do in the workflow. On systems where musl is the
native libc (such as Alpine Linux), this is not necessary.

I have also read that musl's allocator is not very fast in
multi-threaded applications. So when FULLY_STATIC is enabled, we will
also enable mimalloc, a replacement allocator that is very fast.

I tested a very basic packaging command to compare speeds of dynamic
glibc, static musl, and static musl+mimalloc:

dynamic glibc:
runs: 2.527, 2.798, 2.703, 2.756, 2.959
avg = 2.749, std dev = 0.156s

static musl:
runs: 2.813, 2.920, 3.129, 3.003, 2.738
avg = 2.921s, std dev = 0.154s

static musl+mimalloc:
runs: 2.291, 2.034, 2.415, 2.303, 2.265
avg = 2.262s, std dev = 0.140s

The mimalloc build is 82% faster than musl default allocator, 77% faster
than glibc, and has more consistent runtime characteristics (lower
standard deviation).
2024-02-27 10:47:04 -08:00
..
app fix: Fix missing newline at the end of usage (#1352) 2024-02-26 19:56:16 -08:00
file fix: http_file: Close upload cache on task exit (#1348) 2024-02-23 09:30:21 -08:00
hls feat: Add PlayReady support in HLS. (#1011) 2024-02-23 15:29:13 -08:00
kv_pairs feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
macros chore: Upgrade absl and protobuf (#1337) 2024-02-09 20:57:12 -08:00
media fix: AudioSampleEntry size caluations due to bad merge (#1354) 2024-02-27 08:57:48 -08:00
mpd feat: add startwithSAP/subsegmentstartswithSAP for audio tracks (#1346) 2024-02-23 15:45:46 -08:00
status feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
testing build: Fix absl log flags being stripped (#1340) 2024-02-14 13:59:18 -08:00
third_party feat: Portable, fully-static release executables on Linux (#1351) 2024-02-27 10:47:04 -08:00
tools feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
utils fix: preserve case for stream descriptors (#1321) 2024-02-08 09:48:46 -08:00
version feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
CMakeLists.txt feat: Portable, fully-static release executables on Linux (#1351) 2024-02-27 10:47:04 -08:00
flag_saver.h feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
fully-static.cmake feat: Portable, fully-static release executables on Linux (#1351) 2024-02-27 10:47:04 -08:00
gtest.cmake feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
packager.cc feat: Allow LIVE UDP WebVTT input (#1349) 2024-02-23 16:02:19 -08:00
packager.pc.in feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
packager_test.cc feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
policies.cmake feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00
protobuf.cmake feat!: Rewrite build system and third-party dependencies (#1310) 2023-12-01 09:32:19 -08:00