diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 366ef973a..8f15fb77c 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,13 @@ +
The increasing intelligence of the GNU compiler and linker broke the method +that was being used by the VxWorks code to register a reboot hook that can close +down TCP connections nicely before the network stack gets disabled. This has +been fixed and no longer uses a C++ static contructor to execute that code.
+An IOC application that sets INSTALL_LOCATION in its configure/CONFIG_SITE diff --git a/src/libCom/osi/os/vxWorks/atReboot.cpp b/src/libCom/osi/os/vxWorks/atReboot.cpp index cb4bff5cc..9a35286ef 100644 --- a/src/libCom/osi/os/vxWorks/atReboot.cpp +++ b/src/libCom/osi/os/vxWorks/atReboot.cpp @@ -1,10 +1,9 @@ /*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* Copyright (c) 2013 UChicago Argonne LLC, 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 +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* atReboot.cpp */ @@ -16,34 +15,28 @@ #include "epicsDynLink.h" #include "epicsExit.h" -/* osdThread references atRebootExtern just to make this module load*/ -int atRebootExtern; +extern "C" { typedef int (*sysAtReboot_t)(void(func)(void)); -class atRebootRegister { -public: - atRebootRegister(); -}; - -atRebootRegister::atRebootRegister() +void atRebootRegister(void) { STATUS status; sysAtReboot_t sysAtReboot; SYM_TYPE type; status = symFindByNameEPICS(sysSymTbl, "_sysAtReboot", - (char **)&sysAtReboot, &type); + (char **)&sysAtReboot, &type); if (status == OK) { status = sysAtReboot(epicsExitCallAtExits); if (status != OK) { printf("atReboot: sysAtReboot returned error %d\n", status); } } else { - printf("BSP routine sysAtReboot() not found, epicsExit() will not be\n" - "called by reboot. For reduced functionality, call\n" - " rebootHookAdd(epicsExitCallAtExits)\n"); + printf("BSP routine sysAtReboot() not found, epicsExit() will not be\n" + "called by reboot. For reduced functionality, call\n" + " rebootHookAdd(epicsExitCallAtExits)\n"); } } -static atRebootRegister atRebootRegisterObj; +} diff --git a/src/libCom/osi/os/vxWorks/osdThread.c b/src/libCom/osi/os/vxWorks/osdThread.c index 69034b794..237347117 100644 --- a/src/libCom/osi/os/vxWorks/osdThread.c +++ b/src/libCom/osi/os/vxWorks/osdThread.c @@ -43,12 +43,8 @@ static const unsigned stackSizeTable[epicsThreadStackBig+1] = {4000*ARCH_STACK_FACTOR, 6000*ARCH_STACK_FACTOR, 11000*ARCH_STACK_FACTOR}; -/*The following forces atReboot to be loaded*/ -extern int atRebootExtern; -static struct pext { - int *pExtern; - struct pext *pext; -} pext = {&atRebootExtern, &pext}; +/* This routine is found in atReboot.cpp */ +extern void atRebootRegister(void); /* definitions for implementation of epicsThreadPrivate */ static void **papTSD = 0; @@ -93,6 +89,7 @@ static void epicsThreadInit(void) epicsThreadOnceMutex = semMCreate( SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY); assert(epicsThreadOnceMutex); + atRebootRegister(); } lock = 0; }