在 2022-12-21 21:00, Martin Storsjö 写道:

I believe this patch should be harmless; for regular object file based linking, __attribute__((used)) shouldn't have any effect across object file boundaries (it only affects what's emitted and what's optimized out from within each object file). And for LTO linking, the linking stage would still pull in the same set of LTO object files from the static libraries, and this only affects what symbols get emitted from the LTO code generation step.

So I would be fine with this patch - although I guess I could include it in a test build run with Clang/LLD.

I guess I'd need to build mingw-w64-crt with -flto in order to reproduce the situation at hand though. I don't currently have a test setup where I do that (but iirc Zig builds mingw-w64-crt that way, with optional LTO).


I thought I was told that the CRT shouldn't be built with `-flto`...

This patch shouldn't affect non-LTO builds, so pushed for now. If there are any issues, please let me know.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to