[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building for release or debug
From: |
Chet Ramey |
Subject: |
Re: Building for release or debug |
Date: |
Tue, 10 May 2022 16:28:57 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 |
On 5/10/22 9:42 AM, Robert E. Griffith wrote:
> Does the bash build system support building optimized for debug and
> release? How would I invoke them?
You can control them with CFLAGS. The default CFLAGS as distributed is
"-g -O2".
> 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.
There's no `debug' target, but if I want to debug, I build with CFLAGS=-g.
> 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?
So by a `release' version you mean a version without symbols? Use CFLAGS.
If you want to strip as many debugging symbols as you can, use
CFLAGS="-O2 -s" -- which might be overkill for a shared object -- or look
at some of the options to `strip'.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/