`CFLAGS' has changed since the previous run:

Franzi Edo. edo.franzi@ukos.ch
Sun Dec 24 01:19:00 GMT 2006


Hi Newlib specialists,
I am in a trouble with my toolchain and newlib; the building process  
terminates during the make (for gcc) with this error

../../../../../../GCC/gcc-4.1.1/newlib/libc
configure: loading cache .././config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  -O2 -g -O2
configure:   current value: -O2 -g -O2
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm .././config.cache'  
and start over
configure: error: /bin/sh '../../../../../../GCC/gcc-4.1.1/newlib/ 
libc/configure' failed for libc
make[1]: *** [configure-target-newlib] Error 1
make: *** [all] Error 2

This is part of my toolchain:

TARGET=m68k-elf
TARGET_DIR=/Users/Shared
BINUTILS_VER=2.16.94
GCC_VER=4.1.1
NEWLIB_VER=1.15.0

cd $TARGET_DIR/GCC/gcc-$GCC_VER
ln -s ../newlib-$NEWLIB_VER/newlib .
ln -s ../newlib-$NEWLIB_VER/libgloss .

export target=$TARGET
export prefix=$TARGET_DIR/cross/$TARGET
export i=$prefix/bin

echo " Build the tools"
mkdir -p $TARGET_DIR/builds/$TARGET/binutils-$BINUTILS_VER
cd $TARGET_DIR/builds/$TARGET/binutils-$BINUTILS_VER
../../../GCC/binutils-$BINUTILS_VER/configure --target=$target -- 
prefix=$prefix
make
make install
make clean

echo " - Build the compiler"
cd $TARGET_DIR/builds/$TARGET
mkdir gcc-$GCC_VER
cd gcc-$GCC_VER
../../../GCC/gcc-$GCC_VER/configure --target=$target --prefix=$prefix  
--enable-languages=c --with-newlib --with-gnu-as --with-gnu-ld
make
make install
make clean


I use OSX 10.4.8 as a target
gcc 4.1.1
binutils 2.16.94
newlib 1.15.0

It seems there is a patch (I found this) ...

--- Makefile.in.ORIG    2006-05-31 08:49:14.166500000 -0400
+++ Makefile.in 2006-05-31 11:08:25.150875000 -0400
@@ -383,7 +383,7 @@
# CFLAGS will be just -g.  We want to ensure that TARGET libraries
# (which we know are built with gcc) are built with optimizations so
# prepend -O2 when setting CFLAGS_FOR_TARGET.
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+CFLAGS_FOR_TARGET = $(strip -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@

# If GCC_FOR_TARGET is not overriden on the command line, then this
@@ -423,7 +423,7 @@
      fi; \
    fi`

-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates

GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)

... but it doesn't solve my problem!
Has someone a solution to build a correct  toolchain with the newlib?
Thank's
   Edo




More information about the Newlib mailing list