Modify

Opened 9 years ago

Closed 5 years ago

#2575 closed Patches (fixed)

Bug- Boost 1.36.0 on Itanium platform

Reported by: asonawane@… Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost 1.36.0 Severity: Problem
Keywords: interlocked Cc: viboes

Description

Environment: WinXP SP2/Visual Studio Team System 2005/Itanium cross compiler tools

1 . Generate boost libs using Itanium cross compiler command prompt with these options bjam -a --build-type=complete --toolset=msvc >architecture=ia64 --stagedir=Winia64 stage

  1. Compiling under Itanium configuration in VS2005 generates several linker errors:

error LNK2019: unresolved external symbol ._interlockedbittestandset referenced in function "[Entry] bool cdecl >boost::detail::win32::interlocked_bit_test_and_set(long *,long)" (.?interlocked_bit_test_and_set@win32@detail@boost@@YA_NPEAJJ@Z)

error LNK2001: unresolved external symbol ._interlockedbittestandset

libboost_thread-vc80-mt-1_36.lib(thread.obj) : error LNK2001: unresolved external symbol ._interlockedbittestandset

3.The projects compile fine under x86 and x64. _interlockbittestandset is not intrinsic on Itanium platform

This sounds like an issue with Boost code itself. Your might want to either post to boost-devel, or file a bug at svn.boost.org

  • Volodya

Attachments (2)

thread_primitives.hpp (13.2 KB) - added by asonawane@… 6 years ago.
itanium patch
2575.patch (910 bytes) - added by viboes 6 years ago.
patch respect to trunk

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by Marshall Clow

Component: Nonethread
Owner: set to John Maddock

John - can you take a look at this, since you've got the compiler?

The calls (and fns) are: boost/thread/win32/basic_timed_mutex.hpp: return !win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit); boost/thread/win32/basic_timed_mutex.hpp: if(!win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit)) boost/thread/win32/basic_timed_mutex.hpp: if(!win32::interlocked_bit_test_and_set(&active_count,event_set_flag_bit))

boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit) boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit) boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit)

comment:2 Changed 9 years ago by John Maddock

Owner: changed from John Maddock to Marshall Clow

I don't have access to the itanium compiler but looking at the docs and the headers:

  • _interlockedbittestandset is a compiler intrinsic *only* available on x86 and x86_64 architechtures, it should *not* be used on any other architechture.
  • I can't see a similar IA64 intrinsic (but could easily have missed it).
  • The function:

BOOLEAN WINAPI InterlockedBitTestAndSet?(

in LONG volatile *Base, in LONG Bit

);

Appears to be universally available and offers the same functionality (in fact it just calls _interlockedbittestandset on x86 platforms).

HTH, John.

comment:3 Changed 9 years ago by Marshall Clow

Owner: changed from Marshall Clow to Anthony Williams

comment:4 Changed 6 years ago by viboes

Cc: viboes added
Milestone: Boost 1.38.0To Be Determined
Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:5 Changed 6 years ago by viboes

After making the suggested replacement, I get this error when linking

msvc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\msvc-10.0\debug\threading-multi\test_thread.exe
test_thread.obj : error LNK2019: unresolved external symbol _InterlockedBitTestAndSet referenced in function "bool __cdecl boost::detail::win32::interlocked_bit_test_and_set(long *,long)" (?interlocked_bit_test_and_set@win32@detail@boost@@YA_NPAJJ@Z)
..\..\..\bin.v2\libs\thread\test\test_thread.test\msvc-10.0\debug\threading-multi\test_thread.exe : fatal error LNK1120: 1 unresolved externals

From which version is this primitive available?

comment:6 Changed 6 years ago by viboes

Keywords: interlocked added

comment:7 Changed 6 years ago by viboes

Type: BugsSupport Requests

Moved to support request until availability clarified.

Changed 6 years ago by asonawane@…

Attachment: thread_primitives.hpp added

itanium patch

comment:8 Changed 6 years ago by anonymous

I think it's been available on almost all Win32 versions since forever, a trivial program with just:

#include <windows.h>
int main()
{
   LONG i = 132;

   InterlockedBitTestAndSet(&i, 1);
}

compiles and links just fine for me on Vista with VC10.

Are you including windows.h or defining the prototype for InterlockedBitTestAndSet? yourself?

comment:9 in reply to:  7 Changed 6 years ago by anonymous

Replying to viboes:

Moved to support request until availability clarified.

Use the attached update (thread_primitives.hpp) replace and compile. Works with boost version 1.39.0 and MS-VS 2005. Later versions of boost not tested.

Changed 6 years ago by viboes

Attachment: 2575.patch added

patch respect to trunk

comment:10 Changed 6 years ago by viboes

Type: Support RequestsPatches

comment:11 Changed 6 years ago by viboes

Milestone: To Be DeterminedBoost 1.49.0

comment:12 Changed 6 years ago by viboes

Committed in trunk at revision [76543].

comment:13 Changed 5 years ago by viboes

Milestone: Boost 1.49.0Boost 1.50.0
Resolution: fixed
Status: assignedclosed

Committed in release branch at [78543]

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.