multiply defined symbols with epicsAtomic
Bug #1425197 reported by
mdavidsaver
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
EPICS Base | ||||||
3.15 |
Fix Released
|
High
|
mdavidsaver |
Bug Description
Do to inconsistency between C and C++ (and between C89 and C99), usage of the 'inline' qualifier by epicsAtomic* functions results in multiple definitions and linker failure.
The specific case is with GCC using -std=c99 or -std=gnu99 (the present default). With this configuration a strong public symbol (nm says 'T') is included in every C compilation unit where "epicsAtomic.h" is included. Linking then fails if more than once C compilation unit does this.
At present only callback.c in libdbCore includes epicsAtomic.h, so there is no failure. However, this bug is preventing further use of epicsAtomic.
Related branches
lp://qastaging/~epics-core/epics-base/fixatomiclinkage
- Andrew Johnson: Approve
- mdavidsaver: Approve
- Ralph Lange: Pending requested
-
Diff: 1216 lines (+479/-197)26 files modifiedsrc/libCom/osi/compiler/clang/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/clang/epicsAtomicCD.h (+1/-9)
src/libCom/osi/compiler/default/compilerSpecific.h (+8/-0)
src/libCom/osi/compiler/default/epicsAtomicCD.h (+3/-10)
src/libCom/osi/compiler/gcc/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/gcc/epicsAtomicCD.h (+5/-5)
src/libCom/osi/compiler/msvc/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/msvc/epicsAtomicCD.h (+8/-14)
src/libCom/osi/compiler/solStudio/compilerSpecific.h (+44/-0)
src/libCom/osi/compiler/solStudio/epicsAtomicCD.h (+1/-9)
src/libCom/osi/epicsAtomic.h (+41/-60)
src/libCom/osi/os/RTEMS/epicsAtomicOSD.h (+65/-0)
src/libCom/osi/os/WIN32/epicsAtomicOSD.cpp (+0/-22)
src/libCom/osi/os/WIN32/epicsAtomicOSD.h (+2/-0)
src/libCom/osi/os/posix/epicsAtomicOSD.cpp (+11/-36)
src/libCom/osi/os/posix/epicsAtomicOSD.h (+19/-0)
src/libCom/osi/os/solaris/epicsAtomicOSD.h (+11/-7)
src/libCom/osi/os/vxWorks/epicsAtomicOSD.cpp (+0/-21)
src/libCom/osi/os/vxWorks/epicsAtomicOSD.h (+8/-4)
src/libCom/test/Makefile (+8/-0)
src/libCom/test/epicsAtomicTest.cpp (+78/-0)
src/libCom/test/epicsInlineTest1.c (+64/-0)
src/libCom/test/epicsInlineTest2.c (+28/-0)
src/libCom/test/epicsInlineTest3.cpp (+27/-0)
src/libCom/test/epicsInlineTest4.cpp (+27/-0)
src/libCom/test/epicsRunLibComTests.c (+2/-0)
Superseded
for merging
into
lp://qastaging/~epics-core/epics-base/3.16
- Andrew Johnson: Approve
- Ralph Lange: Approve
- mdavidsaver: Approve
-
Diff: 1249 lines (+484/-201)27 files modifiedconfigure/RULES_BUILD (+5/-4)
src/libCom/osi/compiler/clang/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/clang/epicsAtomicCD.h (+1/-9)
src/libCom/osi/compiler/default/compilerSpecific.h (+8/-0)
src/libCom/osi/compiler/default/epicsAtomicCD.h (+3/-10)
src/libCom/osi/compiler/gcc/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/gcc/epicsAtomicCD.h (+5/-5)
src/libCom/osi/compiler/msvc/compilerSpecific.h (+6/-0)
src/libCom/osi/compiler/msvc/epicsAtomicCD.h (+8/-14)
src/libCom/osi/compiler/solStudio/compilerSpecific.h (+44/-0)
src/libCom/osi/compiler/solStudio/epicsAtomicCD.h (+1/-9)
src/libCom/osi/epicsAtomic.h (+41/-60)
src/libCom/osi/os/RTEMS/epicsAtomicOSD.h (+65/-0)
src/libCom/osi/os/WIN32/epicsAtomicOSD.cpp (+0/-22)
src/libCom/osi/os/WIN32/epicsAtomicOSD.h (+2/-0)
src/libCom/osi/os/posix/epicsAtomicOSD.cpp (+11/-36)
src/libCom/osi/os/posix/epicsAtomicOSD.h (+19/-0)
src/libCom/osi/os/solaris/epicsAtomicOSD.h (+11/-7)
src/libCom/osi/os/vxWorks/epicsAtomicOSD.cpp (+0/-21)
src/libCom/osi/os/vxWorks/epicsAtomicOSD.h (+8/-4)
src/libCom/test/Makefile (+8/-0)
src/libCom/test/epicsAtomicTest.cpp (+78/-0)
src/libCom/test/epicsInlineTest1.c (+64/-0)
src/libCom/test/epicsInlineTest2.c (+28/-0)
src/libCom/test/epicsInlineTest3.cpp (+27/-0)
src/libCom/test/epicsInlineTest4.cpp (+27/-0)
src/libCom/test/epicsRunLibComTests.c (+2/-0)
no longer affects: | epics-base/3.16 |
no longer affects: | epics-base |
To post a comment you must log in.
Proposed fix with lp:~epics-core/epics-base/fixatomiclinkage