#272 Assembler optimization invalid on Solaris

0.65
open
nobody
None
5
2012-09-07
2006-10-14
laurent
No

Dosbox won't build with assembler optimization using
Solaris 10 GCC because it uses the system's as, which
has a different assembly syntax.

/tmp/ccdpZwPy.s: Assembler messages:
/tmp/ccdpZwPy.s:18213: Error: suffix or operands
invalid for push' /tmp/ccdpZwPy.s:18214: Error: suffix or operands invalid forpush'
/tmp/ccdpZwPy.s:18215: Error: suffix or operands
invalid for push' /tmp/ccdpZwPy.s:18218: Error: suffix or operands invalid forpop'

Workaround is to use those configure options:
--disable-dynamic-x86 \ --disable-fpu-x86

I'm not an assembler expert, but I'm sure it would take
too much work to adapt the syntax, and with very little
gain. So maybe some kind of test in configure, or a
warning in INSTALL would be enough?

Discussion

  • c2woody
    c2woody
    2006-10-14

    Logged In: YES
    user_id=1304940

    That's x86 only code (therefore the suffixes),
    and there are checks for the cpu type (hostcpu)
    in configure.in for that. Not sure why the
    checks fail though.

     
  • laurent
    laurent
    2006-10-14

    Logged In: YES
    user_id=1447460

    The CPU type is x86 (AMD64 actually), so that test is
    right. It's just not suficient to use the host type to
    determine the assembly optimization can be used: here they
    can't because the assembler uses a different syntax (AT&T).

     
  • Peter Veenstra
    Peter Veenstra
    2006-10-15

    Logged In: YES
    user_id=535630

    right. So solaris doesn't have GCC ?

     
  • c2woody
    c2woody
    2006-10-15

    Logged In: YES
    user_id=1304940

    The files contain full AT&A asm, as you might have
    noticed looking through the files, and it works
    perfectly for x86 hosts. As you do not have an
    x86 compatible mode enabled (you can notice this
    in that the 32bit versions of push/pop are not
    available), the target_cpu should reflect this
    (x86_64 or amd64 but NOT x86).

     
  • laurent
    laurent
    2006-10-15

    Logged In: YES
    user_id=1447460

    Ah, I see. Then it's really the test in configure that's
    insufficient.
    On Solaris x86, both 32 and 64 bit targets are available.
    config.guess will always return i386-pc-solaris2.10, whether
    the kernel is running 32 or 64 (and this is decided at boot
    time, usually automatically).
    So the target's type is decided only by the C compiler
    options (-m64 for GCC, -xarch=amd64a for Sun Studio).
    The only way I see to do the test is to build a binary using
    the given C options, and check if it's a 32 or 64 bit binary.