On Thu, Dec 8, 2022 at 8:14 AM Andreas Jaeger
On 08/12/2022 08.23, Dr. Werner Fink wrote:
[...] AFAICR the ffmpeg/kodi people are able to build and load on demand optimized code for e.g. sse4 support. Also glibc/gcc has the opportunity to load/map optimized code at runtime for different CPUs all x86_64, at least I can remember on debugging a strange crash on an older AMD CPU within string operations which was not reproducable on Intel.
glibc uses hand-optimized assembler files for certain string routines and has a handler that checks for cpu capabilities and then calls these routines as needed. I expect ffmpeg to do something similar.
So, there's extra logic needed to do this in a single binary. Just compiling a library with certain flags and moving it into the proper subdirectory is a far easier approach.
Or FatELF: https://icculus.org/fatelf/ (We could only hope...) -- 真実はいつも一つ!/ Always, there's only one truth!