Merge lp://staging/~epics-core/epics-base/fixatomiclinkage into lp://staging/~epics-core/epics-base/3.16

Proposed by mdavidsaver
Status: Superseded
Proposed branch: lp://staging/~epics-core/epics-base/fixatomiclinkage
Merge into: lp://staging/~epics-core/epics-base/3.16
Diff against target: 1249 lines (+484/-201)
27 files modified
configure/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)
To merge this branch: bzr merge lp://staging/~epics-core/epics-base/fixatomiclinkage
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Ralph Lange Approve
mdavidsaver Approve
Review via email: mp+250813@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2015-02-27.

Description of the change

To address lp:1425197 switch epicsAtomic functions to 'static inline', which should be consistent accross language and compiler.

Add EPICS_ALWAYS_INLINE macro to help with short wrappers like these.

Add an ISR safe defintion for epicsAtomicLock() for RTEMS.

Extend epicsAtomicTest to print some information about the conditionals effecting epicsAtomicCD and OSD

Add epicsInlineTest to check consistency of 'static inline'.

Also fix some empty argument lists.

To post a comment you must log in.
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I think this is complete. However, I can only test with GCC on Linux and RTEMS.

review: Approve
Revision history for this message
Ralph Lange (ralph-lange) wrote :

From looking at the code and running the test: yep.

I am even more restricted than Michael in testing envs, though.

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

I thought you talked about wanting to fix this in 3.15, but this is branched off 3.16.
Tested on RHEL6.6, built OK for VxWorks but not tested yet.

My solaris-sparc build printed this and died:

"../../../src/libCom/osi/compiler/solStudio/compilerSpecific.h", line 20: Error: #error Not Solaris Studio.

I'll investigate further tomorrow (and run tests on VxWorks, Darwin and Windows), I have this afternoon off.

review: Needs Fixing
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

> I thought you talked about wanting to fix this in 3.15, but this is branched off 3.16.

I do want to target 3.15. If it works with the necessary vxWorks versions (5.5?) then I'll switch to the 3.15 branch.

> Error: #error Not Solaris Studio.

This was all sight unseen, so clearly __SUNPRO_C isn't the correct macro name.

> I have this afternoon off.

Talk to you tomorrow then.

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

The C++ compiler defines __SUNPRO_CC instead, the C builds were working fine. I committed a fix, assuming that C++ compiler has the same version restrictions on __attribute__((always_inline)).

Built and tested (libCom/test only) on VxWorks 6.9 and 5.5.2, OK.

Build on Windows-x64 failed at epicsAtomicTest.cpp due to a typo in testClassify(), now fixed but it does now output "# OS dependent impl name undefined" which you might want to look at.

I also ran a few tests from a cross-built MinGW with no issues; this correctly outputs "# OS dependent impl name WIN32"

I think you could move this to the 3.15 branch instead of 3.16.

review: Approve
12632. By mdavidsaver

add EPICS_ALWAYS_INLINE

12633. By mdavidsaver

libCom/test: Add epicsInlineTest

12634. By mdavidsaver

epicsAtomic: fix C linkage

With gcc -std=gnu99 (present default) functions qualified
with plain 'inline' emit strong public symbols (nm says 'T')
in every compilation unit the definition appears.
This causes linking to fail in all cases where executable
are statically linked, and many where dynamic linking is used.

12635. By mdavidsaver

epicsAtomicTest: include some information about build conditions

Give some idea which implementations are being used

12636. By mdavidsaver

epicsAtomic: RTEMS ISR safe impl. for epicsAtomicLock()

12637. By mdavidsaver

Fix for Solaris C++ compiler

12638. By mdavidsaver

Fix typo in epicsAtomicTest.cpp testClassify()

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches