Error building gcc 4.5.2 for AVR

Kai Ruottu kai.ruottu@wippies.com
Tue Jan 25 10:25:00 GMT 2011


25.1.2011 1:57, Jonathan Wakely kirjoitti:

> On 24 January 2011 22:49, Omar Choudary wrote:
>>
>> I am creating a script for building GCC 4.5.2 for the AVR target:
>> http://www.cl.cam.ac.uk/~osc22/files/install_avr_tools.sh
>>
>> I have some troubles when building GCC-4.5.2, see below, maybe you can
>> help me; thanks:
>
> This question is off-topic on this mailing list, please send such
> questions to the gcc-help@gcc.gnu.org list, as described
> http://gcc.gnu.org/lists.html
>
> Since you're using a third-party's build script, not the GCC
> installation instructions, you might be able to ask the author of that
> script for support.

The asker here seems to be the "supporter" :(

Generally the AVR case seems to be a special case. The gcc-4.5.2
configury system gives the complete target name :

[root@localhost gcc-4.5.2]# ./config.sub avr
avr-unknown-none

for the bare "avr" target name used by Omar. The plain vanilla
gcc-4.5.2 configury recognizes this as the second of the two
following templates :

avr-*-rtems*)
         tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
         tmake_file="avr/t-avr t-rtems avr/t-rtems"
         extra_gcc_objs="driver-avr.o avr-devices.o"
         extra_objs="avr-devices.o"
         ;;
avr-*-*)
         tm_file="avr/avr.h dbxelf.h newlib-stdint.h"
         use_gcc_stdint=wrap
         extra_gcc_objs="driver-avr.o avr-devices.o"
         extra_objs="avr-devices.o"
         ;;

ie. probably as a "plain vanilla newlib-based embedded target". So,
what a totally dummy GCC builder would expect the AVR target to use
is :

1. it uses ELF as its object format

2. it uses newlib as its target C library

just like many others targets met earlier...

So this dummy GCC builder is expected to try to build one's toolchain
using the (should be) well-known '*-elf' embedded target toolchain
build process via configuring something like :

   .../configure --prefix=<something> --target=avr-elf --with-newlib

and probably "succeeds" nicely when writing 'make'... Before becoming
aware that newlib really doesn't support AVR :( and there are more
"specific" notes for this "special" target in :

http://gcc.gnu.org/install/specific.html#avr

I tried this "dummy builder from the street" approach and getting
the toolchain succeeded nicely with the plain vanilla gcc-4.5.2
sources, no errors ever :

[root@localhost build]# cd gcc
[root@localhost gcc]# ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: avr-elf
Configured with: ../configure --build=i686-linux-gnu 
--host=i686-linux-gnu --target=avr-elf --enable-languages=c,c++ 
--with-newlib --disable-shared --disable-threads --disable-nls 
--with-gxx-include-dir=/usr/local/include/c++/4.5.2 
--enable-version-specific-runtime-libs --with-pkgversion='by Kai Ruottu 
2011q1'
Thread model: single
gcc version 4.5.2 (by Kai Ruottu 2011q1)

 >> make[2]: Leaving directory
 >> `/local/scratch/osc22/temp/build-avr/gcc-4.5.2/buildavr/libiberty'
 >> /bin/bash: line 3: cd: avr/libgcc: No such file or directory
 >> make[1]: *** [install-target-libgcc] Error 1

If Omar really tries to support the GCC for AVR builders, one dummy
question is : "Why the expected '--with-newlib' is not used in his
GCC configure ?  This definitely is the option which defines the
case being "a generic embedded target case" and removes all kind of
checks and link tests with the "expected to exist prebuilt target C
library", which is the default for "a generic system target case".
The equation: "embedded" == "use the '--with-newlib'" should be known
quite well, at least what leaving it away would mean during the GCC
build...



More information about the Gcc-help mailing list