[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Functions defined both in RTEMS and NEWLIB.

Sergei Organov wrote:
> Hello,
> I'm configuring/building the RTEMS snapshot (20000118) for PowerPC/papyrus
> target as a first step of my attempt to port 4.x RTEMS to the MPC5xx
> processors. I use gcc-2.95.2 and newlib-1.8.2 (actually the latest version
> from CVS).
> The question is: where reentrant syscalls (_read_r, etc.) should reside? In
> RTEMS code or in NEWLIB? They were defined in both places and I removed them
> from NEWLIB by adding -DREENTRANT_SYSCALLS_PROVIDED to the 'newlib_cflags' in
> the RTEMS section of NEWLIB configuration file (newlib/configure.host). Is it
> the right thing to do? If so, then should I send a patch to Cygnus, or
> somebody from OAR will do it?
> Thanks,
> Sergei Organov.

Hum... If you use the powerpc-rtems target,
-DREENTRANT_SYSCALLS_PROVIDED is already thrown for you in

case "${host}" in
# RTEMS supplies its own versions of some routines:
#       malloc()            (reentrant version)
#       exit()              RTEMS has a "global" reent to flush
#       signal()/raise()    RTEMS has its own including pthread signals
#       _XYZ_r()            RTEMS has its own reentrant routines
#  NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
	newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED

I always do a one-tree build. I add a symlink to newlib-1.8.2/newlib in
egcs/ and then do a build in a separate tree. Add --with-newlib to the
list of arguments to ../egcs/configure.

Most RTEMS build bugs were ironed out in newlib-1.8.2. I should just

Charles-Antoine Gauthier
Institute for Information Technology   Institut de technologie de
National Research Council of Canada    Conseil national de recherches du