GMP on x86_64 Interix

Jerker Bäck jerker.back at telia.com
Wed Oct 24 20:00:29 CEST 2007


Hello Michael,
Thanks for answering

To pass configure I changed the command
$CCAS $CFLAGS $CPPFLAGS conftest.s  to
$CCAS $ASMFLAGS conftest.s
and tried different tools as CCAS (e.g. yasm). The problem is that some of
the commands also rely on a working 64bit GNU nm (OK I got an x64 variant I
think is ok) and CC. Eventually I gave up. When I know the right settings
for cc and yasm, I could change the configure templates, run autoreconf and
try again.
A fake solution would maybe be to cache known values for assembler settings
in configure.

Second solution: PGI compiler 7.06 for SUA 64bit.
This compiler is not entirely stable yet, especially not with configuration
scripts. It managed to pass configure though. PGI ar does not understand -cq
so I changed it to -cr. I'm not sure, but I think the compiler is using ELF
internally which is then converted to PE object format. It builds GMP
without any issues, but failed the tests with:
"pgcnv: error CNV024: ELF unknown relocation type 9" with amd64call.asm
There are tons of compiler options, I'll try to figure out what is wrong.

I got this:
MPN_PATH=" x86_64 generic"
which I think is different from Brian Gladman's solution.

> There is experimental 64 bit support via MinGW, but I haven't tried it out
> due to lack of time. I doubt the 64 bit masm will understand the assembly
> syntax used, but I am willing to be proven wrong on that one.

Unfortunately, MinGW tools cannot be used in Interix due to shortcomings of
GNU binutils (incomplete PE support). As I understand NT POSIX applications
use a somewhat different PE section layout (effect of subsystem:posix linker
option) and the Interix SDK libs are using special PE features (e.g. weak
externals). Paradoxically all for adaption to gcc and support for unix-like
shared libraries. This is actually a sad story: MS ported the gcc-3.3 tool
chain to Interix (even hired 3:rd companies for some work) and submitted
patches to binutils to correct and expand the PE support. These patches were
never adopted by the binutils developers (I don't know why), resulting in a
special MS branch of gcc. This special Interix gcc tool chain edition has
been further developed and is shipped with the Interix SDK (gcc source
included). There is no 64-bit version however. Rumour says Microsoft is
currently working on a new 4.x based version of gcc for Interix with
enhanced support for shared libraries, including 64-bit support. We'll see
if they care to submit patches this time and if so they will be accepted by
binutils.

cheers Jerker




More information about the gmp-discuss mailing list