EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1853168] Re: undefined reference to `clock_gettime'
From: Andrew Johnson via Core-talk <[email protected]>
To: [email protected]
Date: Wed, 20 Nov 2019 18:11:22 -0000
I fixed the ability to do MinGW DLL builds back in 2016
(6623cb01125a61ea) before the 3.14.12.6 and 3.15.5 releases, although
apparently some older versions of minGW won't necessarily work. Prior to
those releases our MinGW builds were configured with SHARED_LIBRARIES=NO
and STATIC_BUILD=YES but that commit removed those and since they we
have been doing DLL builds by default, unless you explicitly change the
settings in the CONFIG_SITE.linux-x86.win32-x86-mingw and/or
CONFIG_SITE.linux-x86.windows-x64-mingw files (the linux-x86_64 files
inherit from those).

My version of osiClockTime.obj is not importing clock_gettime for a 7.0
build:

tux% x86_64-w64-mingw32-nm osiClockTime.obj | grep clock_gettime
tux%

However the 3.15 build does:
tux% x86_64-w64-mingw32-nm osiClockTime.obj | grep clock_gettime
                 U clock_gettime

This matches Michael's note about the
78b6312f493bbe02a37cc6f5fdcff38683d51236 commit (which evidently should
have been made on an earlier branch). However my 3.15 builds here still
work fine, so one of my MinGW libraries must be providing that symbol.
It isn't in any of the libraries that are being linked into libCom
though: -static-libgcc -static-libstdc++ -lws2_32 -ladvapi32 -luser32

However it is present in these libraries, neither of which my builds
explicitly link to:

libpthread.a
00000000000000a0 T clock_gettime
libpthread.dll.a
0000000000000000 T clock_gettime
0000000000000000 I __imp_clock_gettime
libwinpthread.a
00000000000000a0 T clock_gettime
libwinpthread.dll.a
0000000000000000 T clock_gettime
0000000000000000 I __imp_clock_gettime

Can we explain what's happening there?

One solution might be to back-port the
78b6312f493bbe02a37cc6f5fdcff38683d51236 commit to 3.15, but that won't
fix builds against older tagged releases. It would seem better to try
and fix this in the ci-scripts module if that's possible.

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1853168

Title:
  undefined reference to `clock_gettime'

Status in EPICS Base:
  New

Bug description:
  I'm getting this linker error when building Base 3.15.6 with mingw:

  /usr/bin/x86_64-w64-mingw32-g++ -o Com.dll -shared -Wl,--out-
  implib,libCom.dll.a
  -L/home/travis/.cache/base-R3.15.6/lib/windows-x64-mingw       -m64
  -static-libgcc -static-libstdc++            asLib.obj asTrapWrite.obj
  bucketLib.obj postfix.obj calcPerform.obj cvtFast.obj resourceLib.obj
  epicsOnce.obj epicsSingletonMutex.obj dbmf.obj ellLib.obj ellSort.obj
  envSubr.obj envData.obj errlog.obj errSymLib.obj errSymTbl.obj
  fdmgr.obj fdManager.obj freeListLib.obj gpHashLib.obj iocsh.obj
  registry.obj libComRegister.obj iocLog.obj logClient.obj macCore.obj
  macEnv.obj macUtil.obj alarmString.obj aToIPAddr.obj adjustment.obj
  cantProceed.obj epicsConvert.obj epicsExit.obj epicsStdlib.obj
  epicsString.obj truncateFile.obj ipAddrToAsciiAsynchronous.obj
  epicsUnitTest.obj epicsThread.obj epicsMutex.obj epicsEvent.obj
  epicsTime.obj epicsMessageQueue.obj epicsMath.obj epicsAtomicOSD.obj
  epicsGeneralTime.obj osiClockTime.obj osdSock.obj osdSockAddrReuse.obj
  osiSock.obj systemCallIntMech.obj epicsSocketConvertErrnoToString.obj
  osdAssert.obj osdFindSymbol.obj osdInterrupt.obj osdPoolStatus.obj
  osdSignal.obj osdEnv.obj epicsReadline.obj epicsTempFile.obj
  epicsStdio.obj osdStdio.obj osdThread.obj osdThreadExtra.obj
  osdThreadHooks.obj osdMutex.obj osdSpin.obj osdEvent.obj osdTime.obj
  osdProcess.obj osdNetIntf.obj osdMessageQueue.obj devLibVME.obj
  devLibVMEOSD.obj epicsStackTrace.obj osdBackTrace.obj osdFindAddr.obj
  poolJob.obj threadPool.obj epicsRingPointer.obj epicsRingBytes.obj
  taskwd.obj epicsTimer.obj timer.obj timerQueue.obj
  timerQueueActive.obj timerQueueActiveMgr.obj timerQueuePassive.obj
  yajl.obj yajl_alloc.obj yajl_buf.obj yajl_encode.obj yajl_gen.obj
  yajl_lex.obj yajl_parser.obj epicsGetopt.obj setThreadName.obj
  forceBadAllocException.obj  Com.coff    -lws2_32 -ladvapi32 -luser32
  -lws2_32

  osiClockTime.obj:osiClockTime.c:(.text+0xb4): undefined reference to
  `clock_gettime'

  osiClockTime.obj:osiClockTime.c:(.text+0x33b): undefined reference to
  `clock_gettime'

  collect2: error: ld returned 1 exit status

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1853168/+subscriptions

References:
[Bug 1853168] [NEW] undefined reference to `clock_gettime' Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 1853168] Re: undefined reference to `clock_gettime' mdavidsaver via Core-talk
Next: [Bug 1853168] Re: undefined reference to `clock_gettime' Ralph Lange via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: [Bug 1853168] Re: undefined reference to `clock_gettime' mdavidsaver via Core-talk
Next: [Bug 1853168] Re: undefined reference to `clock_gettime' Ralph Lange via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 20 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·