X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9xTKL3R4OlBCAU6/lWb5 X-RZG-CLASS-ID: mo00 From: Bruno Haible To: Dave Korn , cygwin AT cygwin DOT com Subject: Re: weak symbols on Cygwin Date: Thu, 8 Apr 2010 01:14:39 +0200 User-Agent: KMail/1.9.9 Cc: Eric Blake References: <4BBB31C6 DOT 7080703 AT redhat DOT com> <4BBCBADA DOT 2090504 AT gmail DOT com> <4BBCBB14 DOT 4080908 AT redhat DOT com> In-Reply-To: <4BBCBB14.4080908@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201004080114.41131.bruno@clisp.org> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Dave Korn wrote: >> I've got some code, written for ELF platforms, that detects whether the >> pthread library (often a separate library from libc) is linked, by doing >> >> #pragma weak pthread_cancel >> bool pthread_in_use = (pthread_cancel != NULL); > > And you really need to determine this dynamically at runtime rather than > statically at configure time? Sure. I want the same library (libintl) to be usable. on Unix, 1) by multithreaded programs, without bugs due to simultaneous access to data by multiple threads, 2) by single-threaded programs, without putting on them the performance price of linking with -lpthread. "#pragma weak pthread_cancel" does exactly that. Bruno -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple