I replace the weak aliases with dynamic loading. Weak aliases were generating some problems when linking for MT on Windows. For MT, compiler-rt's libraries are statically linked to the main executable the same than libFuzzer, so if we use weak aliases, we are providing two different default functions for the same weak functions and the linker fails.
So, I decided to re implement ExternalFunctions() using dynamic loading, so it works in both cases (MD and MT).
Also, I think dynamic loading is clearer, since we are not defining any auxiliary external function, and we don't need to deal with weak aliases.
It is equivalent to the implementation using dlsym(RTLD_DEFAULT, FnName) for Posix.
Should this be:
? It looks like you're casting to a function instead of a function pointer. (Not sure if there's a difference)