Opened 4 years ago

Closed 2 years ago

Last modified 14 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 (make) 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 (8)

comment:1 Changed 4 years ago by thomie

Component: CompilerBuild System

comment:2 Changed 4 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 4 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 4 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 4 years ago by thomie (previous) (diff)

comment:5 Changed 4 years ago by thomie

comment:6 Changed 4 years 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 years 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.

comment:8 Changed 14 months ago by bgamari

Component: Build SystemBuild System (make)

The new Hadrian build system has been merged. Relabeling the tickets concerning the legacy make build system to prevent confusion.

Note: See TracTickets for help on using tickets.