GCC 9 doesn't define a SHA256_Transform symbol when the stub just wraps
SHA256_Transform_c resulting in an undefined symbol for
_libmd_SHA256_Transform in libmd.so.
Oh I see. That's still a bit fragile, even if it happens to work. The correct way to fix that is to mark any static symbols referenced by inline assembly via strings as __used, which will ensure it gets emitted.
(Though this refactoring is perhaps *also* a better way to write the original code, not sure, it's shorter, though requires two places to know about the ifdef).
So is __used the better long term fix? I could maybe have a wrapper macro that only maps to __used when WEAK_REFS is defined (WEAK_REFS_USED or some such) and then tag all the static functions with weak references with that?