public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin@cygwin.com
Subject: Re: Failing 'make check' for non-Cygwin GMP-ECM package
Date: Mon, 08 Feb 2016 07:59:00 -0000	[thread overview]
Message-ID: <56B84AEC.4020405@maxrnd.com> (raw)
In-Reply-To: <56B7D8FA.1040501@maxrnd.com>

Mark Geisert wrote:
> Achim Gratz wrote:
>> Mark Geisert writes:
>>> I'm seeing an odd issue after building the GMP-ECM 6.4.4 package from
>>> Inria.  I downloaded the .tar.gz file and unpacked, ran configure,
>>> then make and 'make check'.  I get a SIGSEGV from a test using ecm.exe
>>> as part of 'make check'.
>>
>> It seems that this release is three years old.  Did you try autoreconf
>> or just configure?  If the latter, it may simply not recognize the
>> current Cygwin correctly in its configury.
>
> Thanks for the idea but trying it didn't change the symptoms.  With more
> debugging this seems to me like some kind of dynamic relocation issue so I'm
> looking further in that direction within the Cygwin DLL.

Replying to myself...  Yes, there appear to be two separate bugs colluding to 
break things the way I'm seeing.  First, the application's object file has 
R_X86_64_PC32 relocation markers for functions it wants to pull in from 
cyggmp-10.dll.  These relocation entries apparently allow for only 4 bytes of 
address.

Second, the relocation that actually needs doing in this testcase results in 
addresses above 4GB, so they need more than 4 bytes to be stored.  There is code 
in Cygwin's pseudo-reloc.cc to check for this situation but it is being skipped 
because __OPTIMIZE__ has been #define'd somewhere by the procedure that builds 
Cygwin.  Instead, the relocated address gets truncated before being written back 
to memory, rather than provoking the error report "Invalid relocation. [...] 
doesn't fit into 32 bits".

I don't know if the first bug could be caused by improper compiler options or 
whatnot.  Here's the gcc invocation for that one object file:

/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./x86_64 
   -pipe -g -O2 -march=haswell -MT libecm_la-mpmod.lo -MD -MP -MF 
deps/libecm_la-mpmod.Tpo -c -o libecm_la-mpmod.lo `test -f 'mpmod.c' || echo 
'./'`mpmod.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./x86_64 -pipe -g -O2 
-march=haswell -MT libecm_la-mpmod.lo -MD -MP -MF .deps/libecm_la-mpmod.Tpo -c 
mpmod.c -o libecm_la-mpmod.o

Configure does know it's building for x86_64.  I am up to date on binutils and 
this is on Cygwin 2.4.1, Win7 64-bit.

..mark

--
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

  reply	other threads:[~2016-02-08  7:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06  9:32 Mark Geisert
2016-02-06 10:05 ` Achim Gratz
2016-02-07 23:53   ` Mark Geisert
2016-02-08  7:59     ` Mark Geisert [this message]
2016-02-10 19:32       ` Failing 'make check' for non-Cygwin GMP-ECM package -- workaround Mark Geisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B84AEC.4020405@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).