delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/05/17:57:11

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4BBA5C54.9040702@redhat.com>
Date: Mon, 05 Apr 2010 15:55:32 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: Bruno Haible <bruno AT clisp DOT org>
CC: cygwin <cygwin AT cygwin DOT com>
Subject: Re: test results on Cygwin
References: <201004051747 DOT 40474 DOT bruno AT clisp DOT org> <201004052348 DOT 22022 DOT bruno AT clisp DOT org>
In-Reply-To: <201004052348.22022.bruno@clisp.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig9CF000315B6C6D30DFB7EC94
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[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
>=20
> 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?

>=20
> This works around it:
>=20
>=20
> 2010-04-05  Bruno Haible  <bruno AT clisp DOT org>
>=20
> 	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.
>=20
> --- 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=3D
>    if test "$gl_use_threads" !=3D 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=3Dno
> -    AC_TRY_LINK([extern void xyzzy ();
> -#pragma weak xyzzy], [xyzzy();], [gl_have_weak=3Dyes])
> -    AC_MSG_RESULT([$gl_have_weak])
> +    AC_CACHE_CHECK([whether imported symbols can be declared weak],
> +      [gl_cv_have_weak],
> +      [gl_cv_have_weak=3Dno
> +       dnl First, test whether the compiler accepts it syntactically.
> +       AC_TRY_LINK([extern void xyzzy ();
> +#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=3Dmaybe])
> +       if test $gl_cv_have_weak =3D maybe; then
> +         dnl Second, test whether it actually works. On Cygwin 1.7.2, wi=
th
> +         dnl gcc 4.3, symbols declared weak always evaluate to the addre=
ss 0.
> +         AC_TRY_RUN([
> +#include <stdio.h>
> +#pragma weak fputs
> +int main ()
> +{
> +  return (fputs =3D=3D NULL);
> +}], [gl_cv_have_weak=3Dyes], [gl_cv_have_weak=3Dno],
> +           [dnl When cross-compiling, assume that only ELF platforms sup=
port
> +            dnl weak symbols.
> +            AC_EGREP_CPP([Extensible Linking Format],
> +              [#ifdef __ELF__
> +               Extensible Linking Format
> +               #endif
> +              ],
> +              [gl_cv_have_weak=3D"guessing yes"],
> +              [gl_cv_have_weak=3D"guessing no"])
> +           ])
> +       fi
> +      ])

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


--------------enig9CF000315B6C6D30DFB7EC94
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAku6XFQACgkQ84KuGfSFAYDJDgCgg1VUNJvBu/bzMRk3TvGvZrxv
jHsAnj0ZuWJEXgPjBIHcqCUMLpkBBBZb
=THxX
-----END PGP SIGNATURE-----

--------------enig9CF000315B6C6D30DFB7EC94--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019