Fail to build hello.exe sample on NetBSD for BSP MIPS jmr3904.

Chris Johns chrisj at
Tue Aug 27 08:13:17 UTC 2013

Ivan Temp wrote:
> Hi,
> thanks for your reply.
> Actually I am writing a simple text with my experience, just in case
> could help to build RTEMS on NetBSD. I am trying a couple of fresh
> install of NetBSD versions right to test whether it works with several
> options. Everything is embryonic now.

Did you look at the RSB on NetBSD ?

>   Anyway I used this to build gcc:
> cd ../gcc-4.8.1
> ln -s ../newlib-2.0.0/newlib .
> cd ../b-gcc
> ../gcc-4.8.1/configure \
> --target=${TARGET} \
> --with-gnu-as --with-newlib \
> --verbose \
> --enable-threads \
> --enable-languages="c,c++" \
> --prefix=/usr/rtems/rtems-4.11 \
> --with-gmp=/usr/pkg \
> --with-mpfr=/usr/pkg \
> --with-mpc=/usr/pkg \
>   I needed to set LD_LIBRARY_PATH to /usr/pkg where gmp, mpfr and
> mpcomplex were installed using pkgin. and added
> /usr/rtems/rtems-4.11/bin to PATH.
>   I also installed "isl" but I do not know if is really needed, I have
> to check a bit more.
>   Because I did not use /opt directory I have to set also
> --prefix=/usr/rtems/rtems-4.11 to the rtems build, I have seen some
> default configurations that point directly to /opt.

You can also use /usr/local/rtems/4.11.

>   This is the command I used for RTEMS build with no success:
> VirtualNetBSD# ../../rtems/configure --target=$TARGET
> --enable-rtemsbsp=jmr3904 \
> --enable-tests=samples --disable-posix \
> --prefix=/usr/rtems/rtems-4.11
>   Then I enabled posix following Chris recommendation (thanks) and at
> least now compiles. I am ok setting posix but, do not you think it
> should work with posix disable?

It depends on the patches you use to build gcc. I have a recent patch 
that switches gcc from the RTEMS thread model to POSIX. The RTEMS thread 
model is broken with SMP and requires lots of work to make it SMP safe 
and what is saves you over the POSIX interface will be questionable. The 
POSIX support in GCC need only minor changes to work.

The background is POSIX was consider a extra overhead in terms of code 
size and memory footprint if all you needed was the classic API. This is 
still true because an extra piece of memory is allocated in each TCB 
with POSIX enabled. In terms of code size the overhead is becoming less 
as time goes on because the classic API needs functionality that POSIX 
has. The plan is to move code in the POSIX API to the score so it can be 
used by both APIs. The move to SMP is the reason. The classic API does 
not have a condition variable and the libblock cache needs this because 
the current code is broken with SMP. The classic API's task variable API 
should be depreciated and removed from RTEMS as it is not SMP safe and 
replaced with something like the POSIX keys.

>    I am going to test gdb now, I will let you know.
>   By the way, I am not an expert at all but want to learn.

Excellent and welcome.


More information about the users mailing list