X-Recipient: archive-cygwin@delorie.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 <bruno@clisp.org>
To: Dave Korn <dave.korn.cygwin@googlemail.com>, cygwin@cygwin.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 <eblake@redhat.com>
References: <4BBB31C6.7080703@redhat.com> <4BBCBADA.2090504@gmail.com> <4BBCBB14.4080908@redhat.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

