Hi Ralph,
See attached. This is what is in our debian packaged version of base.
It applies against 3.14.11. Just set USE_GESYS=YES in
configure/CONFIG_SITE for your application.
Michael
On 5/4/2011 12:33 PM, Ralph Lange wrote:
Hi,
Does anyone have experiences/examples of adding support to the EPICS
build system for generating Cexp [1] loadable modules (instead of
binaries) for RTEMS and other target archs that can use Cexp?
We would like to add that option - preferably with an easy statement
in the Makefile that creates the module in addition or instead of the
completely linked binary - and would like to make new mistakes instead
of the old ones....
All hints, warnings, and rule snippets welcome!
~Ralph
[1] http://www.slac.stanford.edu/~strauman/rtems/cexp/
>From 0e95a351f6cf7f4eff46c345a40bbd693fe8ce96 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver <[email protected]>
Date: Wed, 28 Oct 2009 17:34:23 -0400
Subject: RTEMS Generic System (patch v1.6)
For PROD targets build both monolithic and modular binaries
at the same time.
The option USE_GESYS can now be set in configure/os/CONFIG_SITE.Common.RTEMS
for base, in configure/CONFIG_SITE for individual projects, or from the
command line.
Includes an explicit list of libraries which are part of generic image
---
configure/RULES_BUILD | 7 ++++++
configure/os/CONFIG.Common.RTEMS | 38 +++++++++++++++++++++++++++++++++
configure/os/CONFIG_SITE.Common.RTEMS | 6 +++++
3 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index a83fac3..21ed8d5 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -312,6 +312,13 @@ $(OBJLIB_MUNCHNAME):%.munch : %_ctdt$(OBJ) %$(OBJ)
@$(RM) $@
$(MUNCH_CMD)
+# GeSys modules for RTEMS
+$(MODNAME): \
+%$(MODEXT): %$(EXE)
+ @echo "Building module $@"
+ @$(RM) $@
+ $(DEBUGCMD) $(LINK.mod)
+
runtests: $(TESTSCRIPTS_$(BUILD_CLASS))
-$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS
index 3934cdf..555d3fa 100644
--- a/configure/os/CONFIG.Common.RTEMS
+++ b/configure/os/CONFIG.Common.RTEMS
@@ -81,6 +81,8 @@ OPT_CXXFLAGS_YES = $(CFLAGS_OPTIMIZE_V)
OPT_CFLAGS_NO = $(CFLAGS_DEBUG_V)
OPT_CXXFLAGS_NO = $(CFLAGS_DEBUG_V)
+MODEXT=.obj
+
#--------------------------------------------------
# operating system class (include/os/<os_class>)
OS_CLASS = RTEMS
@@ -95,6 +97,42 @@ OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
$(PROJECT_RELEASE)/lib/no-signal.rel \
$(PROJECT_RELEASE)/lib/no-rtmon.rel
+MOD_SYS_LDFLAGS += $(CPU_CFLAGS) -Wl,-r -nostdlib
+
+# Do not link against libraries which are part of the Generic Image
+GESYS_LIBS += -lgcc
+GESYS_LIBS += -lc -lm -lrtemscpu -lrtemsbsp -lrtems++ -lbspExt
+GESYS_LIBS += -lcexp -ltecla_r -lspencer_regexp -lpmelf -lpmbfd
+GESYS_LIBS += -lnfs -ltelnetd -lrtems-gdb-stub
+
+# While not part of the Generic Image it provides symbols which
+# would conflict.
+GESYS_LIBS += -lrtemsCom
+
+#--------------------------------------------------
+# Options for building GeSys loadable objects
+
+MODNAME_YES = $(PRODNAME:%$(EXE)=%$(MODEXT))
+MODNAME += $(MODNAME_$(USE_GESYS))
+PRODTARGETS += $(MODNAME)
+BIN_INSTALLS += $(MODNAME)
+
+# changes to LDFLAGS in CONFIG_COMMON and LINK.cpp in CONFIG.Common.UnixCommon
+# should be reflected here with the following exceptions
+#
+# replace OP_SYS_LDFLAGS with MOD_SYS_LDFLAGS
+# replace PROD_LDLIBS with MOD_LDLIBS
+# remove STATIC_LDFLAGS
+
+MOD_LDLIBS = $(filter-out $(GESYS_LIBS),$(PROD_LDLIBS))
+
+MOD_LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
+ $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(MOD_SYS_LDFLAGS) $($(BUILD_CLASS)_LDFLAGS)\
+ $(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
+
+LINK.mod = $(CCC) -o $@ $(PRODDIR_LDFLAGS) $(MOD_LDFLAGS)
+LINK.mod += $(PROD_LDFLAGS) $(PROD_LD_OBJS) $(PROD_LD_RESS) $(MOD_LDLIBS)
+
#--------------------------------------------------
# RTEMS has neither shared libraries nor dynamic loading
STATIC_BUILD=YES
diff --git a/configure/os/CONFIG_SITE.Common.RTEMS b/configure/os/CONFIG_SITE.Common.RTEMS
index cf79e32..b643529 100644
--- a/configure/os/CONFIG_SITE.Common.RTEMS
+++ b/configure/os/CONFIG_SITE.Common.RTEMS
@@ -12,6 +12,12 @@ RTEMS_VERSION=4.9.2
#
RTEMS_TOOLS=$(RTEMS_BASE)
+# Link Generic System loadable objects instead of full executable.
+#
+# A GeSys object is similar to a shared library. It can be (un)loaded
+# at runtime by the Generic System loader which is available as a
+# patch against RTEMS.
+USE_GESYS=NO
# If you're using neither BOOTP/DHCP nor FLASH to pick up your IOC
# network configuration you must uncomment and specify your Internet
--
1.7.2.5
- References:
- Generating loadable modules for Cexp Ralph Lange
- Navigate by Date:
- Prev:
EPICS and Octave Andreas Balzer
- Next:
Re: Generating loadable modules for Cexp Ernest L. Williams Jr.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Generating loadable modules for Cexp Till Straumann
- Next:
Re: Generating loadable modules for Cexp Ernest L. Williams Jr.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|