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. Shukang Zhou
On Wed, Sep 29, 2004 at 06:44:50PM -0400, Shukang Zhou wrote:> 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.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. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
I should clarify my answer a bit. On Wed, Sep 29, 2004 at 05:51:16PM -0500, Misha Brukman wrote:> 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.The file you are trying to compile is part of the JIT, which is V9-specific. The #ifdefs test for "sparc" or "sparcv9" to be defined, that should certainly be fixed to only be true when compiled with v9. I will fix the #ifdefs and then V9 will build using a V8 compiler, but you won't be able to use the JIT (LLC will still work though). -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
On Wed, Sep 29, 2004 at 06:44:50PM -0400, Shukang Zhou wrote:> 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.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. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
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 at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-- John T. -- ********************************************************************* * John T. Criswell Email: criswell at uiuc.edu * * Research Programmer * * University of Illinois at Urbana-Champaign * * * * "It's today!" said Piglet. "My favorite day," said Pooh. * *********************************************************************