Opened 14 years ago

Closed 10 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@… 11 years ago.
itanium patch
2575.patch (910 bytes ) - added by viboes 11 years ago.
patch respect to trunk

Download all attachments as: .zip

Change History (15)

comment:1 by Marshall Clow, 14 years ago

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 by John Maddock, 14 years ago

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 by Marshall Clow, 14 years ago

Owner: changed from Marshall Clow to Anthony Williams

comment:4 by viboes, 11 years ago

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

comment:5 by viboes, 11 years ago

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 by viboes, 11 years ago

Keywords: interlocked added

comment:7 by viboes, 11 years ago

Type: BugsSupport Requests

Moved to support request until availability clarified.

by asonawane@…, 11 years ago

Attachment: thread_primitives.hpp added

itanium patch

comment:8 by anonymous, 11 years ago

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?

in reply to:  7 comment:9 by anonymous, 11 years ago

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.

by viboes, 11 years ago

Attachment: 2575.patch added

patch respect to trunk

comment:10 by viboes, 11 years ago

Type: Support RequestsPatches

comment:11 by viboes, 11 years ago

Milestone: To Be DeterminedBoost 1.49.0

comment:12 by viboes, 11 years ago

Committed in trunk at revision [76543].

comment:13 by viboes, 10 years ago

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

Committed in release branch at [78543]

Note: See TracTickets for help on using tickets.