LLVM build error (sparc gcc 3.2.2)

Hi,

I met some errors when I tried to build LLVM. The tar file is
llvm-1.3.tar.gz. I am using a sparc machine with gcc 3.2.2.

The backend is designed for SparcV9 and uses inline assembly, some of
which may be V9-only. Your error indicates that your GCC was configured
for SparcV8 instead. One way to check what your GCC thinks it's
compiling for is as follows:

% gcc -dumpmachine
sparcv9-sun-solaris2.8

If your output is "sparcv8-...", then you may need to build a new
version of GCC.

I should clarify my answer a bit.

I just committed this patch:

http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018654.html

You should be able to compile the SparcV9 backend now with a V8
compiler, but note that the JIT will not work for you, as it's only
enabled if compiling in V9 mode. You should still be able to use LLC on
your machine.

Shukang Zhou wrote:

Hi,

I met some errors when I tried to build LLVM. The tar file is
llvm-1.3.tar.gz. I am using a sparc machine with gcc 3.2.2.

-------------
Compiling SparcV9CodeEmitter.cpp
/uf24/zhou/research/llvm/src/lib/Target/SparcV9/SparcV9CodeEmitter.cpp: In
   static member function `static void
   llvm::<unnamed>::JITResolver::CompilationCallback()':
/uf24/zhou/research/llvm/src/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:340:
warning: cast to pointer from integer of different size
/usr/ccs/bin/as: "/var/tmp//ccFz2VBS.s", line 3147: error: cannot use
v8plus registers in a non-v8plus target binary
...
-------------

There are 42 similar errors in this file ("cannot use v8plus registers in
a non-v8plus target binary"). Is anyone who knows about this error? Thanks
a lot for your time and help.

Additionally, if you are on a SparvV9 machine (i.e. a 64 Ultra-Sparc machine), it could be possible that your version of GCC is configured to emit SparcV8 (32 bit code) by default (this could happen, for example, if your environment has a mix of 32 and 64 bit machines).

If this is the case, there are options you can use to tell GCC to emit SparcV9 code. I believe you would want to use gcc -mcpu=v9.

You can either reconfigure LLVM with the configure script to add the option, or modify the generated Makefile.config in your object tree to add the additional flags to the CC and CXX environment variables.

Shukang Zhou

_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev

-- John T.