Closed Bug 1707834 Opened 3 years ago Closed 3 years ago

libmozgtk not linked in with --as-needed

Categories

(Firefox Build System :: General, defect)

Firefox 90
defect

Tracking

(firefox-esr78 unaffected, firefox88 unaffected, firefox89 unaffected, firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- unaffected
firefox89 --- unaffected
firefox90 --- fixed

People

(Reporter: streetwalkermc, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Bug 1706452 reintroduced an empty libmozgtk to load GTK before libmozwayland, but building with --as-needed results in libmozgtk being dropped by the linker, and not appearing in dependentlibs.list.
The fix attempts to handle this situation, but in practice it doesn't look like this is working right. This was observed in the nightly builds provided by Arch Linux's Firefox package maintainer (https://pkgbuild.com/~heftig/packages/firefox-nightly/PKGBUILD). This package uses lld and Arch sets --as-needed distribution-wide. Jan has confirmed that dropping this linker flag does indeed result in libxul linking against libmozgtk, but pulls in a lot of otherwise unnecessary dependencies (https://bugzilla.mozilla.org/show_bug.cgi?id=1706452#c28)

Regressed by: 1377445
Has Regression Range: --- → yes

When the linker defaults to --as-needed, libmozgtk ends up not linked
to libxul because libxul doesn't use anything from it.
We solve the problem by adding a symbol to mozgtk and have libxul use
it.

In bug 1377445, we moved XShmQueryExtension to mozglue. While libxul
currently doesn't use the symbol (it's a workaround for system
libraries), we can move the function back to mozgtk and add a dummy
call.

Assignee: nobody → mh+mozilla

(In reply to novenary from comment #0)

but pulls in a lot of otherwise unnecessary dependencies (https://bugzilla.mozilla.org/show_bug.cgi?id=1706452#c28)

The lists are identical, except for the order and libmozgtk.so.

dependentlibs.list only lists the libraries that are bundled together with Firefox, I think Jan means those libraries end up linking against system libraries they don't need.

Set release status flags based on info from the regressing bug 1377445

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/39213a71d10f
Avoid libmozgtk not being linked to libxul. r=firefox-build-system-reviewers,mhentges
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: