compiling gcc 4.1.1 for AVR

Kai Ruottu
Wed Sep 27 06:31:00 GMT 2006

alee wrote:
> I'm trying to compile gcc 4.1.1 for the AVR platorm.

You seem to have achieved your goal already!

> I compiled binutils 2.17 for the AVR platorm already and when I try to 
> compile gcc,

Can you in any way imagine that the subdirectory 'gcc' in the GCC 
sources could be that
'GCC' ?  So when it is "compiled", the compiler(s) called as "GCC" 
is/are ready!

> I get the following error:
> ....
> checking for avr-gcc... 
> /linux_source/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/xgcc 
> -B/linux_source/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/ 
> -B/opt/avr/avr/bin/ -B/opt/avr/avr/lib/ -isystem /opt/avr/avr/include 
> -isystem /opt/avr/avr/sys-include
> checking for C compiler default output file name... configure: error: 
> C compiler cannot create executables
> See `config.log' for more details.
> make[1]: *** [configure-target-libssp] Error 1

 This error tells that the already built "GCC" for AVR cannot create 
executables with
the help of the AVR targeted 'as' and 'ld', the AVR targeted C library etc.

 Why the GCC build tries to build the 'libssp.a' for AVR as default and 
whether it is required for
AVR at all, are the questions you should ask here.  Anyway there should 
be the GCC configure
option :

    Specify that the run-time libraries for stack smashing protection
    should not be built.

to disable it's build, so if you think it being not needed, just disable 
it's build!  A reconfigure
and a rebuild could show how you could get a clean working build but 
just as well you could
try to remove the 'libssp' subdir from the 
and then try 'make' again... If this doesn't help, then try removing the 
'libssp' "target" from
the generated main GCC  'Makefile'.

> Where do I get gmp.h?  Do I need it? What else can be wrong?

My thought is that you don't need 'libssp' for AVR at all...

More information about the Gcc-help mailing list