avr-gcc fails to build if already installed

Marek Michalkiewicz marekm@t19.ds.pwr.wroc.pl
Wed Apr 26 03:59:00 GMT 2000


version: CVS gcc
host: i386-linux (Debian 2.1)
target: avr

More on the avr target-libiberty build problem...
First "rm -rf /usr/local/avr /usr/local/lib/gcc-lib/avr".
Build (in separate directory) and install the current CVS binutils:

$ ../src/configure --target=avr && make && su -c "make install"

no problem so far.  Now build gcc in a separate directory:

$ ../egcs/configure --target=avr --enable-languages=c && make

it builds fine, there is this message but it doesn't prevent
installation:

checking whether the C compiler (/home/marekm/gcc/build/gcc/xgcc -B/home/marekm/gcc/build/gcc/ -B/usr/local/avr/bin/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

which is not a problem really - the AVR ELF "executables" created
are not supposed to be executed directly, but are normally
converted by avr-objdump to "srec" format and programmed into
the target system.  Also, to create "executables" it needs the
C startup files gcrt1-*.o which are not installed yet (they
come from avr-libc which requires avr-gcc installed first).

$ su -c "make install"

installs it, the installed avr-gcc cross compiler works fine,
but now trying to build it again (even without any changes to
the source tree)

$ make

(mis)configures some additional directories and then fails to
build with the following messages:

test x"no" != xyes || \
  /home/marekm/gcc/build/gcc/xgcc -B/home/marekm/gcc/build/gcc/ -B/usr/local/avr/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I../../../egcs/libiberty/../include  -W -Wall -Wtraditional  ../../../egcs/libiberty/choose-temp.c -o pic/choose-temp.o
/home/marekm/gcc/build/gcc/xgcc -B/home/marekm/gcc/build/gcc/ -B/usr/local/avr/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I../../../egcs/libiberty/../include  -W -Wall -Wtraditional ../../../egcs/libiberty/choose-temp.c
../../../egcs/libiberty/choose-temp.c:27:22: sys/types.h: No such file or directory
../../../egcs/libiberty/choose-temp.c:29:19: unistd.h: No such file or directory
../../../egcs/libiberty/choose-temp.c:38:66: sys/file.h: No such file or directory
make[1]: *** [choose-temp.o] Error 1
make[1]: Leaving directory `/home/marekm/gcc/build/avr/libiberty'
make: *** [all-target-libiberty] Error 2

If I do "rm -rf /usr/local/lib/gcc-lib/avr" before the second
"make" misconfigures things, it will work fine.

The target is a small 8-bit micro without any operating system,
so it doesn't have the header files target-libiberty requires.

I don't think having the cross compiler already installed should
make any difference when building another copy of it.  It is not
a very serious problem really (there is a known workaround
"rm -rf /usr/local/lib/gcc-lib/avr"), but it does make things
a little less convenient (have to remove the already installed
compiler before building the new one, no other GNU package that
I know of requires this, only "make install" overwrites the
previous installation).  If it just has to be that way on this
target, please tell me so and I'll accept it - I'm not complaining
(in fact I think avr-gcc is very good), but I'm reporting it here
in case it is really a bug in the gcc build system...

Thanks,
Marek


More information about the Gcc-bugs mailing list