This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help! on building ecosconfigure
Mark Salter wrote:
>
> >>>>> Narayana, Venkat A writes:
>
> > Why am i getting these new errors/ does my path is bad?
> > And why did in the mixed up case of gcc and ld, binaries got built.
>
> > ___Start____
> > redboot_net_io.o(.text+0xa00): undefined reference to `puts'
> > redboot_net_io.o(.text+0xa4c): undefined reference to `puts'
> > /home/users/redboot.ROM/install/lib/libtarget.a(io_flash_flash.o): In
> > function `flash_erase':
> > io_flash_flash.o(.text+0x2c8): undefined reference to `putchar'
> > io_flash_flash.o(.text+0x2e0): undefined reference to `putchar'
> > /home/users/redboot.ROM/install/lib/libtarget.a(io_flash_flash.o): In
> > function `flash_program'
> > ___End___
>
> Hmm, I saw this on another architecture that uses a recent gcc.
> The problem is with gcc builtins. Gcc "optimizes" things like:
>
> printf("foo") ==> puts("foo")
>
> and
>
> printf("\n") ==> putchar('\n')
>
> Of course, RedBoot doesn't provide putchar or puts, so you get link
> errors. Try this patch which adds -fno-builtin to the compile line.
Bugger. That's a problem with RedBoot using ISO C standard names without a
full ISO C compatible environment (or for that matter without an ISO C
implementation). I never liked the overloading of the usage, or the
inevitable result that some parts use RedBoot's printf, some part's use
diag_printf, leading to code duplication.
-fno-builtin is not an acceptable solution as it turns off a bunch of
useful builtins that we do want. RedBoot's *printf routines and gets() etc.
will have to be renamed. Actually the *printf() routines should be merged
into the standard diag_ routines and those used in preference.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine