Skip to content
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 6 symbol mismatch #1158

Closed
HanabishiRecca opened this issue Nov 27, 2023 · 13 comments
Closed

Qt 6 symbol mismatch #1158

HanabishiRecca opened this issue Nov 27, 2023 · 13 comments

Comments

@HanabishiRecca
Copy link

HanabishiRecca commented Nov 27, 2023

Qt 6.6.1 linked with mold make apps crash. Earlier versions were fine.

A particular error may vary, but it is about symbols not found, like

qbittorrent-nox: symbol lookup error: qbittorrent-nox: undefined symbol: _ZN14QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate, version Qt_6

It is a bit tricky to reproduce though.
Basically an app crashes if it is built against Qt linked with ld, but you trying to run it with Qt linked by mold.

I.e. I assume Qt 6.6.1 has symbols mismatch between ld and mold.


Arch Linux / mold 2.3.3

@rui314
Copy link
Owner

rui314 commented Nov 28, 2023

Thank you for reporting. I succeeded to reproduce the issue. Let me take a look.

@rui314 rui314 closed this as completed in 0fdbace Nov 28, 2023
@rui314
Copy link
Owner

rui314 commented Nov 28, 2023

The above commit should fix the issue. Can you try again with the above change?

@HanabishiRecca
Copy link
Author

Yes, seems to be fixed. 👍
I'll report back in case of anomalies.

@ishitatsuyuki
Copy link
Contributor

ishitatsuyuki commented Dec 22, 2023

Looks like they turned that thing into a wildcard in 6.7.0-beta1 and this no longer works again.

qt/qtbase@9323351

You can build 6.7.0-beta1 of https://github.com/qt/qtbase and inspect the symbol list of build/lib/libQt6Core.so.6.7.0.

BFD gives: _ZN14QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate@@Qt_6
mold gives: _ZN14QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate@@Qt_6_PRIVATE_API

@rui314 rui314 reopened this Dec 22, 2023
@HanabishiRecca HanabishiRecca changed the title Qt 6.6.1 linked with mold make apps crash Qt 6.6.1/6.7.0 linked with mold make apps crash Dec 22, 2023
@HanabishiRecca HanabishiRecca changed the title Qt 6.6.1/6.7.0 linked with mold make apps crash Qt 6.6.1/6.7.0 linked with mold symbol mismatch Dec 22, 2023
VitalyAnkh pushed a commit to VitalyAnkh/mold that referenced this issue Dec 23, 2023
Previously, symbol names or wildcard patterns in version script files
were processed strictly from top to bottom. When a single symbol
matches two or more patterns, the first one was given precedence.

However, GNU ld appears to treat exact matches differently, assigning
them higher precedence over wildcard patterns. This discrepancy led to
programs linked with Qt 6.6.1 using mold failing to launch.

Fixes rui314#1158
@rui314 rui314 closed this as completed in e1e16bf Dec 23, 2023
@HanabishiRecca
Copy link
Author

And this happens again in 6.6.2 🙃

@rui314 rui314 reopened this Feb 15, 2024
@HanabishiRecca HanabishiRecca changed the title Qt 6.6.1/6.7.0 linked with mold symbol mismatch Qt 6 symbol mismatch Feb 15, 2024
@rui314
Copy link
Owner

rui314 commented Feb 17, 2024

Are you still using qbittorrent-nox as a test program? Did it work with Qt 6.6.1 but broke with 6.6.2?

@ishitatsuyuki
Copy link
Contributor

I believe it's the same commit above cherry-picked into the 6.6 branch. @HanabishiRecca, are you using mold main?

@HanabishiRecca
Copy link
Author

Are you still using qbittorrent-nox as a test program? Did it work with Qt 6.6.1 but broke with 6.6.2?

Yes.

I believe it's the same commit above cherry-picked into the 6.6 branch. @HanabishiRecca, are you using mold main?

No, I tested on the release. If that's the same already fixed thing, very well then.

At least now you are aware that it also affects stable 6.6 and we need fixes to be released soon.

@thesamesam
Copy link
Contributor

Could you make a new release please, or should I cherry-pick this fix on top of 2.4.0 for Gentoo?

@rui314
Copy link
Owner

rui314 commented Feb 18, 2024

I'll make another release, but please wait for a few weeks. I'm fixing other issues now. If you are in hurry, you may want to build mold yourself or download the most recent binary from GitHub Actions (https://github.com/rui314/mold/actions/runs/7856596446).

@rui314 rui314 closed this as completed Feb 18, 2024
@thesamesam
Copy link
Contributor

thesamesam commented Feb 18, 2024

I was just looking for consent to backport it, in case you thought it was unsafe to do so. Is it fine if I do that?

@rui314
Copy link
Owner

rui314 commented Feb 18, 2024

It's probably a bit too risky to just cherry pick. Version script has caused very subtle issues before (this is one of them), so it needs rigorous testing. I usually build all Gentoo packages with mold before making a release. Until doing it, I'm not 100% sure if this would be fine at the moment.

@thesamesam
Copy link
Contributor

OK, thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants