help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building for release or debug


From: Jeffrey Walton
Subject: Re: Building for release or debug
Date: Tue, 10 May 2022 15:10:00 -0400

On Tue, May 10, 2022 at 9:44 AM Robert E. Griffith <bobg@junga.com> wrote:
>
> Does the bash build system support building optimized for debug and
> release?  How would I invoke them?

GNU does not provide a clear line between debug and release. It is
mostly left to the distros and how they setup their default build
flags.

Default build flags used by distros usually provide -g and -O2, which
is part of a release configuration. However, they don't include
-DNDEBUG so you still get debugging behavior in a release artifact
(assuming the application uses asserts).

> I find that doing "./configure; make" with no parameters builds bash
> with debug symbols but in the debugger (gdb inside atom editor with the
> dbg-gdb plugin), many interesting variables are marked "optimized out"
> so I wonder if I can build the project differently to make it more
> conducive to debugging.

-Og is supposed to provide a useful debugging experience. It takes
some optimizations but it is not supposed to affect debugging. See
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options
.

> On a different but related note, when I build my loadable builtin
> against the headers and loadables/makefile.inc from the ubuntu
> bash-builtin package. I still get symbols in my .so. Is there an option
> that I can specify to make that will build a release version?

I think you need to do the symbol visibility gyrations. See
https://gcc.gnu.org/wiki/Visibility .

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]