Opened 14 years ago
Closed 10 years ago
#2575 closed Patches (fixed)
Bug- Boost 1.36.0 on Itanium platform
Reported by: | 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
- 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)
Change History (15)
comment:1 by , 14 years ago
Component: | None → thread |
---|---|
Owner: | set to |
comment:2 by , 14 years ago
Owner: | changed from | to
---|
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 , 14 years ago
Owner: | changed from | to
---|
comment:4 by , 11 years ago
Cc: | added |
---|---|
Milestone: | Boost 1.38.0 → To Be Determined |
Owner: | changed from | to
Status: | new → assigned |
comment:5 by , 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 , 11 years ago
Keywords: | interlocked added |
---|
follow-up: 9 comment:7 by , 11 years ago
Type: | Bugs → Support Requests |
---|
Moved to support request until availability clarified.
comment:8 by , 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?
comment:9 by , 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.
comment:10 by , 11 years ago
Type: | Support Requests → Patches |
---|
comment:11 by , 11 years ago
Milestone: | To Be Determined → Boost 1.49.0 |
---|
comment:13 by , 10 years ago
Milestone: | Boost 1.49.0 → Boost 1.50.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed in release branch at [78543]
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)