Closed
Bug 1063359
Opened 10 years ago
Closed 9 years ago
Firefox fails to run with GTK3, in the presence of --as-needed, with "libxul.so: undefined symbol: gtk_main_do_event"
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: heftig, Assigned: glandium)
References
Details
Attachments
(1 file)
(deleted),
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
If LDFLAGS contains -Wl,--as-needed and Firefox 34.0a2 is configured with GTK3 widgets, xpcshell fails during the build, complaining about a symbol lookup error in libxul.so:
/tmp/mozilla-central/obj-x86_64-unknown-linux-gnu/dist/bin/xpcshell: symbol lookup error: /tmp/mozilla-central/obj-x86_64-unknown-linux-gnu/dist/bin/libxul.so: undefined symbol: gtk_main_do_event
Without --as-needed, libxul.so directly depends on libgtk-3.so.0, breaking the plugin-container (bug 1051209).
Reporter | ||
Comment 1•10 years ago
|
||
A common cause for this problem is misordering the libs on the ld command line. If lib A depends on lib B, lib A must be first on the command line, otherwise ld with --as-needed skips lib B as nothing depends on it.
Reporter | ||
Comment 2•10 years ago
|
||
Ah, my builds might trigger this bug because my LDFLAGS don't contain a literal "-Wl,--as-needed" (the build system checks for that), but the --as-needed is part of a longer -Wl, specifically "-Wl,-O1,--sort-common,--as-needed,-z,relro"
Comment 3•10 years ago
|
||
Just got a report on IRC of a gtk3-enabled build *building* successfully, but failing to *run*, with the same issue from comment 0 ("libxul.so: undefined symbol: gtk_main_do_event"). Marking as "confirmed" based on that report.
(I think comment 0 is really a failure to *run*, not a failure to *build*. Even though it's part of the build process, if we're starting xpcshell & libxul, then we've already built gecko. Hence, generalizing summary to be about running instead of building.)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: GTK3 fails to build in the presence of --as-needed → Firefox fails to run with GTK3, in the presence of --as-needed
Version: 34 Branch → Trunk
Updated•10 years ago
|
Summary: Firefox fails to run with GTK3, in the presence of --as-needed → Firefox fails to run with GTK3, in the presence of --as-needed, with "libxul.so: undefined symbol: gtk_main_do_event"
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Jan Steffens from comment #2)
> Ah, my builds might trigger this bug because my LDFLAGS don't contain a
> literal "-Wl,--as-needed" (the build system checks for that), but the
> --as-needed is part of a longer -Wl, specifically
> "-Wl,-O1,--sort-common,--as-needed,-z,relro"
Yes, the build system looks for an independent -Wl,--as-needed in LDFLAGS to trigger using -Wl,--no-as-needed "appropriately".
Comment 5•9 years ago
|
||
I'm running into this in Ubuntu 15.04 and it looks like gcc is adding -Wl,--as-needed by default. Can we just unconditionally add -Wl,--no-as-needed?
Assignee | ||
Comment 6•9 years ago
|
||
We'd need to detect what the linker uses by default. Because -Wl,--no-as-needed affects all the following linked libraries, including those the compiler adds on its own. So the -Wl,--no-as-needed -llib -Wl,--as-needed pattern is needed, but then that would make all following libraries linked "as-needed" on no-as-needed builds.
Or, we could just force -Wl,--as-needed on all our builds.
Assignee | ||
Comment 7•9 years ago
|
||
Assignee: nobody → mh+mozilla
Attachment #8637859 -
Flags: review?(nfroyd)
Updated•9 years ago
|
Attachment #8637859 -
Flags: review?(nfroyd) → review+
Comment 11•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•