Opened 2 years ago

Closed 2 months ago

#10601 closed task (fixed)

GHC should be distributed with debug symbols

Reported by: bitonic Owned by:
Priority: normal Milestone: 8.2.1
Component: Build System Version:
Keywords: Cc: johan.tibell@…, duncan@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #9894 Differential Rev(s):
Wiki Page:


Now that we have the capability of producing code with DWARF symbols, we should distribute GHC with them, or at least give the option.

The DWARF symbols in these case would be both for the C RTS and for the base Haskell libraries shipped with GHC. Building GHC with said symbols amounts to adding

GhcRtsHcOpts += -g
GhcLibHcOpts += -g

to mk/

Change History (7)

comment:1 Changed 2 years ago by thomie

Component: CompilerBuild System

comment:2 Changed 2 years ago by Tarrasch

This will incerease the binary size by about 50% I think. Here's an old comparison [1]. Just note that "debug_ghc" in that diagram doesn't exist in GHC HEAD, so just ignore that one.


comment:3 Changed 2 years ago by scpmw

Also note that .debug_info got significantly smaller, because it doesn't contain block information like before. This reduces the amount of overhead to about 18% total, according to my experiments back then:

comment:4 Changed 2 years ago by thomie

This requires a little more work than just adding GhcRtsHcOpts += -g and GhcLibHcOpts += -g to mk/

What is also needed is to not strip debug symbols from the libraries when running 'make install', but to only do that when running 'make install-strip'.

Currently, ghc-cabal tells Cabal to strip the libraries on installation (with --strip-unneeded), unless STRIP_CMD = :.

Last edited 2 years ago by thomie (previous) (diff)

comment:5 Changed 2 years ago by thomie

comment:6 Changed 21 months ago by thomie

Adding -g to GhcRtsHcOpts shouldn't be necessary, as the debug version of the RTS is already compiled with -g.

comment:7 Changed 2 months ago by bgamari

Milestone: 8.2.1
Resolution: fixed
Status: newclosed

The GHC 8.2.1 includes a binary distribution which enables DWARF debugging support and includes the necessary debug information.

Note: See TracTickets for help on using tickets.