Closed Bug 1669442 Opened 4 years ago Closed 4 years ago

[Linux] Fails to build with gcc and --enable-lto

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: stransky, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

When gcc, PGO and --enable-lto is used, Firefox fails to build. plugin-container fails to link with:

/usr/bin/g++ -std=gnu++17 -o ../../dist/bin/plugin-container [...]
/usr/bin/ld: warning: libmozgtk.so, needed by ../../toolkit/library/build/libxul.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: ../../toolkit/library/build/libxul.so: undefined reference to gtk_file_chooser_set_do_overwrite_confirmation' /usr/bin/ld: ../../toolkit/library/build/libxul.so: undefined reference togtk_main_iteration'
[...]

The link chain is libxul.so -> libmozgtk_stub.so -> libmozgtk.so, but there isn't a build dependency between libmozgtk_stub.so and libmozgtk.so.

As there's no dependency between libxul.so/libmozgtk.so in the build system on the second phase of PGO build only libmozgtk_stub.so so at widget/gtk/mozgtk/stub directory is built and widget/gtk/mozgtk/gtk3 and widget/gtk/mozgtk/gtk2 are missing.

when I manually trigger linking of widget/gtk/mozgtk/gtk3, libmozgtk.so is created and plugin-container is linked correctly.

Mike, how is this handled with clang? Do you allow undefined dependencies for libxul.so or so?

Thanks.

Flags: needinfo?(mh+mozilla)
Summary: [Linux] Fails to build gcc and --enable-lto → [Linux] Fails to build with gcc and --enable-lto

Wow, this is race condition that has been possible since bug 1573566 but apparently never happened until now, I'm baffled.

Assignee: nobody → mh+mozilla
Flags: needinfo?(mh+mozilla)
Regressed by: 1573566
Has Regression Range: --- → yes

Bug 1573566 moved libxul from toolkit/library to toolkit/library/build,
and that should be reflected in config/recurse.mk.

It's amazing the race condition hasn't caused problems earlier than now.

Martin, can you confirm it works for you?

Flags: needinfo?(stransky)

Yes, that works.
Thanks.

Flags: needinfo?(stransky)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/4489f33bf652 Fix dependency between libxul and mozgtk after bug 1573566. r=andi,dmajor
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: