This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: powerpc-eabispe build error in vfprintf.c


Hello,

Newlib now builds OK and my applications run as normal, problem solved then.

Thank you

------
Regards Andreas
www.rt-kernel.com

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On
Behalf Of Jeff Johnston
Sent: den 12 februari 2008 19:13
To: info.gnu@rt-labs.com
Cc: newlib@sources.redhat.com
Subject: Re: powerpc-eabispe build error in vfprintf.c

Andreas,

   Not sure why you are disabling long long, but thanks for catching 
that powerpc's version of vfprintf wasn't fully shielded.  The change is 
a little more complex than what you posted as there are bit shifts being 
done that assume a quad int is 64 bits.  While the powerpc vfprintf has 
lagged behind some changes to shared vfprintf, I have added a few: the 
reentrant _fflush_r call instead of fflush and specifying the reentrant 
data pointer to _mbtowc_r (instead of _REENT).

   Please try out the checked-in code and let me know if there are any 
problems.

Regards,

-- Jeff J.


2008-02-12  Jeff Johnston  <jjohnstn@redhat.com>

         * libc/machine/powerpc/vfprintf.c (_VFPRINTF_R): Prepare
         for user specifying --disable-newlib-io-long-long on configure.
         Call _fflush_r instead of fflush.  For _mbtowc_r, pass the
         reentrant pointer passed in rather than _REENT.

info.gnu@rt-labs.com wrote:
> Hello,
> 
> When building newlib for powerpc-eabispe with the following config
> 
>   $ ../newlib-1.16.0/configure --target=powerpc-eabispe
> --prefix=/proj/crossgcc/powerpc-eabispe --disable-nls
> --disable-newlib-supplied-syscalls --disable-newlib-mb
> --disable-newlib-io-pos-args --disable-newlib-io-long-long
> --disable-newlib-io-long-double --disable-newlib-iconv
> --enable-newlib-multithread
> 
> I get the following error.
> 
> powerpc-eabispe-gcc
> -B/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib/
> -isystem
>
/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib/targ-in
> clude -isystem
> /cygdrive/d/buildcross/build/newlib-1.16.0/newlib/libc/include
>
-B/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/libgloss/rs6
> 000
>
-L/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/libgloss/lib
> nosys -L/cygdrive/d/buildcross/build/newlib-1.16.0/libgloss/rs6000 
> -msoft-float -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\"
> -DPACKAGE_VERSION=\"1.16.0\" -DPACKAGE_STRING=\"newlib\ 1.16.0\"
> -DPACKAGE_BUGREPORT=\"\" -I.
> -I../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc -O2
> -D__NO_SYSCALLS__ -DMISSING_SYSCALL_NAMES -fno-builtin     -I
> ../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/../../stdio
> -I
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/../../stdlib
> -DREENTRANT_SYSCALLS_PROVIDED -DMISSING_SYSCALL_NAMES -DABORT_PROVIDED
> -DMALLOC_PROVIDED -UEXIT_PROVIDED -DSIGNAL_PROVIDED -D__DYNAMIC_REENT__ -g
> -Os  -msoft-float -c
> ../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c
> ../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:
> In function '_vfprintf_r':
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 3: warning: left shift count >= width of type
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 4: error: 'quad_t' undeclared (first use in this function)
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 4: error: (Each undeclared identifier is reported only once
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 4: error: for each function it appears in.)
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 4: error: expected ')' before '_uquad'
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:90
> 7: error: expected ';' before '_uquad'
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:91
> 0: warning: left shift count >= width of type
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:91
> 4: warning: left shift count >= width of type
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:92
> 8: warning: left shift count >= width of type
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:93
> 0: warning: left shift count >= width of type
>
../../../../../../../newlib-1.16.0/newlib/libc/machine/powerpc/vfprintf.c:93
> 2: warning: left shift count >= width of type
> make[9]: *** [vfprintf.o] Error 1
> make[9]: Leaving directory
>
`/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib/libc/m
> achine/powerpc'
> make[8]: *** [all-recursive] Error 1
> make[8]: Leaving directory
>
`/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib/libc/m
> achine'
> make[7]: *** [all-recursive] Error 1
> make[7]: Leaving directory
>
`/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib/libc'
> make[6]: *** [all-recursive] Error 1
> make[6]: Leaving directory
> `/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib'
> make[5]: *** [all] Error 2
> make[5]: Leaving directory
> `/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/nof/newlib'
> make[4]: *** [multi-do] Error 1
> make[4]: Leaving directory
> `/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/newlib'
> make[3]: *** [all-multi] Error 2
> make[3]: Leaving directory
> `/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/newlib'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/cygdrive/d/buildcross/build/build_newlib/powerpc-eabispe/newlib'
> make[1]: *** [all-target-newlib] Error 2
> make[1]: Leaving directory `/cygdrive/d/buildcross/build/build_newlib'
> make: *** [all] Error 2
> 
> To get round the problem I used the following patch based on regular
> vfprintf.c
> 
> Index: ./newlib/libc/machine/powerpc/vfprintf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/powerpc/vfprintf.c,v
> retrieving revision 1.13
> diff -u -8 -p -r1.13 vfprintf.c
> --- ./newlib/libc/machine/powerpc/vfprintf.c            29 Mar 2007
06:25:44
> -0000        1.13
> +++ ./newlib/libc/machine/powerpc/vfprintf.c         12 Feb 2008 07:09:23
> -0000
> @@ -363,16 +363,19 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap
>             int expsize = 0;  /* character count for expstr */
>             int ndig;             /* actual number of digits returned by
cvt
> */
>             char expstr[7];               /* buffer for exponent string */
>  #endif
>  
>  #ifndef _NO_LONGLONG
>  #define quad_t    long long
>  #define u_quad_t  unsigned long long
> +#else
> +#define quad_t long
> +#define u_quad_t unsigned long
>  #endif
>  
>  #ifndef _NO_LONGLONG
>             u_quad_t _uquad;          /* integer arguments %[diouxX] */
>  #else
>             u_long _uquad;
>  #endif
>             enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */
> 
> 
> 
> Is that patch valid?
> 
> ------
> Regards Andreas
> www.rt-kernel.com
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]