GMP 5.0.5 build fails with tcc due to x86_64 asm (unknown register...)

Torbjorn Granlund tg at gmplib.org
Tue Jun 19 15:11:55 CEST 2012


Vincent Lefevre <vincent at vinc17.net> writes:

  The GMP 5.0.5 build fails with tcc 0.9.25 on a Debian/unstable
  amd64 (x86_64) machine:
  
  make[2]: Entering directory `/home/vlefevre/gmp-5.0.5/mpn'
  /home/vlefevre/dash/bin/dash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" tcc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo add_n | sed 's/_$//'`      `test -f 'add_n.asm' || echo './'`add_n.asm
  libtool: compile:  ../mpn/m4-ccas --m4=m4 tcc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n add_n.asm  -DPIC -o .libs/add_n.o
  m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_add_n -DPIC add_n.asm >tmp-add_n.s
   tcc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n tmp-add_n.s -DPIC -o .libs/add_n.o
  tmp-add_n.s:81: error: unknown register
  
  The line is:
  
          bt      $0, %r8                 
  
  but if I remove this line, I get:
  
  tst.s:82: error: unknown opcode 'jrcxz'
  
  for the line:
  
          jrcxz   Llt4
  
  It seems that tcc has a very limited asm support (perhaps only 32-bit
  x86?). This should be tested in configure.
  
I am not sure we can win this race, where ever worse compilers pop up.
If people play with such a compiler, isn't reasonable to assume they can
interpret errors such as the ones above?  Would they be helped by an
error message from GMP's configure:

 "Sorry, assembler invoked by 'mce' cannot assembly the any instruction
  and doesn't recognise any register names"

(Here 'mce' is the mis-compiles-everything compiler.)

-- 
Torbjörn


More information about the gmp-bugs mailing list