-
-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt connect not work with mold #352
Comments
Can you copy-paste the failure log? |
It looks like your program crashed. Doesn't it crash if you link with others linker? |
With other linker, normal linker, gold linker, lld linker: work |
Does it fail reliably? How can I build this program on my machine to reproduce the issue? |
Hi, always occur. |
It looks like I can't build it due to missing dependencies:
Can you debug your program a little bit? It looks like it calls |
NB: Note that the |
apt-get install libqt5websockets5-dev qtdeclarative5-dev QObject::connect is not unix fonction, I try but errno is not set (remain to 0, unchanged). |
I'm experiencing the same issue within a larger codebase. Unfortunately I have not been able to create a minimal example that triggers the issue. Anyway, the issue occurs only with the The signal functions that trigger the behaviour are those from the Qt Base Classes within the QWidgets shared library. I have not experienced it with functions defined within our own classes. |
I have attached the following minimal test case: testmold_qt.zip The issue occurs once the main executable links the same symbol from Qt that is also used within a shared library that uses the symbols address within Hope this helps you tracking down this issue. |
I also have problems when linking with mold in a larger project. I'm using
Note that these warnings will not appear in release builds even if the connect fails. This project almost only uses the newer function pointer connect style not the old one with string names. The closest other issue I could find is this one. Could it be that mold turns on LTO (or symbolic-functions?) by default?
This does not work for me. Even without using mold, I get Unfortunately, I'm also having trouble creating a minimal non-working example from scratch. I tried some examples from the Qt examples folder shipping with the installation but all of them worked without problems. I tried reducing the main function of that big project to a minimal widget and could still reproduce the warnings albeit of course only the few in the minimal widget. However, as soon as I try to remove the as of the above change unused CMake targets by the smallest possible step (which is still quite large because of mismanaged cross-dependencies), the warnings disappear. Note that the resulting binary shrinks from 268 MiB to 101 MiB. Maybe it is a bug only happening with large executables? Or maybe some of the CMake targets behave weirdly. All kinds of CMake target types like interface targets, static targes, shared libraries are used in this project. However, it really is only the final linking step that is the problem. I used
I don't see any LTO or symbolic functions being explicitly turned on. Adding |
I've modified the example such that it does not crash when not linked with mold. |
Thank you guys for reporting the details of the issue. In particular, thank you @mheimlich for sharing the archive to reproduce the issue. With that, I could reproduce the issue on my machine, and I believe the above commit fixed it. Can you test again to see if it works for you guys? Thanks! |
Awesome, I can confirm that this now also works in my original project! Thanks for looking into this! |
Work here too! Thanks |
Nice. Feel free to file a new bug if you find any. Thanks! |
Awesome! I had mold 1.1.1 installed. After updating to 1.4.2, linking my Qt project works (i.e. no runtime warnings anymore). Thanks! |
Hi,
If I try compile my Qt software (here catchchallenger https://github.com/alphaonex86/CatchChallenger/ ) with mold (work with all other linker), QObject::connect don't found the method.
Cheers,
The text was updated successfully, but these errors were encountered: