mingw: Stop using .weak symbols aliases #1250
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Weak symbols on mingw-w64 target with GCC and the GNU linker is a bit broken for the intended use. When using the .weak + .set combo and the referenced symbol is undefined, LD does not produce an error but instead treat the referenced symbol like a weak symbol. This can happen if some of the link library flags is missing. The output executables will crash on run time, which can be very confusing.
This change makes the WINRT_IMPL_... Windows API declarations on GNUC use asm labels instead. This means we lose the ability to "hook" these functions when compiling for mingw-w64 target. But as mentioned in #475, developers should not be doing this anyway.