Yes, there is. There's -Wl,--whole-archive for the Unix linkers. This should
solve the problem for everyone except MSVC users.

That option is not very attractive because:

a, as you state yourself, it doesn't work on MSVC.

b, it only works at the last link step, when the library is linked into some application or dynamically linked binary. That step might not be under our control and it might involve a lot of other objects that we actually want the linker to remove. I know, you can selectively apply --whole-archive to only part of the linker line, but by that time, the plugin we're looking for might be linked into some other .a file together with more stuff.

I haven't actually invented the plugin import mechanism, but AFAIU, it allows us to specify plugins, and nothing else, as the stuff to be kept around even if it's not referenced. QML modules piggy-back on that by creating small plugins that do nothing but hold a reference to the type registration function.

Ulf
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to