Yes, the statically-linked program is calling dlopen() to dynamically-link in a library. This works fine with glibc. The library in question is libaio, which I've also built with musl.
And, oddly, I am not rebuilding between runs - I'm executing the same binary over and over again. The program is a disk benchmark (fio). The errors are very random, so it's not dependent on the input to fio, which is nearly identical anyway (reads vs writes with all other parameters the same, for example). I have a wrapper that executes fio 6 times. Repeating the wrapper run produces errors from dlopen() randomly - sometimes the first fio fails, other times it works. Same for 2nd through 6th runs. It randomly produces a "no such file", other times the "dynamic loading not supported".
I'm puzzled by the randomness of it, and suspect that the cause is outside of dlopen() but don't know where to start looking... any ideas?