From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11046 invoked by alias); 6 Feb 2009 13:06:32 -0000 Received: (qmail 11038 invoked by uid 22791); 6 Feb 2009 13:06:31 -0000 X-SWARE-Spam-Status: No, hits=3.1 required=5.0 tests=AWL,BARRACUDA_BRBL,BAYES_40,RCVD_IN_BL_SPAMCOP_NET X-Spam-Check-By: sourceware.org Received: from pioneerwireless.ca (HELO pioneerwireless.ca) (72.172.130.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Feb 2009 13:06:24 +0000 Received: (qmail 24135 invoked by uid 48); 6 Feb 2009 08:06:22 -0500 Received: from 24.139.16.66 ([24.139.16.66]) by webmail.pioneerwireless.ca (Horde MIME library) with HTTP; Fri, 06 Feb 2009 08:06:22 -0500 Message-ID: <20090206080622.86fffqqxcc4ws0k8@webmail.pioneerwireless.ca> Date: Fri, 06 Feb 2009 13:06:00 -0000 From: "John E. Bossom" To: pthreads-win32@sourceware.org Subject: Re: Does static library works ? References: <498C08A3.4030509@st.com> <2148c4de0902060211l38c61302p24fdd29d9d5d35bf@mail.gmail.com> <498C3246.6070700@st.com> In-Reply-To: <498C3246.6070700@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2009/txt/msg00005.txt.bz2 The mechanisms of the pthreads library where originally written to=20=20 take advantage of the Windows DllMain for implicitly=20=20 creating/releasing resources. However, some didn't want to use the DLL... therefore the implicit=20=20 creation/destruction of resources (as well as the implicit invocation=20=20 of TSD optional destructors) must be carried out explicitly by the=20=20 user in the event that they want to use a static library. These=20=20 methods are _np (non portable). I would have expected that the test cases would have been=20=20 conditionally compiled to accommodate the testing of the static=20=20 version of the library... John E. Bossom Quoting Arnaud RICHARD : > I have tried with MinGW. > It doesn't pass either. (but pass in dynamic of course). > So it is not due to something specific to MSVC. > > Looking more closely... I found out than some functions must be called > only when linking statically: > pthread_win32_process_attach_np() > pthread_win32_process_detach_np() > pthread_win32_thread_attach_np() > pthread_win32_thread_detach_np() > > There is some explanations in the file README.NONPORTABLE > > It's the first time ever I see code specific to static linking... > maybe because I'm a newbie on MS platform. > I post this solution for future > > Arnaud > >> Arnaud RICHARD wrote: >> >>> Dear developers, >>> >>> I tried to build my program statically with pthreads.lib. >>> It crash at run-time in "pthread_cond_init()". >>> So I tried to run the tests. >>> First surprise: the test suite only run with DLL, and not with .LIB. >>> I have enhanced the makefile to run the tests in static. >>> Second surprise: most tests fails (but not all). >>> >>> Has anyone tried to do it ? >>> I attached the modified makefile, the target to run is "make clean >>> VC-static" >>> >>> Any feedback welcome, >>> Arnaud >>> >>> PS: I use MSVC2008, and compile "VC-static" >>> >>> >>>