[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [Debian Wheezy] crttn13a.o: No such file?
From: |
Georg-Johann Lay |
Subject: |
Re: [avr-libc-dev] [Debian Wheezy] crttn13a.o: No such file? |
Date: |
Sat, 08 Dec 2012 21:09:59 +0100 |
User-agent: |
Thunderbird 2.0.0.24 (Windows/20100228) |
Joerg Wunsch schrieb:
As Ivan Shmakov wrote:
I've just tried to build a program for ATtiny13A on a recent
Debian Wheezy, and got:
$ avr-gcc -g -O2 -Wall -pedantic -std=gnu99 -mmcu=attiny13a \
-L/usr/lib/avr/lib/avr25 ../6pp5iouyw6unnen7egfroozp8b.c \
-o 6pp5iouyw6unnen7egfroozp8b
/usr/lib/gcc/avr/4.7.0/../../../avr/bin/ld: crttn13a.o: No such file: No such file or directory
collect2: error: ld returned 1 exit status
Johann, is this the symptom for bug 35407?
Yes.
The convention is that crt*.o is located in the respective multilib
directory, which is
$install/avr/lib/avr25/tiny-stack/
for ATtiny13A. If there is no crttn13a.o, the linker will complain
because the driver cooks up the options for the linker from -mmcu= and
-msp8 and others like -nostartfiles.
Work around is
1) Supply CRT by hand: Link with
-nostartfiles $install/avr/lib/avr25/crttn13a.o
2) Or move crttn13a.o from
$install/avr/lib/avr25/
to
$install/avr/lib/avr25/tiny-stack/
@Jörg: What I don't understand is that with #35407, crt*.o for the tiny
-stack targets occurs twice: once in tiny-stack and again one level higher.
FYI, you can query gcc's multilib layout by means of
$ avr-gcc -print-multi-lib
.;
avr25;@mmcu=avr25
avr3;@mmcu=avr3
avr31;@mmcu=avr31
avr35;@mmcu=avr35
avr4;@mmcu=avr4
avr5;@mmcu=avr5
avr51;@mmcu=avr51
avr6;@mmcu=avr6
avrxmega2;@mmcu=avrxmega2
avrxmega4;@mmcu=avrxmega4
avrxmega5;@mmcu=avrxmega5
avrxmega6;@mmcu=avrxmega6
avrxmega7;@mmcu=avrxmega7
tiny-stack;@msp8
avr25/tiny-stack;@address@hidden
For a specific device:
$ avr-gcc -print-multi-directory
.
$ avr-gcc -print-multi-directory -mmcu=attiny13a
avr25/tiny-stack
$ avr-gcc -print-multi-directory -mmcu=avr25
avr25
$ avr-gcc -print-multi-directory -mmcu=avr25 -msp8
avr25/tiny-stack
This means:
In order to query all multilibs and respective locations and build
options, you can use -print-multi-lib.
In order to query where to put a specific crt*.o, use
-print-multi-directory.
This is nothing new and there is no need to hard-code compiler versions
or multilib layout in the avr-libc build system.
For example, from some 4.7.0 snapshot without xmega support and without
PR52737, you might get:
$ avr-gcc-4.7.0 -print-multi-lib
.;
avr25;@mmcu=avr25
avr3;@mmcu=avr3
avr31;@mmcu=avr31
avr35;@mmcu=avr35
avr4;@mmcu=avr4
avr5;@mmcu=avr5
avr51;@mmcu=avr51
avr6;@mmcu=avr6
tiny-stack;@mtiny-stack
avr25/tiny-stack;@address@hidden
Johann