Bug 17433 - ld crashes with segmentation fault when linking with libmpir.a
Summary: ld crashes with segmentation fault when linking with libmpir.a
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 21:34 UTC by Daniel R. Grayson
Modified: 2015-08-12 20:27 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel R. Grayson 2014-09-25 21:34:27 UTC
ld crashes with segmentation fault when linking with libmpir.a

To reproduce:

    wget http://mpir.org/mpir-2.6.0.tar.bz2
    tar xjf mpir-2.6.0.tar.bz2
    cd mpir-2.6.0
    ./configure --build=x86_64-pc-cygwin
    make
    ld -u __gmpn_gcdext .libs/libmpir.a

Since gdb doesn't show me any useful information (the stack is destroyed), 
it's hard to tell whether this is a cygwin problem or an ld problem, as it doesn't
happen under Mac OS X or under several flavors of linux.

I reported it to the cygwin mailing list, but no one seems interested in it.

The output from cygcheck -s -v -r is too large to attach here.

The consequence of the bug for us is that Macaulay2 (see http://macaulay2.com/)
will not compile under cygwin.  I think I can make it work by using GMP
instead of MPIR, but I'd prefer "ld" to work.
Comment 1 Daniel R. Grayson 2014-09-25 21:35:25 UTC
PS: I tried it with at least three other versions of binutils, too, with no luck.
Comment 2 Mikael Pettersson 2014-09-27 09:03:48 UTC
Can you build libmpir.a on Cygwin, transfer that to a Linux box, then attempt the link there using a linux->cygwin cross binutils?
Comment 3 Daniel R. Grayson 2015-08-12 20:27:00 UTC
I forgot to thank you for your suggestion long ago.  Meanwhile I've managed to
make further progress on our cygwin build by building the sharable library for
mpir and linking against it.  Thank you!

On Sat, Sep 27, 2014 at 5:03 AM, mikpelinux at gmail dot com
<sourceware-bugzilla@sourceware.org> wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=17433
>
> --- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
> Can you build libmpir.a on Cygwin, transfer that to a Linux box, then attempt
> the link there using a linux->cygwin cross binutils?
>
> --
> You are receiving this mail because:
> You reported the bug.