boost1.33.0 on IA64 thread problem

I'm working on porting a large project to IA64. Therefore I'd like to
use the boost thread package on IA64 using gcc 3.2.3 (standard compiler
on the SL 3 Linux distribution). There are some problems which I describe
below and at the end of the mail I pose my questions. Thanks for any
comments !
To test I use the following code:
#include

Andreas Unterkircher wrote:
For reference, I used Debian 3.1 (sarge) with g++ 3.3.5 and Boost from CVS shortly before 1.33. <snip>
The patch is supposed to add a -D_REENTRANT to that. Are you constructing this command-line yourself?
<snip>
Sorry, no, I seem to have missed committing the change to gcc-tools.jam. Since I don't normally develop on IA64 this error wasn't obvious to me until now.
On IA32 I can compile and use boost 1.33.0 threads using gcc3.2.3 without using "-DBOOST_HAS_THREADS". Why is this the case ?
You're telling Boost that the compiler has been configured to use thread-safe options (which unfortunately is not true if _REENTRANT is not defined).
Ideally I would like to use the same compiler flags to compile a project using boost on IA32 and IA64.
You can use the options -pthread -D_REENTRANT on both. Ben.

Hello Ben, thank you very much for your response. I tried adding "-D_REENTRANT" and it works fine. Please let me ask some follow up questions for clarification: On IA32/gcc3.2.3 I tried to compile the below test code both with boost_1_32_0 and boost_1_33_0. The compile comand is constructed by the build system of the project I'm porting but I can influence it by an .m4 file. In both cases it works by using just "-pthread" and it also works with "-pthread -D_REENTRANT". What is the difference between these two (if any) ? On IA64/gcc3.2.3 it works only with "-pthread -D_REENTRANT" (having applied your patch). What is the reason for this difference between IA32 and IA64 ? Is it a "bug" ? With a few towards building on IA32 and IA64 using the same Makefile could I just change "-pthread" to "-pthread -D_REENTRANT" and this would produce the same binaries on IA32 as "-pthread" for boost_1_32_0 as well as for boost_1_33_0 ? Thank you very much for your efforts ! Best regards, Andreas On Tue, 8 Nov 2005, Ben Hutchings wrote:

Andreas Unterkircher wrote:
"-pthread" is a gcc-specific option that is meant to support building thread-safe code that may use POSIX threads. On Linux it is generally equivalent to "-lpthread -D_REENTRANT". So on IA32 the addition of "-D_REENTRANT" has no effect.
On IA64 (and S390), the "-pthread" option is only equivalent to "-lpthread", and "-D_REENTRANT" must be specified explicitly to ensure that thread-safe library functions are used. I consider this inconsistency to be a bug in gcc. (However, it could be that the C library is thread-safe by default on these platforms, and that Boost should not be checking for the _REENTRANT macro. I don't know.)
It would. Ben.
participants (2)
-
Andreas Unterkircher
-
Ben Hutchings