Failing 'make check' for non-Cygwin GMP-ECM package

Mark Geisert
Mon Feb 8 07:59:00 GMT 2016

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 

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


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list