On Friday 23 December 2022 22:25:57 LIU Hao wrote:
> 在 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`...

What is the reason? Maybe it was gcc/ld bug which this patch workarounds?

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

Yes, it should not affect non-LTO builds. Thanks!


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

Reply via email to