RTEMS C++ Issues

Robert S. Grimes rsg at alum.mit.edu
Sun Jul 8 23:10:03 UTC 2007


Joel Sherrill wrote:
> On psim at least, the cdtest sample runs fine except for the
> global dtors.
It is indeed the global ctors and dtors that I can't get to work!
>
> It is a magic combinaton of bsp_specs and the linkcmds.
This "magic" is what I'm lacking right now!
>
> I don't know if that helps or not.
It certainly helps in that it pinpoints the unknown!  Anyone with any
info on this?
>
> --joel
>
> Robert S. Grimes wrote:
>> Ralf Corsepius wrote:
>>  
>>>> I have a problem with C++           
>>> This issue has nothing to do with C++. It's a BSP issue.
>>>       
>> Yes, of course - I should have said "I have a problem getting my BSP to
>> support C++", or something to that effect.
>>  
>>>> I think the answer is probably pretty simple, at least for you 
>>>> guys, but
>>>> it's clearly a bit out of reach for me...
>>>>           
>>> No. Without having seen your sources it's impossible to answer. 
>>> Either your BSP's Makefile.am is broken or your bsp_spec is.
>>>       
>> Yes, of course.  I meant to include these files, but I got lost in
>> trying to describe the problem.  Attached are the relevant files, and
>> sorry for the insufficient info the first go-around.
>> -Bob
>>  
>>> Ralf
>>>
>>>
>>>
>>>       
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> %rename endfile old_endfile
>>> %rename startfile old_startfile
>>> %rename link old_link
>>>
>>> *startfile:
>>> %{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s 
>>> rtems_crti%O%s crtbegin%O%s \
>>> %{!qrtems_debug: } \
>>> %{qrtems_debug: }}}
>>>
>>> *endfile:
>>> %{!qrtems: %(old_endfile)} %{qrtems: crtend%O%s ecrtn%O%s}
>>>
>>> *link:
>>> %{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -u 
>>> download_entry -N }
>>>
>>>     
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ##
>>> ## $Id: Makefile.am,v 1.20 2006/01/12 10:12:30 ralf Exp $
>>> ##
>>>
>>> ACLOCAL_AMFLAGS = -I ../../../../aclocal
>>>
>>> include $(top_srcdir)/../../../../automake/compile.am
>>> include $(top_srcdir)/../../bsp.am
>>>
>>> dist_project_lib_DATA = bsp_specs
>>>
>>> include_HEADERS = include/bsp.h
>>> include_HEADERS += include/tm27.h
>>>
>>> nodist_include_HEADERS = include/bspopts.h
>>> DISTCLEANFILES = include/bspopts.h
>>>
>>> noinst_PROGRAMS =
>>>
>>> include_bspdir = $(includedir)/bsp
>>>
>>> include_HEADERS += include/coverhd.h
>>>
>>> dist_project_lib_DATA += startup/linkcmds startup/linkcmds.dl
>>>
>>> noinst_PROGRAMS += startup.rel
>>> startup_rel_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
>>>     ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
>>>     ../../shared/sbrk.c startup/setvec.c \
>>>     ../../shared/gnatinstallhandler.c
>>> startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> noinst_PROGRAMS += dlentry.rel
>>> dlentry_rel_SOURCES = dlentry/dlentry.S
>>> dlentry_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> dlentry_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> noinst_PROGRAMS += bspconsole.rel
>>> bspconsole_rel_SOURCES = console/consolelite.c ../../shared/console.c
>>> bspconsole_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> bspconsole_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> include_bsp_HEADERS = include/opbintctrl.h
>>> noinst_PROGRAMS += opbintctrl.rel
>>> opbintctrl_rel_SOURCES = opbintctrl/opbintctrl.c
>>> opbintctrl_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> opbintctrl_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> include_bsp_HEADERS += irq/irq.h
>>> noinst_PROGRAMS += irq.rel
>>> irq_rel_SOURCES = irq/irq_init.c ../shared/irq/irq_asm.S
>>> irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> include_bsp_HEADERS += ../../powerpc/shared/vectors/vectors.h
>>> noinst_PROGRAMS += vectors.rel
>>> vectors_rel_SOURCES = ../../powerpc/shared/vectors/vectors.h \
>>>     ../../powerpc/shared/vectors/vectors_init.c \
>>>     ../../powerpc/shared/vectors/vectors.S
>>> vectors_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> vectors_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> if HAS_NETWORKING
>>> network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
>>> network_CPPFLAGS += -D__BSD_VISIBLE
>>> noinst_PROGRAMS += network.rel
>>> network_rel_SOURCES = network/xiltemac.c
>>> network_rel_CPPFLAGS = $(AM_CPPFLAGS)
>>> network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
>>>
>>> endif
>>>
>>> noinst_LIBRARIES = libbsp.a
>>> libbsp_a_SOURCES =
>>>
>>> libbsp_a_LIBADD = startup.rel dlentry.rel bspconsole.rel 
>>> opbintctrl.rel \
>>>     vectors.rel irq.rel network.rel
>>>
>>> libbsp_a_LIBADD += 
>>> ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
>>>     ../../../libcpu/@RTEMS_CPU@/@exceptions@/raw_exception.rel \
>>>     ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
>>>     ../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel \
>>>     ../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel \
>>>     ../../../libcpu/@RTEMS_CPU@/ppc403/tty_drv.rel
>>>
>>> EXTRA_DIST = times
>>>
>>> #RSG Added for C++ support
>>> #EXTRA_DIST += dlentry/rtems_crti.S
>>> #rtems_crti.$(OBJEXT): dlentry/rtems_crti.S
>>> #    $(CPPASCOMPILE) -o $@ -c $<
>>> EXTRA_DIST += ../shared/start/rtems_crti.S
>>> rtems_crti.$(OBJEXT): ../shared/start/rtems_crti.S
>>>     $(CPPASCOMPILE) -o $@ -c $<
>>> project_lib_DATA = rtems_crti.$(OBJEXT)
>>> #RSG End
>>>
>>> include $(srcdir)/preinstall.am
>>> include $(top_srcdir)/../../../../automake/local.am
>>>
>>>     
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ## Automatically generated by ampolish3 - Do not edit
>>>
>>> if AMPOLISH3
>>> $(srcdir)/preinstall.am: Makefile.am
>>>     $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
>>> endif
>>>
>>> PREINSTALL_DIRS =
>>> DISTCLEANFILES += $(PREINSTALL_DIRS)
>>>
>>> all-am: $(PREINSTALL_FILES)
>>>
>>> PREINSTALL_FILES =
>>> CLEANFILES = $(PREINSTALL_FILES)
>>>
>>> $(PROJECT_LIB)/$(dirstamp):
>>>     @$(mkdir_p) $(PROJECT_LIB)
>>>     @: > $(PROJECT_LIB)/$(dirstamp)
>>> PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
>>>
>>> $(PROJECT_INCLUDE)/$(dirstamp):
>>>     @$(mkdir_p) $(PROJECT_INCLUDE)
>>>     @: > $(PROJECT_INCLUDE)/$(dirstamp)
>>> PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
>>>
>>> $(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
>>> PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
>>>
>>> $(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
>>>
>>> $(PROJECT_INCLUDE)/bsp/opbintctrl.h: include/opbintctrl.h 
>>> $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/opbintctrl.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/opbintctrl.h
>>>
>>> $(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h 
>>> $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
>>>
>>> $(PROJECT_INCLUDE)/bsp/vectors.h: 
>>> ../../powerpc/shared/vectors/vectors.h 
>>> $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
>>>
>>>
>>> $(PROJECT_INCLUDE)/xiltemac.h: network/xiltemac.h 
>>> $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/xiltemac.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/xiltemac.h
>>>
>>> $(PROJECT_INCLUDE)/xparameters_dflt.h: include/xparameters_dflt.h 
>>> $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/xparameters_dflt.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/xparameters_dflt.h
>>>
>>> $(PROJECT_INCLUDE)/tm27.h: include/tm27.h 
>>> $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
>>>
>>> $(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h 
>>> $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
>>>
>>> $(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h 
>>> $(PROJECT_INCLUDE)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
>>> PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
>>>
>>> $(PROJECT_INCLUDE)/bsp/$(dirstamp):
>>>     @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
>>>     @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>> PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
>>>
>>> $(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
>>> PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
>>>
>>> $(PROJECT_LIB)/linkcmds.dl: startup/linkcmds.dl 
>>> $(PROJECT_LIB)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.dl
>>> PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.dl
>>>
>>> #RSG - Added for C++ support
>>> $(PROJECT_LIB)/rtems_crti.$(OBJEXT): rtems_crti.$(OBJEXT) 
>>> $(PROJECT_LIB)/$(dirstamp)
>>>     $(INSTALL_DATA) $< $(PROJECT_LIB)/rtems_crti.$(OBJEXT)
>>> TMPINSTALL_FILES = $(PROJECT_LIB)/rtems_crti.$(OBJEXT)
>>>
>>>     
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.com
>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>     
>




More information about the users mailing list