
#15955: Cannot get debugging symbols for compiled c-sources -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I cannot for my life figure out how to pass `-g` to some cabal-file `c-sources`'s compilation. I've tried putting various combinations into `ghc-options`, but for the cases where compilation runs through, debugging symbols are not present, and for all other cases the assembler crashes, with the message as shown in my little survey of flags and whether they end up at `as` (as determined via `strace`): {{{ Using ghc-8.2.2 -g -optc-g -opta-g -optc-Wa,-g -opta-Wa,-g passes -g to as -g -optc-g -opta-g -optc-Wa,-g does not pass -g to as -g -optc-g -opta-g -opta-Wa,-g passes -g to as -optc-g -opta-g -opta-Wa,-g does not pass -g to as -g -opta-g -opta-Wa,-g passes --gdwarf2 and -g to as -g -opta-Wa,-g passes -g to as (and no --gdwarf2) -g -opta-g passes --gdwarf2 to as, but no -g However, in all 3 cases above the build fails with /tmp/ghc6595_0/ghc_4.s:444:0: error: Error: file number 1 already allocated | 444 | .file 1 "src/Codec/Compression/LZ4/Conduit.hsc" | ^ `gcc' failed in phase `Assembler'. (Exit code: 1) }}} (copied from https://gist.github.com/nh2/b57ed4c419f7b13d7cc299caa335f3ab) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15955 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler