X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Message-ID: <4BBC7BE3.7080409@cwilson.fastmail.fm> Date: Wed, 07 Apr 2010 08:34:43 -0400 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Cygwin Mailing List Subject: Re: weak symbols on Cygwin References: <4BBB31C6 DOT 7080703 AT redhat DOT com> <201004070141 DOT 36284 DOT bruno AT clisp DOT org> <4BBBF5C2 DOT 30102 AT gmail DOT com> <201004071106 DOT 11471 DOT bruno AT clisp DOT org> In-Reply-To: <201004071106.11471.bruno@clisp.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 4/7/2010 5:06 AM, Bruno Haible 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); > > This code breaks in Cygwin 1.7, because the autoconf test determines that gcc > accepts #pragma weak. Not a big problem - I can surround that code with > #ifdef __ELF__ And on cygwin, since the pthread functionality is IN cygwin1.dll, you can never link a cygwin-based DLL or EXE without having the pthread symbols present. So, if you want to support "with threading" vs. "without threading" on cygwin, you have to have a configure time option, instead: #ifdef __ELF__ bool pthread_in_use = (pthread_cancel != NULL); #elif defined(__CYGWIN__) and !defined(NO_THREADS) bool pthread_in_use = true; #else bool pthread_in_use = false; #endif or something. -- Chuck -- 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