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: Failing 'make check' for non-Cygwin GMP-ECM package -- workaround


Mark Geisert wrote:
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've worked around the first "bug" by rebasing the Cygwin gmp DLLs. It seems those R_X86_64_PC32 relocation markers I had thought problematic are ubiquitous and work without issue the vast majority of the time. They are used to relocate addresses up to 2GB above or below the site of the relocation. It's not working here but I can't see what's so special about this case. The relocation sites are in a static library FWIW. But in any case, on my system the original DLLs were located here:

/usr/bin/cyggmpxx-4.dll                   base 0x0003fcee0000 size 0x0000e000
/usr/bin/cyggmp-10.dll                    base 0x0003fcef0000 size 0x0008c000

and I rebased them to here:

/usr/bin/cyggmpxx-4.dll                   base 0x0000fcee0000 size 0x0000e000
/usr/bin/cyggmp-10.dll                    base 0x0000fcef0000 size 0x0008c000

and that did the trick.  I'll take the second bug to the developers list.
Cheers,

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


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