This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: test results on Cygwin


[moving to the cygwin list from bug-gnulib]

On 04/05/2010 03:48 PM, Bruno Haible wrote:
>> Failures on Cygwin 1.7.2
>> ------------------------
>>
>> Starting test_cond .../bin/sh: line 5:  4200 Aborted
>> FAIL: test-cond.exe
>>
>> Starting test_lock .../bin/sh: line 5:  2296 Aborted
>> FAIL: test-lock.exe
>>
>> Starting test_tls .../bin/sh: line 5:  2656 Aborted
>> FAIL: test-tls.exe
> 
> These were all due to the fact that gcc 4.3.x on Cygwin 1.7.2
> accepts "#pragma weak foo", but the symbol foo then evaluates
> to the NULL address, even if foo is defined in libc.

Dave, are weak symbols something that should work on cygwin with new
enough binutils/gcc?  Or is this an indicator of a gcc bug, for silently
accepting #pragma weak foo that it can't support?

> 
> This works around it:
> 
> 
> 2010-04-05  Bruno Haible  <bruno@clisp.org>
> 
> 	Make the multithread modules work on Cygwin 1.7.2.
> 	* m4/threadlib.m4 (gl_THREADLIB_BODY): Improve the test whether
> 	imported symbols can be declared weak, so that it returns "no" on
> 	Cygwin 1.7.2.
> 
> --- m4/threadlib.m4.orig	Mon Apr  5 23:43:16 2010
> +++ m4/threadlib.m4	Mon Apr  5 23:39:40 2010
> @@ -1,4 +1,4 @@
> -# threadlib.m4 serial 4 (gettext-0.18)
> +# threadlib.m4 serial 5 (gettext-0.18)
>  dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
>  dnl This file is free software; the Free Software Foundation
>  dnl gives unlimited permission to copy and/or distribute it,
> @@ -107,11 +107,34 @@
>    LTLIBMULTITHREAD=
>    if test "$gl_use_threads" != no; then
>      dnl Check whether the compiler and linker support weak declarations.
> -    AC_MSG_CHECKING([whether imported symbols can be declared weak])
> -    gl_have_weak=no
> -    AC_TRY_LINK([extern void xyzzy ();
> -#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
> -    AC_MSG_RESULT([$gl_have_weak])
> +    AC_CACHE_CHECK([whether imported symbols can be declared weak],
> +      [gl_cv_have_weak],
> +      [gl_cv_have_weak=no
> +       dnl First, test whether the compiler accepts it syntactically.
> +       AC_TRY_LINK([extern void xyzzy ();
> +#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe])
> +       if test $gl_cv_have_weak = maybe; then
> +         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
> +         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
> +         AC_TRY_RUN([
> +#include <stdio.h>
> +#pragma weak fputs
> +int main ()
> +{
> +  return (fputs == NULL);
> +}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no],
> +           [dnl When cross-compiling, assume that only ELF platforms support
> +            dnl weak symbols.
> +            AC_EGREP_CPP([Extensible Linking Format],
> +              [#ifdef __ELF__
> +               Extensible Linking Format
> +               #endif
> +              ],
> +              [gl_cv_have_weak="guessing yes"],
> +              [gl_cv_have_weak="guessing no"])
> +           ])
> +       fi
> +      ])

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]