Closed Bug 1474024 Opened 6 years ago Closed 6 years ago

Enabling LTO on macOS builds breaks breakpad symbols

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

(Keywords: in-triage)

Attachments

(1 file)

$ unzip -l target.crashreporter-symbols.zip 
Archive:  target.crashreporter-symbols.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 35768326  2010-01-01 00:00   XUL/02090A86BD603B49865D8E78782645420/XUL.sym
 40509807  2010-01-01 00:00   XUL/884D9FB3B9A1377C9F3841F7CFA223450/XUL.sym
   185798  2010-01-01 00:00   libnss3.dylib/F686E908492C3FB9B719F485D0B9F2800/libnss3.dylib.sym
---------                     -------

A lot of files don't even have symbols anymore, and the XUL symbols are way too small. The current size of a non-LTOed build:

238680820  2010-01-01 00:00   XUL/2A0886A0EA763D6983D08153CD10D0030/XUL.sym
209391087  2010-01-01 00:00   XUL/90E414C5EB293A51BBE055BA08F1670F0/XUL.sym
Keywords: in-triage
glandium: do you have samples I can look at?
Flags: needinfo?(mh+mozilla)
Found a fix.
Assignee: nobody → mh+mozilla
Flags: needinfo?(mh+mozilla)
For the record, I originally was setting this in toolchain.configure, but then I found out the race condition mentioned in the comment, which requires using a make variable in the linker flags, and we don't have a way to handle those things outside a Makefile currently.
It looks like clang has code to do this automatically, does it not get used in our build configuration?
https://github.com/llvm-mirror/clang/blob/1d90e7314049f86752943b0568a805a7f11b7b89/lib/Driver/ToolChains/Darwin.cpp#L227
Apparently not.
Attachment #8991220 - Flags: review?(core-build-config-reviews) → review?(nfroyd)
Comment on attachment 8991220 [details]
Bug 1474024 - Avoid LTO breaking debug info on macOS builds.

https://reviewboard.mozilla.org/r/256176/#review264062

Thanks for the great explanatory comment.

::: config/config.mk:218
(Diff revision 1)
>  HOST_C_LDFLAGS = $(COMPUTED_HOST_C_LDFLAGS)
>  HOST_CXX_LDFLAGS = $(COMPUTED_HOST_CXX_LDFLAGS)
>  
> +ifdef MOZ_LTO
> +ifeq (Darwin,$(OS_TARGET))
> +# When linking on macOS, debug info is not linked along, and the dwarf

Nit: "not linked along with the final binary"?
Attachment #8991220 - Flags: review?(nfroyd) → review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/a0733849c96b
Avoid LTO breaking debug info on macOS builds. r=froydnj
Depends on: 1476174
https://hg.mozilla.org/mozilla-central/rev/a0733849c96b
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.