How to ensure re-implemented mutex functions are called
If your re-implemented
_mutex_*() functions are within an object that is contained within a library file, the linker does not automatically include the object.
This can result
excluded from the image you have built.
To ensure that your
_mutex_ functions are called, you can either:
Place your mutex functions in a non-library object file. This helps to ensure that they are resolved at link time.
Place your mutex functions in a library object file, and arrange a non-weak reference to something in the object.
Place your mutex functions in a library object file, and have the linker explicitly extract the specific object from the library on the command line by writing
when you invoke the linker.