path: root/src/plugins/platforms/ios/
diff options
authorTor Arne Vestbø <>2013-06-06 13:26:42 +0200
committerThe Qt Project <>2013-06-12 12:34:44 +0200
commite99fc91c585d5a5a6ec9e9196874f18b69254a5a (patch)
tree27c7a267e589331642dea2632f996e8a0131f45b /src/plugins/platforms/ios/
parentba1aefa85da937b20b47e21e31feb2d330d005e3 (diff)
iOS: Remove need for -force_load of platform plugin
Instead of force-loading the whole static library of the platform plugin we tell the linker to look for the missing symbol qt_registerPlatformPlugin. This symbol is provided by the same object file as the plugin's static initializer, so the object file is included in the final binary and the static initializer is run, resulting in the plugin registering with Qt. We could have marked the actual static initializer wrapper provided by Q_IMPORT_PLUGIN(QIOSIntegrationPlugin) as undefined, but due to the C++ mangling this would look less intuitive on the linker command line than the custom dummy function that we provide, which has C linkage. Change-Id: I6805537e1f49260a41d48c555376964cb1fe75d8 Reviewed-by: Oswald Buddenhagen <> Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios/')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index a93b6037ad..ca8ec936ae 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -66,4 +66,8 @@ QT_END_NAMESPACE
#include "plugin.moc"
+// Dummy function that we explicitly tell the linker to look for,
+// so that the plugin's static initializer is included and run.
+extern "C" void qt_registerPlatformPlugin() {}