<table><tr><td style="">vkrause added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D13816">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D13816#287459" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D13816#287459</a>, <a href="https://phabricator.kde.org/p/lepagevalleeemmanuel/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@lepagevalleeemmanuel</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Or does anyone have an idea how to solve this more elegantly? :)</p></blockquote>

<p>Hi, we talked about this at Randa and QtWorldSummit last year. Sorry for stopping working on this after I made enough progress to make it work for me. I was assigned to work on other things. The clean way is using:</p>

<p>Q_IMPORT_PLUGIN(KirigamiPlugin)</p></div>
</blockquote>

<p>Right, that works for plugins. There is even <a href="https://codereview.qt-project.org/#/c/195680/" class="remarkup-link" target="_blank" rel="noreferrer">https://codereview.qt-project.org/#/c/195680/</a> since 5.11 allowing us to hook "plugin loading", for things covered by static construction in the dynamic case. The patch here is looking more at something like the bug report you mentioned below, ie. use of static construction in libraries rather than plugins.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Like other Qt static modules, This can be semi-automated using MOC magic and CMake-foo. All the magic is there <a href="https://github.com/ring-project/ring-kde-appimage-builder/tree/gentoo_base" class="remarkup-link" target="_blank" rel="noreferrer">https://github.com/ring-project/ring-kde-appimage-builder/tree/gentoo_base</a> . It's not very clean, but it works. I have to catch a plane later today, so I can't write a lengthy comment right now.</p></blockquote>

<p>Most of those patches seem to be dealing with the Qt5::Test dependency or other dependency-related changes, ie. this should be pretty harmless to integrate?</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Just to say, fixing static frameworks and LTO bugs reduce the size of the KF5 based APK/AppImage by 86% and they load 6-8 time faster when PGO/FDO is enabled. Of course all of this is not "free". There is a non-trivial amount of work before <a href="https://phabricator.kde.org/p/apol/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@apol</a> SDK or mine can work with random KF5 apps. Things like <a href="https://bugs.kde.org/show_bug.cgi?id=387820" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=387820</a> become real crashers instead of unrefined behaviors. I brute force fixed all of them using horrible hacks to Ring-KDE could ship on Android/Plasma_Mobile/Appimage/macOS with a 13-18mb (with or without breeze icons) size instead of ~185-200mb (with or without breeze icons).</p></blockquote>

<p>That bug report is more what I'm looking at here. I disagree with your assessment though that this is undefined behavior or broken in the current dynamic code. Static construction is actually a pattern used all over the place, among them are qrc, the qml compiler and the ECM qm catalog loader, as well as custom code as you found in KConfig, or as this patch tries to  support in KItinerary. So I think we need a proper solution for this.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R1003 KItinerary: Travel Reservation handling library</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D13816">https://phabricator.kde.org/D13816</a></div></div><br /><div><strong>To: </strong>vkrause, Frameworks<br /><strong>Cc: </strong>mart, lepagevalleeemmanuel, apol, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>