From 7738b68320638eedae0920b4a0d1f51aec4bf8d2 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Mon, 24 Sep 2018 18:00:53 +0200 Subject: [PATCH] fix missing template instances for old vxWorks (uses -fno-implicit-templates) --- configure/os/CONFIG.Common.vxWorksCommon | 5 ++ modules/ca/src/client/Makefile | 1 + modules/ca/src/client/templateInstances.cpp | 66 +++++++++++++++++++ modules/database/src/ioc/db/Makefile | 1 + .../database/src/ioc/db/templateInstances.cpp | 9 +++ 5 files changed, 82 insertions(+) create mode 100644 modules/ca/src/client/templateInstances.cpp create mode 100644 modules/database/src/ioc/db/templateInstances.cpp diff --git a/configure/os/CONFIG.Common.vxWorksCommon b/configure/os/CONFIG.Common.vxWorksCommon index 2a1365697..8b950cf6c 100644 --- a/configure/os/CONFIG.Common.vxWorksCommon +++ b/configure/os/CONFIG.Common.vxWorksCommon @@ -149,6 +149,11 @@ OPT_CXXFLAGS_YES = -O2 CODE_CFLAGS = # # For gcc versions before 3.4 we need this g++ compiler flag +# However WindRiver says gcc 3.3 does not need it any more +# which would allow to build vxWorks 6 without this flag. +# Maybe we can live without it at the penalty of larger code. +# See vxWorks 5 docs/gnu2.96+ppc/gcc.html +# chapter 4.5 "Where's the Template?" CODE_CXXFLAGS_OLD = -fno-implicit-templates CODE_CXXFLAGS = $(CODE_CXXFLAGS_$(VX_OLD_GCC)) diff --git a/modules/ca/src/client/Makefile b/modules/ca/src/client/Makefile index 6a7f690e9..8686a8bb0 100644 --- a/modules/ca/src/client/Makefile +++ b/modules/ca/src/client/Makefile @@ -72,6 +72,7 @@ LIBSRCS += comQueSend.cpp LIBSRCS += comBuf.cpp LIBSRCS += hostNameCache.cpp LIBSRCS += msgForMultiplyDefinedPV.cpp +LIBSRCS_vxWorks += templateInstances.cpp LIBRARY=ca diff --git a/modules/ca/src/client/templateInstances.cpp b/modules/ca/src/client/templateInstances.cpp new file mode 100644 index 000000000..c7263c5a0 --- /dev/null +++ b/modules/ca/src/client/templateInstances.cpp @@ -0,0 +1,66 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * + * + * L O S A L A M O S + * Los Alamos National Laboratory + * Los Alamos, New Mexico 87545 + * + * Copyright, 1986, The Regents of the University of California. + * + * + * Author Jeffrey O. Hill + * johill@lanl.gov + * 505 665 1831 + */ + +#include "cac.h" +#include "oldAccess.h" +#include "repeaterClient.h" + +template class chronIntIdResTable < nciu >; +template class chronIntIdResTable < baseNMIU >; +template class chronIntIdResTable < CASG >; +template class resTable < nciu, chronIntId >; +template class resTable < baseNMIU, chronIntId >; +template class resTable < CASG, chronIntId >; +template class resTable < bhe, inetAddrID >; +template class resTable < tcpiiu, caServerID >; +template class tsFreeList < bhe, 0x100 >; +template class tsFreeList < tcpiiu, 32, epicsMutexNOOP >; +template class tsFreeList < netReadNotifyIO, 1024, epicsMutexNOOP >; +template class tsFreeList < netWriteNotifyIO, 1024, epicsMutexNOOP >; +template class tsFreeList < netSubscription, 1024, epicsMutexNOOP >; +template class tsFreeList < CASG, 128, epicsMutexNOOP >; +template class tsFreeList < syncGroupReadNotify, 128, epicsMutexNOOP >; +template class tsFreeList < syncGroupWriteNotify, 128, epicsMutexNOOP >; +template class tsFreeList < comBuf, 0x20 >; +template class tsFreeList < getCallback, 1024, epicsMutexNOOP >; +template class tsFreeList < getCopy, 1024, epicsMutexNOOP >; +template class tsFreeList < msgForMultiplyDefinedPV, 16 >; +template class tsFreeList < nciu, 1024, epicsMutexNOOP>; +template class tsFreeList < oldChannelNotify, 1024, epicsMutexNOOP >; +template class tsFreeList < oldSubscription, 1024, epicsMutexNOOP >; +template class tsFreeList < putCallback, 1024, epicsMutexNOOP >; +template class tsFreeList < repeaterClient, 0x20 >; +template class epicsSingleton < localHostName >; +template unsigned comBuf :: push ( const double * pValue, unsigned nElem ); +template unsigned comBuf :: push ( const float * pValue, unsigned nElem ); +template unsigned comBuf :: push ( const int * pValue, unsigned nElem ); +template unsigned comBuf :: push ( const short * pValue, unsigned nElem ); +template comBuf :: popStatus comBuf :: pop ( unsigned int & returnVal ); +template comBuf :: popStatus comBuf :: pop ( unsigned short & returnVal ); +template comBuf :: popStatus comBuf :: pop ( unsigned char & returnVal ); +template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO + (epicsGuard < epicsMutex > &, syncGroupWriteNotify & ); +template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO + ( epicsGuard < epicsMutex > &, syncGroupReadNotify & ); diff --git a/modules/database/src/ioc/db/Makefile b/modules/database/src/ioc/db/Makefile index d28119ff7..53fe31ebc 100644 --- a/modules/database/src/ioc/db/Makefile +++ b/modules/database/src/ioc/db/Makefile @@ -98,4 +98,5 @@ dbCore_SRCS += chfPlugin.c dbCore_SRCS += dbState.c dbCore_SRCS += dbUnitTest.c dbCore_SRCS += dbServer.c +dbCore_SRCS_vxWorks += templateInstances.cpp diff --git a/modules/database/src/ioc/db/templateInstances.cpp b/modules/database/src/ioc/db/templateInstances.cpp new file mode 100644 index 000000000..2027016fd --- /dev/null +++ b/modules/database/src/ioc/db/templateInstances.cpp @@ -0,0 +1,9 @@ +#include "dbCAC.h" +#include "dbChannelIO.h" +#include "dbPutNotifyBlocker.h" + +template class tsFreeList < dbSubscriptionIO, 256, epicsMutexNOOP >; +template class tsFreeList < dbChannelIO, 256, epicsMutexNOOP >; +template class tsFreeList < dbPutNotifyBlocker, 64, epicsMutexNOOP >; +template class resTable < dbBaseIO, chronIntId >; +template class chronIntIdResTable < dbBaseIO >;