Priority: P1: Critical
Affects Version/s: 6.0.0 Beta2
Fix Version/s: 6.0.0 RC
Environment:found on macOS, but probably affecting all platforms
The current method to ensure the initialisation of qml plugins with static builds is insufficient, and might skip the initialisation of them.
The main issue is that currently the registration code is just a registration function and a static const variable that initialises a QQmlModuleRegistration that does the registration.
The issue is that if no symbols from a compilation unit from a .a library are used, then the linker is free not to include it (this is not the case for an explicitly linked .o file).
This is for example the case for example for
0000000000000050 s _GLOBAL_sub_I_qtquickcontrols2macosstyleplugin_qmltyperegistrations.cpp
0000000000000000 T __Z41qml_register_types_QtQuick_Controls_macOSv
0000000000005898 b __ZL12registration
Indeed it might be surprising that this was not seen before, but there is another things that hides it and makes it work in many occasions: the registration of QMetaTypes, templates or other stuff fro .h files that then make the module "used" and thus trigger its inclusion in the final binary.
To fix this one we need to either include an explicit external symbol from there, explicitly call the initialisation function or similar approaches.