IIRC declaring the variable extern was suggested somewhere online to
prevent the linker from removing it, especially when LTO gets
involved. If you're feeling brave, you could test winpthreads + MSVC
and its /GL [0] or /LTGC [1] flags.

[0]: 
https://learn.microsoft.com/en-us/cpp/build/reference/gl-whole-program-optimization?view=msvc-170
[1]: 
https://learn.microsoft.com/en-us/cpp/build/reference/ltcg-link-time-code-generation?view=msvc-170

-- Antonin


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to