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

Gedare Bloom gedare at rtems.org
Tue Aug 27 13:31:23 UTC 2013


On Tue, Aug 27, 2013 at 5:09 AM, Ivan Temp <ivan.temp at gmail.com> wrote:
> Wow! a lot of stuff here.
>  I do not even know what RSB is, could you please point me to that? I
http://wiki.rtems.org/wiki/index.php/RSB

> thought a cross compiler built from NB would work but after read some
> documents I decided to follow RTEMS instructions to build. It looks to me a
> "standard" MIPS cross compiler, but anyway, I think is done.
>
RTEMS needs some extra options in gcc that tailor the compilation to
the RTEMS OS. So the cross-compiler is not just for MIPS, but also for
RTEMS on MIPS.

>  I want to work with Posix API, so I do not really care much about classic
> API but in RTEMS "Getting Started" document is set for classic API so that
> is what I followed.
>
Interesting. A Posix-oriented getting started might make sense too.
Patches welcomed :)

>  I did not find much info (in fact nothing) about build RTEMS toolsuit under
> NetBSD (that does not necessary mean that it does not exist)
>  I had a very bad time trying to set up the tools, but I realized that
> everything is well documented, the problem was my lack of knowledge.
>
>  I am looking forward to be able to build my first "hello" and make it run
> on gdb.
>
>  I want to apologize in advance because I guess I will ask a lot.
>
Asking is good.
-Gedare

>  Regards,
>  Ivan
>
>
> 2013/8/27 Chris Johns <chrisj at rtems.org>
>>
>> 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.
>>
>> Chris
>
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>



More information about the users mailing list