<div dir="ltr"><font size="2">Hello, I am compiling a simple test for my SPARC RTEMS. I have an Init task (declared with extern "C"), and this is how I compile it (Makefile):<br></font><div><font size="1"><font size="2"> </font><br># Compiler<br>CC=sparc-rtems4.11-g++<br>BSP=-specs bsp_specs -qrtems<br>LIBS=-B../../leon3/sparc-rtems4.11/leon3/lib<br>INCLUDES=-I../../leon3/sparc-rtems4.11/leon3/lib/include<br>FLAGS=-mcpu=cypress -msoft-float -O0 -g -ffunction-sections -fdata-sections -Wall<br>CPPFLAGS=-c -Wall -msoft-float<br>LDFLAGS=-lm <br>SOURCESCPP=test.cpp image.cpp init.cpp<br>OBJECTS=$(SOURCESCPP:.cpp=.o)<br>EXECUTABLE=image_test.exe<br><br>all: $(SOURCES) $(EXECUTABLE)<br>$(EXECUTABLE): $(OBJECTS)<br>    $(CC) $(LIBS) $(BSP) $(FLAGS) $(OBJECTS) $(LDFLAGS)  -o $@<br>.cpp.o:<br>    $(CC) $(INCLUDES) $(FLAGS) $(CPPFLAGS) $< -o $@<br>clean:<br>    rm -f *.exe *.o *.d<br><br><br></font></div><div><font size="1"><font size="2">If I compile and link WITH an image.cpp file , which contains a simple c++ class, my code ends and nothing happens. However, If I DO NOT compile with that image.cpp class, everything works fine. What might be wrong here?<br> </font><br><br></font></div><div><font size="1"><font size="2">More information: I debugged this with gdb + tsim and found out that it ends on <b>threadglobalconstruction.c</b><br><br>#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)<br>  /*<br>   *  _init could be a weak symbol and we SHOULD test it but it isn't<br>   *  in any configuration I know of and it generates a warning on every<br>   *  RTEMS target configuration.  --joel (12 May 2007)<br>   */<br>  INIT_NAME();<br>#endif<br> </font><br></font></div></div>