public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Error building gcc 4.5.2 for AVR
Date: Tue, 25 Jan 2011 10:25:00 -0000	[thread overview]
Message-ID: <4D3EA517.7070005@wippies.com> (raw)
In-Reply-To: <AANLkTimRfRvV6mHhw1sZq5CsrbF4bdtTaL4vAKeQb7AR@mail.gmail.com>

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...

       reply	other threads:[~2011-01-25 10:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTikGSyXsg-KbQdK4awYOhjVyTTnn+sA8YgBTwuJX@mail.gmail.com>
     [not found] ` <AANLkTinfEKRqPOYWfjQafw1grCVA6ewxJ4q-RASD-pxC@mail.gmail.com>
     [not found]   ` <AANLkTimRfRvV6mHhw1sZq5CsrbF4bdtTaL4vAKeQb7AR@mail.gmail.com>
2011-01-25 10:25     ` Kai Ruottu [this message]
2011-01-25 10:55       ` Jonathan Wakely
2011-01-25 14:31   ` Omar Choudary
2011-01-25 20:31     ` Jonathan Wakely
2011-01-26 12:25       ` Omar Choudary
2011-01-26 13:57         ` Kai Ruottu
2011-01-26 17:17           ` Omar Choudary
2011-01-26 18:17             ` Weddington, Eric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D3EA517.7070005@wippies.com \
    --to=kai.ruottu@wippies.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).