ACE_Atomic_OP export issue

Bug #1249669 reported by Daniel Stefan Reichenbach
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ace (Ubuntu)
Fix Released
Undecided
Pau Garcia Quiles

Bug Description

There seems to be an issue with linking applications built with clang against ACE.

I do use ace/Atomic_Op.h and have a private variable in a class like

ACE_Atomic_Op <ACE_Thread_Mutex, long> m_refs;

This will throw an error like

../../lib/libmangos-shared.a(Threading.cpp.o): In function `ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator=(long)':
/usr/include/ace/Atomic_Op.inl:168: undefined reference to `ACE_Atomic_Op<ACE_Thread_Mutex, long>::exchange_fn_'

In Ubuntu 12.04 LTS using ACE 6.0.1 this was working fine. I could not find any entries in the ACE Changelogs for version 6.0.3 relating to this.

Description: Ubuntu 13.10
Release: 13.10

libace-6.0.3:
  Installed: 6.0.3+dfsg-0.1
  Candidate: 6.0.3+dfsg-0.1
  Version table:
 *** 6.0.3+dfsg-0.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages
        100 /var/lib/dpkg/status

libace-dev:
  Installed: 6.0.3+dfsg-0.1
  Candidate: 6.0.3+dfsg-0.1
  Version table:
 *** 6.0.3+dfsg-0.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages
        100 /var/lib/dpkg/status

description: updated
description: updated
Revision history for this message
Pau Garcia Quiles (pgquiles) wrote :

Are you still suffering from this issue with the latest version of ACE?

Changed in ace (Ubuntu):
assignee: nobody → Pau Garcia i Quiles (pgquiles)
Revision history for this message
Daniel Stefan Reichenbach (marenkay) wrote :

I just found the solution to the issue two days ago.

Changing the code to

ACE_Atomic_Op<ACE_Thread_Mutex, int> m_refs;

solves the issue and works fine, thus the issue can be closed.

Changed in ace (Ubuntu):
status: New → Invalid
Revision history for this message
yehonal (hw-2) wrote :

I've this issue too, but i'm forced to use long instead int.

however it happens only with clang , gcc compiles.

Could someone help me to make this work?

stack overflow post: http://stackoverflow.com/questions/38953849/libace-and-clang-clang-undefined-reference-to-ace-atomic-opace-thread-mutex?noredirect=1&lq=1

Revision history for this message
yehonal (hw-2) wrote :

i'm using ubuntu 16.06 , clang++ 3.8 and libace 6.3.3

Changed in ace (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Johnny Willemsen (jwillemsen) wrote :
Revision history for this message
Johnny Willemsen (jwillemsen) wrote :

Fixed in ACE 6.4.3

Changed in ace (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.