From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7350 invoked by alias); 29 Mar 2006 21:35:12 -0000 Received: (qmail 7342 invoked by uid 22791); 29 Mar 2006 21:35:12 -0000 X-Spam-Check-By: sourceware.org Received: from extavgw4.ball.com (HELO extavgw4.ball.com) (162.18.103.211) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Mar 2006 21:35:11 +0000 Received: from AEROMSG2.AERO.BALL.COM (Not Verified[162.18.82.156]) by extavgw4.ball.com with NetIQ MailMarshal 6.0 Service Pack 1a (v6,0,3,33) id ; Wed, 29 Mar 2006 14:36:33 -0700 Received: from daytonmsg2k3.AERO.BALL.COM ([162.18.199.42]) by AEROMSG2.AERO.BALL.COM with Microsoft SMTPSVC(6.0.3790.0); Wed, 29 Mar 2006 14:35:09 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Win64 support Date: Wed, 29 Mar 2006 21:35:00 -0000 Message-ID: From: "Streithorst, Kip" To: X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2006/txt/msg00011.txt.bz2 I am trying to compile the pthreads library under Visual Studio 2005 with W= in64 support.=A0 I able to compile the library fine using "nmake clean VC",= I'm using the Win64 command-line prompt provided with Visual Studio 2005.= =A0 My problem is I ran the tests to verify the compiled binaries functiona= lity.=A0 The problem is that the mutex1 test fails with the following messa= ge: =A0 Assertion failed: (pthread_mutex_destroy(&mutex) =3D=3D 0), file mutex1.c, = line 63 =A0 I researched this problem further and the problem is actually in pthread_mu= tex_trylock.c in the following section of code: =A0 =A0 if (0 =3D=3D (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0= =A0=A0=A0 (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0= =A0=A0=A0 (PTW32_INTERLOCKED_LONG) 1, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0= =A0=A0=A0 (PTW32_INTERLOCKED_LONG) 0)) =A0=A0=A0 { =A0 The problem is that it appears during pthread dll start-up, it is trying to= locate the InterlockedCompareExchange windows api function call in kernel3= 2.=A0 However, if you look at the current MSDN documentation on said functi= on, for the Win64 platform this function is no longer being exported from k= ernel32.=A0 Instead they have turned InterlockedCompareExchange into an int= rinsic function by the name of _InterlockedCompareExchange.=A0 Temporarily,= I changed implements.h from =A0 #ifndef PTW32_INTERLOCKED_COMPARE_EXCHANGE #define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_interlocked_compare_exchan= ge #endif =A0 to =A0 #ifndef PTW32_INTERLOCKED_COMPARE_EXCHANGE #ifdef _WIN64 #define PTW32_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange #else #define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_interlocked_compare_exchan= ge #endif =A0 and this appears to get most of the tests to run.=A0 There is a subsequent = problem later in context1.c as shown below: =A0 cl /D__CLEANUP_C /O2 /Ob0 /W3 /MD /nologo /Yd /Zi -I. context1.c /Fecontext= 1.exe =A0/link /INCREMENTAL:NO pthreadVC2.lib ws2_32.lib cl : Command line warning D9035 : option 'Yd' has been deprecated and will = be re moved in a future release context1.c context1.c(128) : error C2039: 'Eip' : is not a member of '_CONTEXT' =A0=A0=A0=A0=A0=A0=A0 C:\Program Files (x86)\Microsoft Visual Studio 8\VC\P= latformSDK\include\ winnt.h(2368) : see declaration of '_CONTEXT' =A0 and this appears to be with the fact the _CONTEXT is based upon the process= or and so in Win64 mode this no longer works, not really sure how to fix. =A0 In summary,=20 Has anyone looked seriously at Win64 support for the pthreads library?=A0 A= nd is anyone interested in getting it working, besides myself? =A0 I suspect there may be larger problems as well, because I know if you use /= Wp64 flag to warning about possible 64-bit problems some additional warning= s come up that may need to be dealt with.=A0 In addition they now provide a= n InterlockedCompareExchange64 that works on LONGLONG instead LONG and we m= ay need to be using that instead. =A0 Thanks, Kip Streithorst