coreutils
[Top][All Lists]
Advanced

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

Re: Build failure with CFLAGS=-g


From: Glenn Golden
Subject: Re: Build failure with CFLAGS=-g
Date: Sat, 4 Feb 2023 12:28:18 -0700

Sam James <sam@cmpct.info> [2023-02-03 19:49:45 +0000]:
> 
> > On 3 Feb 2023, at 19:47, Glenn Golden <gdg@zplane.com> wrote:
> > 
> > In an attempt to build coreutils with debug symbols, I was surprised to find
> > that this sequence:
> > 
> >  $ git clone https://github.com/coreutils/coreutils
> >  $ cd coreutils/
> >  $ ./bootstrap
> >  $ export CFLAGS=-g
> >  $ ./configure --disable-silent-rules
> >  $ make
> > 
> > resulted in the attached build failure. (The build was clean up to that 
> > point.)
> > 
> > Seems to be 100% reproducible: Same behavior seen several times starting
> > from fresh git clone directory each time. Yet without the CFLAGS=-g, it
> > builds ok.
> > What am I doing wrong?
> > 
> 
> Sometimes odd diagnostics occur with no optimisation. That doesn't make
> it an invalid bug though (but it might be a compiler bug).
> 

Understood, but still surprising (to me anyway) that that seems to imply
that in Our Modern World, it's no longer expected to be possible to build
all of coreutils unoptimized... I guess because gdb does ok even with opt
enabled, so there's no motivation to ensure that unoptimized build works...?

Anyway, I was able to work around this to accomplish what I wanted -- build 
one particular executable of interest with optimization off -- by just
scraping the rule from the default make output (i.e. without expoert CFLAGS=-g)
and then manually removing the "-O2". But still, it seems kind of odd that
one has to resort to such things to simply obtain an un-optimized executable.

Is there some other magic incantation for obtaining an un-optimized build
of a single executable, or of the entire coreutils with debug symbols?
I vaguely recall there used to be at one time a repo coreutils-dbg (or
maybe it was coreutils-debug) but that seems to no longer be the case.

Is there some other way?

Thanks,

Glenn



reply via email to

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