[Development] QT_FEATURE_reduce_relocations breaking executables that mention qApp?
Thiago Macieira
thiago.macieira at intel.com
Thu Dec 4 17:19:02 CET 2025
On Wednesday, 3 December 2025 23:59:37 Pacific Standard Time Stephan Bergmann
wrote:
> So, if I get you right, you claim that my executable should be built in
> a way that it does not export _ZN16QCoreApplication4selfE and rather
> have that as undefined (so that the executable and all the other Qt
> shared libraries bind to the copy exported by QtCore)? But I fail to
> find a way how to build the executable that way.
Correct. The executable having a copy of the variable and enforcing the PLT
for functions it doesn't have is a wart that needs to be burned out of the ELF
ecosystem.
The solution is -mno-direct-extern-access.
https://gcc.godbolt.org/z/xxczffPrx
I will start enforcing this for Qt come 7.0 at least for Linux. I think
FreeBSD was broken for some reason, so I'll probably just enforce there too
and let FreeBSD developers fix their toolchain, instead of gracefully
degrading.
GCC diff: https://diff.godbolt.org/z/e4e7Tcnaj
Clang diff: https://diff.godbolt.org/z/q9chhdPnE or lack thereof
(Clang appears to emit the correct way either way)
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCG - Platform & Sys. Eng.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5150 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20251204/b292a3e2/attachment-0001.bin>
More information about the Development
mailing list