help for building rtems4.10.2

孙陈伟 cwsun at mail.ustc.edu.cn
Sun Aug 19 08:46:44 UTC 2012


Thank you for reply,I have fixed this problem.
At firstly,I built GNU CROSS Compiler Toolset with newlib-1.16.0.tar.gz,
                                                   newlib-1.16.0-rtems4.9-20090324.diff,
                                                   binutils-2.20.tar.bz2 and 
                                                   gcc-4.3.2.tar.bz2
                                                   gcc-4.3.2-20080910.diff,
these software packages all are downloaded from ftp://ftp.rtems.com/pub/rtems/SOURCES.
when I built rtems-4.10.2.tar.bz2 with the Compiler Toolset, the error happend as bellow:
rtems-4.10.2/c/src/../../cpukit/libcsupport/src/readlink.c:21: error: conflicting types for ‘readlink’
/home/tom/rtems/tools/rtems-4.10/lib/gcc/powerpc-rtems4.10/4.3.2/../../../../powerpc-rtems4.10/include/sys/unistd.h:228: error: previous declaration of ‘readlink’ was here
gmake[5]: *** [src/libcsupport_a-readlink.o] Error 1

the problem lies in the defination of' readlink()',the definationin of of'readlink()' in readlink.c is :
ssize_t readlink(
  const char *pathname,
  char       *buf,
  size_t      bufsize
)
{
........
} 

while the  declaration of ‘readlink’ in powerpc-rtems4.10/include/sys/unistd.h:228 is :
int _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen));

so there is a confliction in the type of 'readlink'.

Finaly, I updated newlib-1.16.0.tar.gz 
                  newlib-1.16.0-rtems4.9-20090324.diff,
with              newlib-1.17.0.tar.gz
                  newlib-1.17.0-rtems4.10-20091009.diff
which come from ftp://ftp.rtems.com/pub/rtems/SOURCES/4.10/
the types of 'readlink' in these two places  are both 'ssize_t',so the error fixed, Now I can build rtems-4.10.2.tar.bz2 successfully,O(∩_∩)O~
   Additionally,My GNU CORSS Compiler based powerpc,so the name of the Cross Compiler is powerpc-rtems4.10,and my host is Linux-2.6.35.6-45.fc14.i686.

this is my first mail to rtems maillist, and you are the first guy to reply me, thank you for kind-hearted help,O(∩_∩)O~
> -----Original E-mail-----
> From: "Ralf Corsepius" <ralf.corsepius at rtems.org>
> Sent Time: 2012-8-19 12:57:07
> To: rtems-users at rtems.org
> Cc: 
> Subject: Re: help for building rtems4.10.2
> 
> On 08/19/2012 12:02 AM, 孙陈伟 wrote:
> >
> > Hi,everybody.
> >    I have a problem when I build rtems4.10.2 with gcc4.3.2,newlib1.6.0. The errors are bellow:
> >
> > mv -f src/.deps/libcsupport_a-symlink.Tpo src/.deps/libcsupport_a-symlink.Po
> > powerpc-rtems4.10-gcc --pipe -DHAVE_CONFIG_H   -I.. -I../../cpukit/../../../score603e/lib/include   -mcpu=603e -Dppc603e -O2 -g -fno-keep-inline-functions -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT src/libcsupport_a-readlink.o -MD -MP -MF src/.deps/libcsupport_a-readlink.Tpo -c -o src/libcsupport_a-readlink.o `test -f 'src/readlink.c' || echo '../../../../../../rtems-4.10.2/c/src/../../cpukit/libcsupport/'`src/readlink.c
> > ../../../../../../rtems-4.10.2/c/src/../../cpukit/libcsupport/src/readlink.c:21: error: conflicting types for ‘readlink’
> > /home/tom/rtems/tools/rtems-4.10/lib/gcc/powerpc-rtems4.10/4.3.2/../../../../powerpc-rtems4.10/include/sys/unistd.h:228: error: previous declaration of ‘readlink’ was here
> > gmake[5]: *** [src/libcsupport_a-readlink.o] Error 1
> > gmake[5]: Leaving directory `/home/tom/rtems/build/build-rtems/powerpc-rtems4.10/c/score603e/cpukit/libcsupport'
> > gmake[4]: *** [all-recursive] Error 1
> > gmake[4]: Leaving directory `/home/tom/rtems/build/build-rtems/powerpc-rtems4.10/c/score603e/cpukit'
> > gmake[3]: *** [all] Error 2
> >
> > Can Anybody tell me how to fix it ?
> 
> Where have you got your toolchain from?
> 
> It's hopelessly outdated. The current rtems-4.10 toolchain consists of
> gcc-4.4.7 + newlib-1.18.0
> 
> Or is there are typo in your initial sentence?
> Did you mean newlib-1.16.0 instead of newlib-1.6.0?
> 
> This could indicate you are trying to use an rtems-4.9 toolchain to 
> build rtems4.10 - This doesn't work. Building rtems-4.9 and rtems-4.10 
> need different versions of the toolchains.
> 
> Ralf
> 
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users





More information about the users mailing list