Configuring for debug info

Kevin Ryde user42 at
Wed Nov 19 06:59:11 CET 2003

nisse at (Niels Möller) writes:
> What's the recommended way of configuring gmp to get debug information
> in the files?

(See also the "maximum debuggability" note in the manual.)

> I get CFLAGS set to -O2 -fomit-frame-pointer -mcpu=athlon
> -march=athlon, no -g in sight.

We quietly dropped -g since on the riscs -O2 rearranges code so much
as to make it almost undebuggable anyway.

> I've also tried setting CFLAGS=-g on the ./configure command line,

That's the way.

>   ./configure --enable-maintainer-mode --enable-assert \
>      CFLAGS="-g -O2 -fomit-frame-pointer -mcpu=athlon -march=athlon"

Yep, if you want those extra flags too.

(For compile-only flags like -pedantic you can slip them into CPPFLAGS
and let the rest be guessed, but that's not good for -g because you
need that in the link too, which doesn't use CPPFLAGS.)

More information about the gmp-devel mailing list