Gustavo Zacarias
2014-Nov-27 23:41 UTC
[flac-dev] [PATCH] configure.ac: don't try to unset -g from CFLAGS
The sed expression is wrong, any flags with '-g' in any position gets zapped, for example: -mfloat-gprs=double (for powerpc e500) -> -mfloatprs=double. Which gives build errors and is perfectly valid in real use scenarios to switch from e500v1 (single precision) code to e500v2 (double precision) code. Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar> --- configure.ac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 3d647ed..94d7c9e 100644 --- a/configure.ac +++ b/configure.ac @@ -348,11 +348,10 @@ fi if test "x$debug" = xtrue; then CPPFLAGS="-DDEBUG $CPPFLAGS" - CFLAGS=$(echo "$CFLAGS" | sed 's/-g//') - CFLAGS="-g $CFLAGS" + CFLAGS=$(echo "-g $CFLAGS") else CPPFLAGS="-DNDEBUG $CPPFLAGS" - CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//') + CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//') CFLAGS="-O3 -funroll-loops $CFLAGS" fi -- 2.0.4
Erik de Castro Lopo
2014-Nov-30 00:59 UTC
[flac-dev] [PATCH] configure.ac: don't try to unset -g from CFLAGS
Gustavo Zacarias wrote:> The sed expression is wrong, any flags with '-g' in any position gets > zapped, for example: > > -mfloat-gprs=double (for powerpc e500) -> -mfloatprs=double. > > Which gives build errors and is perfectly valid in real use scenarios to > switch from e500v1 (single precision) code to e500v2 (double precision) code.Thanks. Applied a simplified version of that patch. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Jan Stary
2014-Nov-30 12:57 UTC
[flac-dev] [PATCH] configure.ac: don't try to unset -g from CFLAGS
On Nov 27 20:41:44, gustavo at zacarias.com.ar wrote:> The sed expression is wrong, any flags with '-g' in any position gets > zapped, for example: > > -mfloat-gprs=double (for powerpc e500) -> -mfloatprs=double. > > Which gives build errors and is perfectly valid in real use scenarios to > switch from e500v1 (single precision) code to e500v2 (double precision) code. > > Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar> > --- > configure.ac | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 3d647ed..94d7c9e 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -348,11 +348,10 @@ fi > > if test "x$debug" = xtrue; then > CPPFLAGS="-DDEBUG $CPPFLAGS" > - CFLAGS=$(echo "$CFLAGS" | sed 's/-g//') > - CFLAGS="-g $CFLAGS" > + CFLAGS=$(echo "-g $CFLAGS")Just zap the sed line, and leave CFLAGS="-g $CFLAGS" there; no need to echo anything.> else > CPPFLAGS="-DNDEBUG $CPPFLAGS" > - CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//') > + CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//') > CFLAGS="-O3 -funroll-loops $CFLAGS"Why is a $debug setting messing with optimization flags at all?
Erik de Castro Lopo
2014-Nov-30 18:04 UTC
[flac-dev] [PATCH] configure.ac: don't try to unset -g from CFLAGS
Jan Stary wrote:> > if test "x$debug" = xtrue; then > > CPPFLAGS="-DDEBUG $CPPFLAGS" > > - CFLAGS=$(echo "$CFLAGS" | sed 's/-g//') > > - CFLAGS="-g $CFLAGS" > > + CFLAGS=$(echo "-g $CFLAGS") > > Just zap the sed line, and leave > > CFLAGS="-g $CFLAGS" > > there; no need to echo anything.Thats what I did.> > else > > CPPFLAGS="-DNDEBUG $CPPFLAGS" > > - CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//') > > + CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//') > > CFLAGS="-O3 -funroll-loops $CFLAGS" > > Why is a $debug setting messing with optimization flags at all?Because -O0 makes it easier to follow the logic when actually running it in a debugger. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/