Spack changes the configuration if debug variant is enabled as per this line :
'--with-debugging=%s' % ('1' if '+debug' in spec else '0'), I'm not sure what needs to be done to change this. In the meantime, I added -g to CFLAGS in the makefile and now I have this : https://pastebin.com/wxf05BH0