This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Can't build: "`CFLAGS' has changed since the previous run"
- From: Phil Endecott <spam_from_newlib at chezphil dot org>
- To: newlib at sourceware dot org
- Date: Thu, 13 Jul 2006 23:44:15 +0100
- Subject: Can't build: "`CFLAGS' has changed since the previous run"
Dear Newlib Experts,
I'm trying to build binutils, gcc and newlib in a unified directory
structure. Binutils and gcc seem to build OK, but newlib fails during
configuration with this odd message:
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
This was a completely empty build directory, so there was no "previous
run". Can anyone guess what is going on?
Here's some more detail. I last did all this about 4 years ago and it
worked then; in the meantime gcc has moved to Subversion. So I've done
some hacking: I've checked out binutils (the 2.17 tag) and newlib (HEAD)
from CVS:
cvs co -r binutils-2_17 binutils
cvs co newlib
[Is there a CVS tag that I should use to get a "known good" recent
newlib, compatible with binutils 2.17 and gcc 4.1?]
I moved the src/ directory that CVS has created:
mv src cvs-src
Now I get gcc 4.1.1 from svn, into an svn-src directory:
svn co http://gcc.gnu.org/svn/gcc/tags/gcc_4_1_1_release svn-src
Now I build a unified directory full of links:
mkdir src
cd src
ln -s ../svn-src/* .
for i in ../cvs-src/*
do
if [ -e `basename $i` ]
then
if cmp $i `basename $i`
then
true
else
echo "Duplicate, and different: `basename $i`"
fi
else
ln -s $i .
fi
done
In many cases the shared files are identical. Here are all of the files
and directories that are in both cvs and svn, and are different:
ChangeLog configure.in ltcf-c.sh Makefile.def
config contrib ltcf-cxx.sh Makefile.in
config.guess COPYING.LIB ltcf-gcj.sh Makefile.tpl
config-ml.in include ltconfig move-if-change
config.sub intl ltmain.sh README
configure libiberty MAINTAINERS
In these cases I'm using the gcc svn versions. Is there a better way of
solving this?
Anyway, I configure in an out-of-tree build directory:
./../src/configure --target=arm-elf --prefix=/usr/local/arm-elf \
--enable-interwork --enable-multilib --enable-languages="c,c++"
and make. Binutils and gcc seem to be compiled without error. It does
quite a lot of "Configuring in arm-elf/newlib" but eventually fails with:
configure: configuring in libc
configure: running /bin/sh '../../../../../src/newlib/libc/configure'
--prefix=/usr/local/arm-elf '--cache-file=./config.cache'
'--build=i686-pc-linux-gnu' '--host=arm-elf' '--target=arm-elf'
'--with-newlib' '--with-cross-host=i686-pc-linux-gnu'
'--prefix=/usr/local/arm-elf' '--enable-interwork' '--enable-multilib'
'--enable-languages=c,c++' '--program-transform-name=s,^,arm-elf-,; '
'--with-target-subdir=arm-elf' '--srcdir=../../../../src/newlib'
'CC=/usr/local/src/toolchain/builds/arm-elf-01/./gcc/xgcc
-B/usr/local/src/toolchain/builds/arm-elf-01/./gcc/ -nostdinc
-B/usr/local/src/toolchain/builds/arm-elf-01/arm-elf/newlib/ -isystem
/usr/local/src/toolchain/builds/arm-elf-01/arm-elf/newlib/targ-include
-isystem /usr/local/src/toolchain/src/newlib/libc/include
-B/usr/local/arm-elf/arm-elf/bin/ -B/usr/local/arm-elf/arm-elf/lib/
-isystem /usr/local/arm-elf/arm-elf/include -isystem
/usr/local/arm-elf/arm-elf/sys-include
-L/usr/local/src/toolchain/builds/arm-elf-01/./ld' 'CFLAGS=-O2 -g -O2 '
'CPPFLAGS=' 'LDFLAGS=' 'build_alias=i686-pc-linux-gnu'
'host_alias=arm-elf' 'target_alias=arm-elf'
--cache-file=.././config.cache --srcdir=../../../../../src/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 '../../../../../src/newlib/libc/configure'
failed for libc
make[1]: *** [configure-target-newlib] Error 1
Any suggestions would be much appreciated.
With thanks,
Phil.