This is the mail archive of the
crossgcc@cygnus.com
mailing list for the crossgcc project.
Re: Newlib 1.8.1 vfprintf problem on embedded PowerPC
- To: crossgcc@cygnus.com
- Subject: Re: Newlib 1.8.1 vfprintf problem on embedded PowerPC
- From: Jay Kulpinski <jskulpin@eng01.gdds.com>
- Date: Thu, 24 Jun 1999 08:49:41 -0400
- References: <m3909a196o.fsf@grouper.coelacanth.com>
- Reply-To: crossgcc@cygnus.com
Roger Williams wrote:
>
> Hi --
>
> While waiting for my s/w guru to develop application code, I'm writing
> hardware debug utilities for my embedded MPC860 hardware. With the
> help of the CrossGCC FAQ, it was a simple matter to build GCC 2.8.1
> and Newlib 1.8.1 and get a simple "Hello, world" program running.
>
> Most of the libc functions, including sscanf, etc., work fine.
> However, any call to vfprintf goes off to Never-Never Land, so sprintf
> doesn't work.
>
> Any ideas about where to start looking? The printf innards are rather
> hairy... (Unfortunately, I don't have access to an ICD right now, so
> my job is even tougher.)
>
> Am I right in assuming that printf et al. are working for other
> powerpc-eabi developers?
>
> --
> Roger Williams finger me for my PGP public key
> Coelacanth Engineering Inc consulting & turnkey product development
> Middleborough, Massachusetts wireless * datacomm * DSP * ATE
> tel +1 508 947-5585 * fax +1 508 861-0278 * http://www.coelacanth.com/
This probably isn't your problem, but you should fix this
in your source. It can trash the stack and take you down
quite easily. This problem shows up when printing denormalized
doubles.
(616)% diff -c newlib-1.8.1/newlib/libc/stdlib/mprec.c{-orig,}
*** newlib-1.8.1/newlib/libc/stdlib/mprec.c-orig Wed May 12
11:43:46 1999
--- newlib-1.8.1/newlib/libc/stdlib/mprec.c Wed May 12 11:45:08 1999
***************
*** 763,769 ****
--- 763,771 ----
unsigned long *x, y, z;
#ifdef VAX
unsigned long d0, d1;
+ #endif
d.d = _d;
+ #ifdef VAX
d0 = word0 (d) >> 16 | word0 (d) << 16;
d1 = word1 (d) >> 16 | word1 (d) << 16;
#else
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.