error linking lto1 for target avr
Georg-Johann Lay
avr@gjlay.de
Mon Nov 28 02:45:00 GMT 2011
Steven Bosscher schrieb:
>>In avr.c there is:
>>
>>...
>>#include "c-family/c-common.h"
>>...
>
> That is the problem: avr.c should be language independent. Here you
> are trying to link code calling C-family functions in a non-C language
> (lto1 is just another front end for gcc, just like
> cc1/cc1plus/etc...).
>
> You should use extra target files for language specific target code.
> Plenty examples in config/*/*-c.* ...
>
> Ciao!
> Steven
I don't quite get it. Could you be more specific?
Suppose avr.c:avr_out_lpm which is used to print insns in final, e.g.
ADJUST_INSN_LENGTH.
Should avr_out_lpm be moced to avr-c.c? And avr-c.c include all the
rtl.h, tree.h, output.h etc. which is also needed by the functions that
like to use c_addr_space_name?
If a function is mode to avr-c.c and uses c_addr_space_name how does
that avoid liker error? Either it gets error for c_addr_space_name
because it is still missing and needed, or it gets linker error for the
outsourced function like avr_out_lpm.
Anything that uses address space stuff is language dependent. Thus:
Is is legitimate to use MEM_ADDR_SPACE in avr.c?
Is is legitimate to use TYPE_ADDR_SPACE in avr.c?
Must all this put into avr-c.c?
Johann
More information about the Gcc
mailing list