avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Specifying crt*.o file


From: Anton Erasmus
Subject: Re: [avr-gcc-list] Specifying crt*.o file
Date: Thu, 10 Jan 2002 10:30:12 +0200

Hi,

I am using the latest avr-gcc version for windows available on the 
avrfreaks.net site. I am using their modified make1 and make2 
make files that originated from Volker Oth.

The make files does first do a compile only with the -c swicth, and 
then uses avr-gcc to do the linking of all the files.

It seems from the output you get, that it must work, so I will start 
with your simplified example and add the extra parameters that is 
used in the make files one by one to see if one of them causes the 
problem.

Thanks for your help.

Regards
   Anton

P.S. Do you have documentation that describes the -nostartfiles 
option ? I have downloaded some pdf documents that were 
generated from TeX versions of the GNU documentation. This 
option is not described in these docs. ld.pdf and gcc.pdf


From:                   address@hidden
Send reply to:          address@hidden
To:                     address@hidden
Subject:                Re: [avr-gcc-list] Specifying crt*.o file
Date sent:              Wed, 9 Jan 2002 22:27:09 +0100

> On Wed, 09 Jan 2002, Anton Erasmus wrote:
> > Hi,
> > 
> > If I specify the crt file explicittely on the command line, I get
> > "Duplicate Symbol" errors. It seems that the default crt file is
> > still linked in as well. I cannot find the option, that tells gcc
> > not to link in the default crt file.
> > 
> > The -nostartfiles option that reinhard jessich suggested, gives the
> > warning "unknown option nostartfiles". 
> 
> First I do only compile:
> /usr/local/cross-tools/bin/avr-gcc -v -c test.c
> nothing special in the output, so I will not send it.
> 
> The output of a normal link command:
> /usr/local/cross-tools/bin/avr-gcc -v test.o
> Reading specs from /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/specs
> Configured with: /opt/avr/gcc/source/gcc-3.0.2/configure -v
> --target=avr --prefix=/usr/local/cross-tools --with-gnu-ld
> --with-gnu-as --disable-nls Thread model: single gcc version 3.0.2
>  /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld
> -m avr85xx
> /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib/crts8
> 515.o -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
> -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib
> test.o -lgcc -lc -lgcc                                
> 
> The output of the special link command:
>  /usr/local/cross-tools/bin/avr-gcc -v -nostartfiles test.o
> Reading specs from /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/specs
> Configured with: /opt/avr/gcc/source/gcc-3.0.2/configure -v
> --target=avr --prefix=/usr/local/cross-tools --with-gnu-ld
> --with-gnu-as --disable-nls Thread model: single gcc version 3.0.2
> /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld -m
> avr85xx -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
> -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib
> test.o -lgcc -lc -lgcc
> 
> Then I have tried:
> /usr/local/cross-tools/bin/avr-gcc -v test.o
> /usr/local/cross-tools/avr/lib/crts8515.o
> 
> and got:
> <snip>
> /usr/local/cross-tools/avr/lib/crts8515.o: In function
> `__c_startup__':
> /opt/avr/gcc/source/avr-libc-20020106/libc/gcrt1.S:148: multiple
> definition of `_real_init_' <snip>
> 
> Then I tried:
> /usr/local/cross-tools/bin/avr-gcc -nostartfiles -v test.o
> /usr/local/cross-tools/avr/lib/crts8515.o
> 
> and got:
> <snip>
>  /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld
>  -m avr85xx
> -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
> -L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib
> test.o /usr/local/cross-tools/avr/lib/crts8515.o -lgcc -lc -lgcc
> 
> So you can see the option is understand and the gcc will do exactly
> what I told it. I have tested your special case with the crtxxx.o on
> the command line and it worked, too!
> 
> Check the gcc command that you are using. Maybe you have forgot to add
> something or maybe you have an other version of the compiler?
> 
> Reinhard
> 
> -- 
>  Ing. Reinhard Jessich              mailto:
>  address@hidden A-1190 Vienna, Goergengasse 2/2/1 
>  phone: +43/1/3692600 http://members.telering.at/jessich mobile:
>  +43/664/1735439
> avr-gcc-list at http://avr1.org
> 


avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]