From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Mark Salter Cc: NarayVA@nsc-msg01.network.com, gthomas@cambridge.redhat.com, ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] Help! on building ecosconfigure Date: Thu, 19 Apr 2001 12:51:00 -0000 Message-id: <3ADF41B0.4EC81048@redhat.com> References: <200104191943.f3JJhFr24942@deneb.localdomain> X-SW-Source: 2001-04/msg00219.html 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