5.1.2 assembler error on Solaris 10 with CC='cc -xtarget=opteron -xarch=amd64'

Daniel Richard G. skunk at iSKUNK.ORG
Wed Oct 9 01:22:07 CEST 2013


On Tue, 2013 Oct  8 9:55+0200, Niels Möller wrote:
>
> And the OpenSolaris thing always used gcc, and never included Sun's
> compilers?

I wouldn't know; I haven't worked with OpenSolaris :]

> It seems it complains about the first instructions using the 64-bit
> registers. My guess is that the assembler is trying to interpret this
> is 32-bit x86 code. Which won't work at all, of course.
>
> I think you have to first figure out which flags to pass to cc, to get
> it to invoke the assembler in x86_64 mode (-m64 is not recognized, and
> apparently -xarch=amd64 is not enough). And then we can see how to get
> gmp's configure script to do pass the right flags automatically.

I've found that the compiler invokes the assembler as follows, and have
reproduced the error this way:

    fbe -xarch=amd64 -o add_n.o -Qy tmp-add_n.s -Kpic

According to the man page for fbe(1), -xarch=amd64 (or =generic64) is
the correct option to assemble "64-bit x86" code, yet it complains about
syntax errors and the supposedly-illegal "bt" mnemonic.

Even stranger is that /usr/ccs/bin/as, when invoked with the same
options as above, assembles the file without an error.

Would it be helpful to look at assembly code produced by the compiler,
to see if there is any obvious difference with GMP's code?


--Daniel


-- 
Daniel Richard G. || skunk at iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.


More information about the gmp-bugs mailing list