I'm building statically linked binary using stack and I try to add debug symbols to it (following: https://downloads.haskell.org/~ghc/master/users-guide/debug-info.html). However GDB reports: no debugging symbols found
.
What am I missing?
I've added to the ghc-options
in the .cabal
file: -g -rtsopts
and to the ld-options
: -static
. I am building using stack with the following command:
stack install \
--install-ghc \
--split-objs \
--ghc-options="-fPIC -fllvm -pgmlo opt -pgmlc llc"
GDB is invoked as follows: gdb --args nodebug-exe +RTS -V0
GHC 8.2.1
Whole source code is here: https://github.com/carbolymer/haskell-missing-debug-symbols