sparc-rtems4.11-gcc for C++

Jiri Freyvald jiri.freyvald at gmail.com
Tue Oct 30 12:17:13 UTC 2012


IMHO you don't have to set $(ARCH) for building rtems binaries if you 
have toolchain properly set.
Most of examples provided and all my application so far work ok with 
standard makefile (well, at least compilation succeeded and applications 
send some outputs to stdout)
( so far I tried: i386-rtems4.11/pc386 and sparc-rtems4.11/sis in sis 
simulator, in qemu and on real cortex-m4 hardware)

I can send you some C++ "hello world" application with makefile if you want

Jiri

On 30/10/12 11:01, Luca Cinquepalmi wrote:
> Jiri only one question:
> where $(ARCH) is set? which file? thanks
>
>     Luca
>
> On 10/30/2012 10:43 AM, Jiri Freyvald wrote:
>> Hi,
>> as I suggested in my previous reply - use existing C++ example (with 
>> its makefile) as a c++ template for your project.
>> Anyway,
>> here is the output of my makefile (c++ example):
>>
>> $ export PATH=/opt/rtems-4.11/bin:$PATH
>> $ export RTEMS_MAKEFILE_PATH=/opt/rtems-fw/sparc-rtems4.11/sis/
>>
>> $make clean all
>> rm -f a.out core mon.out gmon.out
>> rm -f -r
>> rm -f -r  a.out *.o *.BAK Depends-o-optimize.tmp
>> rm -f -r o-optimize o-debug
>> test -d o-optimize || mkdir o-optimize
>> sparc-rtems4.11-gcc --pipe -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/ 
>> -specs bsp_specs -qrtems   -g -Wall  -O2 -g -g    -mcpu=cypress     
>> -c   -o o-optimize/init.o init.c
>> sparc-rtems4.11-g++ -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/ -specs 
>> bsp_specs -qrtems   -g -Wall  -g    -mcpu=cypress -c   -o 
>> o-optimize/main.o main.cc
>> sparc-rtems4.11-g++ -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/ -specs 
>> bsp_specs -qrtems   -g -Wall  -g    -mcpu=cypress -mcpu=cypress   -o 
>> o-optimize/cxx_throw.exe  o-optimize/init.o o-optimize/main.o
>> sparc-rtems4.11-nm -g -n o-optimize/cxx_throw.exe > 
>> o-optimize/cxx_throw.num
>> sparc-rtems4.11-size o-optimize/cxx_throw.exe
>>    text       data        bss        dec        hex filename
>>  212608       2740      22960     238308      3a2e4 
>> o-optimize/cxx_throw.exe
>> cp o-optimize/cxx_throw.exe o-optimize/cxx_throw.ralf
>>
>> it should help you
>>
>> Jiri
>>
>>
>> On 30/10/12 08:47, Luca Cinquepalmi wrote:
>>> Here I post a simple rtems C++ code (template.cc) which works if
>>> compiled as a C source file but not as a C++ file.
>>> I'm using sparc-rtems4.11-g++ compiler. Are there particular compilation
>>> flags I have to use? Is C++ template different from C one? Thanks a lot
>>>
>>>      Luca
>>> -------------------------------------------------------------------------------------------------------------------------
>>> #define CONFIGURE_INIT
>>> #include "system.h"
>>> #include <cstdlib>
>>>
>>>
>>> extern "C" {
>>>   rtems_task Init(
>>>     rtems_task_argument arg
>>>   );
>>> };
>>>
>>> /* Declare rtems tasks */
>>> rtems_task Init (rtems_task_argument argument);     /* Declare entry 
>>> point */
>>>
>>> #include "define.h"
>>> #include "leon.h"
>>> #include "utils.h"
>>> #include "printSerial.h"
>>>
>>> rtems_task Init (rtems_task_argument argument)
>>> {
>>>     printf("MY NAME IS LUCA!\n\r");
>>>     rtems_task_delete(RTEMS_SELF);
>>> }
>>> -------------------------------------------------------------------------------------------------------------------------
>>> My Makefile flags:
>>>
>>> CXX = sparc-rtems4.11-g++
>>> BSP_PATH = /opt/$(INSTALL_POINT)/sparc-$(CCOMP)/leon2/lib
>>> SPECS_PATH = $(BSP_PATH)/bsp_specs
>>>
>>> LD_LIBS += -lgcc -lm -msoft-float -lrtems++ -lstdc++
>>> LD_PATH += -I../../include/leon -I../include -B$(BSP_PATH) -specs 
>>> $(SPECS_PATH)
>>> LDFLAGS += -mcpu=v8 -qrtems
>>> CXXFLAGS += -msoft-float -mcpu=v8 $(LD_PATH) -Wno-write-strings
>>>
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.org
>>> http://www.rtems.org/mailman/listinfo/rtems-users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20121030/b3dadb26/attachment-0001.html>


More information about the users mailing list