Merge ~dirk.zimoch/epics-base:vxWorks5 into ~epics-core/epics-base/+git/epics-base:7.0

Proposed by Dirk Zimoch
Status: Rejected
Rejected by: Andrew Johnson
Proposed branch: ~dirk.zimoch/epics-base:vxWorks5
Merge into: ~epics-core/epics-base/+git/epics-base:7.0
Diff against target: 272 lines (+143/-12)
8 files modified
configure/RULES_BUILD (+17/-0)
configure/os/CONFIG.Common.vxWorksCommon (+36/-10)
documentation/RELEASE_NOTES.html (+10/-1)
modules/ca/src/client/Makefile (+1/-0)
modules/ca/src/client/templateInstances.cpp (+66/-0)
modules/database/src/ioc/db/Makefile (+1/-0)
modules/database/src/ioc/db/templateInstances.cpp (+9/-0)
modules/libcom/test/epicsAtomicTest.cpp (+3/-1)
Reviewer Review Type Date Requested Status
Andrew Johnson Disapprove
Review via email: mp+355587@code.launchpad.net

Commit message

Allow to build for vxWorks 5.

Description of the change

This change brings back the possibility to compile EPICS 7 for vxWorks versions 5.5 up to 6.2.
It introduces a method to skip modules for certain architectures using the Makefile variable SKIP_BUILDS which accepts a list of name patterns.
For vxWorks versions using gcc versions before 3.4 (i.e. up to vxWorks 6.2) the following setting is applied automatically to skip the pvAccess modules which are incompatible with the old compilers:

SKIP_BUILDS=pv% normativeTypes

To post a comment you must log in.
~dirk.zimoch/epics-base:vxWorks5 updated
00406dc... by Dirk Zimoch

Merge branch '7.0' into vxWorks5

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Dirk, are you proposing that vxWorks 5.5 be considered supported in 7.0.2? So far, "official support" for a vxWorks version has been code for "Andrew support". Similarly for Makefile. Are you/PSI willing to take up the burden of supporting the remaining 5.5 user community?

For my part, I'd like to encourage EPICS users to move away from this 16 year old, end of life, release. The idea of SKIP_BUILDS does not appeal to me either.

Maybe it would be better to maintain this as a branch to emphasize the AS IS nature of support?

This said, I don't have much stake in vxWorks support one way or the other. So mine is not the deciding vote.

Revision history for this message
Dirk Zimoch (dirk.zimoch) wrote :

Hello Michael,
Often the reasons for keeping an old os version are not purely technical and beyond our influence. This may affect other institutes as well. I don't know if anyone else still uses vxWorks 5, but we do and we will probably continue doing so for a while (in parallel with vxWorks 6 and Linux systems).

As much as I value your attempt to "march forward", I likewise see a value in "no one left behind". I would like to go forward to EPICS 7 and prefer if this could be supported by EPICS.

I have my Jenkins server set up, so I can test if any change still compiles, and I can fix new things that are problematic. At the moment, I only test the main branches (e.g. "7.0"). I can add your development branches if you like, so that I can test before you merge.

If vxWorks 5.5 support is not officially accepted, I can still keep the changes local. I have published my changes in this merge request not for the benefit of PSI but for the benefit of those parts of the EPICS community who still use vxWorks 5.5 like us, or rather vxWorks versions from 5.5 up to 6.3. (And I do not attempt to support vxWorks 5.3.)

I have one embedded Linux target architecture which has an old C++ compiler/library as well and cannot build PVA but has no problems with the rest of EPICS 7. I use the same approach for that architecture.

BTW, I'm not a fiend of any reasoning along the line "Works for me, so simply use my setup." With the same reasoning I could drop any attempts to keep my software compatible with Windows or RTEMS. But in my opinion in a community it is better to try to support as many systems as possible and not to exclude people simply because they have reasons not to use my setup.

Revision history for this message
Andrew Johnson (anj) wrote :

Hi Dirk,

So you are looking to run the IOC and RSRV server from 7.0 on older VxWorks versions, but not the PVA modules. You appear to have showed that there are no major source code changes needed to do that other than one minor code change and restoring the templateInstance.cpp source files that were deleted before the 3.16.1 release back in 2016.

As long as you have your Jenkins building the 7.0 branch against those versions and you're willing to work with the other developers to fix any issues that it brings up I think that should be a reasonable request and I'd be okay with restoring the source files.

However I don't like your SKIP_BUILDS mechanism. It seems too arbitrary, and I'm not sure if it is even necessary to automate this in the build system at all.

My preferred solution would be for you to use a separate checkout of Base *without* checking out the git submodules, which would give you a tree that includes none of the PVA modules but does contain the libcom, ca and database modules since they are now part of the 7.0 branch again. The rules in the modules directory check for the presence of a Makefile in the submodule directories before trying to build in them, so this approach works fine.

If a separate checkout isn't acceptable and you really want to build everything in a single tree I would want to try filtering out the target architectures that can't be built from the CROSS_COMPILER_TARGET_ARCHS list inside the individual modules. You can add a file configure/CONFIG_SITE.local to each submodule that does something like this:

  CROSS_COMPILER_TARGET_ARCHS := $(filter-out vxWorks-68040, $(CROSS_COMPILER_TARGET_ARCHS))

Repeat that line for as many cross-target arch's as necessary. Note that you might need to modify the very first setting of CROSS_COMPILER_TARGET_ARCHS to make sure that it uses := instead of = (+= is fine for either after the first setting). I have used this approach before to disable building troublesome architectures on certain modules.

- Andrew

Revision history for this message
Andrew Johnson (anj) wrote :

We think the best way to suppress building a particular module is to filter out the target from the CROSS_COMPILER_TARGET_ARCHS inside the the module's configure/CONFIG_SITE (or a .local version of that) file.

However we're not going to re-add the template instances to the EPICS 7 tree, so you're going to have to maintain local patches if you want this.

- Core meeting

review: Disapprove

Unmerged commits

00406dc... by Dirk Zimoch

Merge branch '7.0' into vxWorks5

7738b68... by Dirk Zimoch

fix missing template instances for old vxWorks (uses -fno-implicit-templates)

1199fab... by Dirk Zimoch

Fix strange compiler errors with gcc 2.96:
using <namespace::function>; seems not to work but
using namespace <namespace>; works
Also 'add' only works with explicit namespace. Why?

1aefc5f... by Dirk Zimoch

re-enable building vxWorks 5

6f666c6... by Dirk Zimoch

Add mechanism to skip modules for selected architectures

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
2index 9b8cbf0..daaae86 100644
3--- a/configure/RULES_BUILD
4+++ b/configure/RULES_BUILD
5@@ -84,6 +84,23 @@ endif
6 -include $(CONFIG)/RULES.Db
7
8 #---------------------------------------------------------------
9+# Do not build anything if current path matches SKIP_BUILD
10+
11+ifneq (,$(strip $(SKIP_BUILDS)))
12+CURRENT_MODULE=$(subst $(realpath $(TOP)/..)/,,$(subst $(realpath $(dir $(lastword $(MAKEFILE_LIST)))..)/,,$(realpath ..)))
13+ifneq ($(filter $(SKIP_BUILDS) $(addsuffix /%,$(SKIP_BUILDS)),$(CURRENT_MODULE)),)
14+$(info Skipping $(CURRENT_MODULE) for $(T_A))
15+PROD=
16+TESTPROD=
17+LIBRARY=
18+TESTLIBRARY=
19+LOADABLE_LIBRARY=
20+TESTS=
21+SRC_FILES=
22+endif
23+endif
24+
25+#---------------------------------------------------------------
26 # Include defines and rules for prod, library and test* targets
27
28 #ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRARY) ))
29diff --git a/configure/os/CONFIG.Common.vxWorksCommon b/configure/os/CONFIG.Common.vxWorksCommon
30index 50f6269..8b950cf 100644
31--- a/configure/os/CONFIG.Common.vxWorksCommon
32+++ b/configure/os/CONFIG.Common.vxWorksCommon
33@@ -63,6 +63,7 @@ VXWORKS_MAJOR_VERSION = $(basename $(basename $(VXWORKS_VERSION)))
34
35 # These are needed for vxWorks 6.x; the GNU toolset version number
36 # is in the path to the compiler tools:
37+VX_GNU_VERSION_5 = 2.96
38 VX_GNU_VERSION_6.0 = 3.3.2
39 VX_GNU_VERSION_6.1 = 3.3.2
40 VX_GNU_VERSION_6.2 = 3.3.2
41@@ -73,9 +74,17 @@ VX_GNU_VERSION_6.6 = 4.1.2
42 VX_GNU_VERSION_6.7 = 4.1.2
43 VX_GNU_VERSION_6.8 = 4.1.2
44 VX_GNU_VERSION_6.9 = 4.3.3
45-VX_GNU_VERSION = $(VX_GNU_VERSION_$(VXWORKS_VERSION))
46+VX_GNU_VERSION_6 = $(VX_GNU_VERSION_$(VXWORKS_VERSION))
47+VX_GNU_VERSION = $(VX_GNU_VERSION_$(VXWORKS_MAJOR_VERSION))
48
49 VX_GNU_MAJOR_VERSION = $(basename $(basename $(VX_GNU_VERSION)))
50+VX_GNU_MINOR_VERSION = $(basename $(patsubst $(VX_GNU_MAJOR_VERSION).%,%,$(VX_GNU_VERSION)))
51+
52+# gcc version before 3.4 are "old" and need special treatment
53+VX_OLD_GCC_2 = OLD
54+VX_OLD_GCC_3.3 = OLD
55+VX_OLD_GCC_3 = $(VX_OLD_GCC_3.$(VX_GNU_MINOR_VERSION))
56+VX_OLD_GCC = $(VX_OLD_GCC_$(VX_GNU_MAJOR_VERSION))
57
58 #--------------------------------------------------
59 # Fix old Linux WIND_HOST_TYPE
60@@ -85,14 +94,20 @@ endif
61
62 #--------------------------------------------------
63 # vxWorks directory definitions
64-VX_DIR = $(WIND_BASE)/vxworks-$(VXWORKS_VERSION)
65+VX_DIR_5 = $(WIND_BASE)
66+VX_DIR_6 = $(WIND_BASE)/vxworks-$(VXWORKS_VERSION)
67+VX_DIR = $(VX_DIR_$(VXWORKS_MAJOR_VERSION))
68
69-GNU_TARGET_INCLUDE_DIR = $(VX_DIR)/target/h $(VX_DIR)/target/h/wrn/coreip
70+VX_INCLUDE_DIRS_5 = $(VX_DIR)/target/h
71+VX_INCLUDE_DIRS_6 = $(VX_DIR)/target/h $(VX_DIR)/target/h/wrn/coreip
72+GNU_TARGET_INCLUDE_DIR = $(VX_INCLUDE_DIRS_$(VXWORKS_MAJOR_VERSION))
73
74 #--------------------------------------------------
75 # vxWorks GNU directories
76
77-GNU_DIR = $(WIND_BASE)/gnu/$(VX_GNU_VERSION)-vxworks-$(VXWORKS_VERSION)/$(WIND_HOST_TYPE)
78+GNU_DIR_5 = $(WIND_BASE)/host/$(WIND_HOST_TYPE)
79+GNU_DIR_6 = $(WIND_BASE)/gnu/$(VX_GNU_VERSION)-vxworks-$(VXWORKS_VERSION)/$(WIND_HOST_TYPE)
80+GNU_DIR = $(GNU_DIR_$(VXWORKS_MAJOR_VERSION))
81
82 #--------------------------------------------------
83 # This finds nm on any supported VxWorks version
84@@ -133,12 +148,23 @@ OPT_CXXFLAGS_YES = -O2
85 # code flags
86 CODE_CFLAGS =
87 #
88-# For vxWorks versions before 6.3 we need this g++ compiler flag
89-CODE_CXXFLAGS_6.0 = -fno-implicit-templates
90-CODE_CXXFLAGS_6.1 = -fno-implicit-templates
91-CODE_CXXFLAGS_6.2 = -fno-implicit-templates
92-CODE_CXXFLAGS_6 = $(CODE_CXXFLAGS_$(VXWORKS_VERSION))
93-CODE_CXXFLAGS = $(CODE_CXXFLAGS_$(VXWORKS_MAJOR_VERSION))
94+# For gcc versions before 3.4 we need this g++ compiler flag
95+# However WindRiver says gcc 3.3 does not need it any more
96+# which would allow to build vxWorks 6 without this flag.
97+# Maybe we can live without it at the penalty of larger code.
98+# See vxWorks 5 docs/gnu2.96+ppc/gcc.html
99+# chapter 4.5 "Where's the Template?"
100+CODE_CXXFLAGS_OLD = -fno-implicit-templates
101+CODE_CXXFLAGS = $(CODE_CXXFLAGS_$(VX_OLD_GCC))
102+
103+#--------------------------------------------------
104+# Modules we cannot build with old compiler
105+
106+PV_MODULES = pv% normativeTypes
107+SKIP_BUILDS_5 = $(PV_MODULES)
108+SKIP_BUILDS_OLD = $(PV_MODULES)
109+SKIP_BUILDS_6 = $(SKIP_BUILDS_$(VX_OLD_GCC))
110+SKIP_BUILDS = $(SKIP_BUILDS_$(VXWORKS_MAJOR_VERSION))
111
112 #--------------------------------------------------
113 # no shared libs for vxWorks
114diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
115index c60ab95..7ec1fa6 100644
116--- a/documentation/RELEASE_NOTES.html
117+++ b/documentation/RELEASE_NOTES.html
118@@ -18,6 +18,16 @@
119
120 -->
121
122+<h3>Skipping build of modules and re-enabling vxWorks 5</h3>
123+
124+<p>Any module can be skipped during the build for a given architecture by setting
125+the Makfile variable <tt>SKIP_BUILDS</tt> to a list of patterns matching the
126+module directories to skip. For example to skip building any pvAccess related
127+modules set <code>SKIP_BUILDS=pv%&nbsp;normativeTypes</code> in the
128+CONFIG.Common.&lt;arch&gt; file for that architecture.
129+The builds for vxWorks 5 and up to 6.2 do that.
130+</p>
131+
132 <h3>Git Branches Recombined</h3>
133
134 <p>The four separate Git branches <tt>core/master</tt>, <tt>libcom/master</tt>,
135@@ -28,7 +38,6 @@ more than one of these modules. The layout of the source files has not changed
136 at all however, so the source code for libcom, ca and the database are still
137 found separately under the module subdirectory.</p>
138
139-
140 <h1 align="center">EPICS Release 7.0.1.1</h1>
141
142 <h3>Changed SIML failure behavior</h3>
143diff --git a/modules/ca/src/client/Makefile b/modules/ca/src/client/Makefile
144index 6a7f690..8686a8b 100644
145--- a/modules/ca/src/client/Makefile
146+++ b/modules/ca/src/client/Makefile
147@@ -72,6 +72,7 @@ LIBSRCS += comQueSend.cpp
148 LIBSRCS += comBuf.cpp
149 LIBSRCS += hostNameCache.cpp
150 LIBSRCS += msgForMultiplyDefinedPV.cpp
151+LIBSRCS_vxWorks += templateInstances.cpp
152
153 LIBRARY=ca
154
155diff --git a/modules/ca/src/client/templateInstances.cpp b/modules/ca/src/client/templateInstances.cpp
156new file mode 100644
157index 0000000..c7263c5
158--- /dev/null
159+++ b/modules/ca/src/client/templateInstances.cpp
160@@ -0,0 +1,66 @@
161+/*************************************************************************\
162+* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
163+* National Laboratory.
164+* Copyright (c) 2002 The Regents of the University of California, as
165+* Operator of Los Alamos National Laboratory.
166+* EPICS BASE Versions 3.13.7
167+* and higher are distributed subject to a Software License Agreement found
168+* in file LICENSE that is included with this distribution.
169+\*************************************************************************/
170+
171+/*
172+ *
173+ *
174+ * L O S A L A M O S
175+ * Los Alamos National Laboratory
176+ * Los Alamos, New Mexico 87545
177+ *
178+ * Copyright, 1986, The Regents of the University of California.
179+ *
180+ *
181+ * Author Jeffrey O. Hill
182+ * johill@lanl.gov
183+ * 505 665 1831
184+ */
185+
186+#include "cac.h"
187+#include "oldAccess.h"
188+#include "repeaterClient.h"
189+
190+template class chronIntIdResTable < nciu >;
191+template class chronIntIdResTable < baseNMIU >;
192+template class chronIntIdResTable < CASG >;
193+template class resTable < nciu, chronIntId >;
194+template class resTable < baseNMIU, chronIntId >;
195+template class resTable < CASG, chronIntId >;
196+template class resTable < bhe, inetAddrID >;
197+template class resTable < tcpiiu, caServerID >;
198+template class tsFreeList < bhe, 0x100 >;
199+template class tsFreeList < tcpiiu, 32, epicsMutexNOOP >;
200+template class tsFreeList < netReadNotifyIO, 1024, epicsMutexNOOP >;
201+template class tsFreeList < netWriteNotifyIO, 1024, epicsMutexNOOP >;
202+template class tsFreeList < netSubscription, 1024, epicsMutexNOOP >;
203+template class tsFreeList < CASG, 128, epicsMutexNOOP >;
204+template class tsFreeList < syncGroupReadNotify, 128, epicsMutexNOOP >;
205+template class tsFreeList < syncGroupWriteNotify, 128, epicsMutexNOOP >;
206+template class tsFreeList < comBuf, 0x20 >;
207+template class tsFreeList < getCallback, 1024, epicsMutexNOOP >;
208+template class tsFreeList < getCopy, 1024, epicsMutexNOOP >;
209+template class tsFreeList < msgForMultiplyDefinedPV, 16 >;
210+template class tsFreeList < nciu, 1024, epicsMutexNOOP>;
211+template class tsFreeList < oldChannelNotify, 1024, epicsMutexNOOP >;
212+template class tsFreeList < oldSubscription, 1024, epicsMutexNOOP >;
213+template class tsFreeList < putCallback, 1024, epicsMutexNOOP >;
214+template class tsFreeList < repeaterClient, 0x20 >;
215+template class epicsSingleton < localHostName >;
216+template unsigned comBuf :: push ( const double * pValue, unsigned nElem );
217+template unsigned comBuf :: push ( const float * pValue, unsigned nElem );
218+template unsigned comBuf :: push ( const int * pValue, unsigned nElem );
219+template unsigned comBuf :: push ( const short * pValue, unsigned nElem );
220+template comBuf :: popStatus comBuf :: pop ( unsigned int & returnVal );
221+template comBuf :: popStatus comBuf :: pop ( unsigned short & returnVal );
222+template comBuf :: popStatus comBuf :: pop ( unsigned char & returnVal );
223+template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO
224+ (epicsGuard < epicsMutex > &, syncGroupWriteNotify & );
225+template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO
226+ ( epicsGuard < epicsMutex > &, syncGroupReadNotify & );
227diff --git a/modules/database/src/ioc/db/Makefile b/modules/database/src/ioc/db/Makefile
228index c6f3355..d3b2f47 100644
229--- a/modules/database/src/ioc/db/Makefile
230+++ b/modules/database/src/ioc/db/Makefile
231@@ -96,4 +96,5 @@ dbCore_SRCS += chfPlugin.c
232 dbCore_SRCS += dbState.c
233 dbCore_SRCS += dbUnitTest.c
234 dbCore_SRCS += dbServer.c
235+dbCore_SRCS_vxWorks += templateInstances.cpp
236
237diff --git a/modules/database/src/ioc/db/templateInstances.cpp b/modules/database/src/ioc/db/templateInstances.cpp
238new file mode 100644
239index 0000000..2027016
240--- /dev/null
241+++ b/modules/database/src/ioc/db/templateInstances.cpp
242@@ -0,0 +1,9 @@
243+#include "dbCAC.h"
244+#include "dbChannelIO.h"
245+#include "dbPutNotifyBlocker.h"
246+
247+template class tsFreeList < dbSubscriptionIO, 256, epicsMutexNOOP >;
248+template class tsFreeList < dbChannelIO, 256, epicsMutexNOOP >;
249+template class tsFreeList < dbPutNotifyBlocker, 64, epicsMutexNOOP >;
250+template class resTable < dbBaseIO, chronIntId >;
251+template class chronIntIdResTable < dbBaseIO >;
252diff --git a/modules/libcom/test/epicsAtomicTest.cpp b/modules/libcom/test/epicsAtomicTest.cpp
253index fd9fc2e..d9a6c57 100644
254--- a/modules/libcom/test/epicsAtomicTest.cpp
255+++ b/modules/libcom/test/epicsAtomicTest.cpp
256@@ -8,6 +8,8 @@
257 #include "epicsUnitTest.h"
258 #include "testMain.h"
259
260+using namespace epics::atomic;
261+
262 namespace {
263
264 template < class T >
265@@ -52,7 +54,7 @@ static void add ( void *arg )
266 using epics::atomic::increment;
267 TestDataAddSub < T > * const pTestData =
268 reinterpret_cast < TestDataAddSub < T > * > ( arg );
269- add ( pTestData->m_testValue, TestDataAddSub < T > :: delta );
270+ epics::atomic::add ( pTestData->m_testValue, TestDataAddSub < T > :: delta );
271 increment ( pTestData->m_testIterations );
272 }
273

Subscribers

People subscribed via source and target branches