On Mon, Aug 20, 2012 at 4:54 PM, Ken Goldman <kgold...@us.ibm.com> wrote:

> I'm trying to compile openssl for:
>
> Linux, 32-bit on a 64-bit machine, shared libraries, and debug.
>
> The closest I found was:
>
> > ./Configure linux-elf -m32 -shared -g
>
> but this still does -O3, and the optimizer doesn't work well with the
> source level debugger.
>
> Any clues for changing -O3 to -O0?
>
For debug builds, you will likely want -g3 -ggdb -O0. You should also
define -DDEBUG=1 (and make sure -DNDEBUG=1 is *not* defined).

-g3 provides maximum debugging information. For example, symbolic constants
through #define's will be available.

-ggdb provides gdb extension. I don't believe there are any at the moment,
but I got into the habit of using it (in case they show up in the future).

NDEBUG is Posix C and used for "Release" builds, so it should be undefined.
Some libraries/implementation sneak in additional code when DEBUG is
defined, so I define it.

Sorry about not answering your original question :(

Jeff

Reply via email to