Hi, When using mips-unknown-linux-gnu as a cross-compiler, the llvm Mips backend is called by cc1 and with that you get llvm bytecode defined relative to the Mips ABI. This can be messing up somehow your generated C code. 2008/3/7, HyperQuantum <hyperquantum at gmail.com>:> On Fri, Feb 29, 2008 at 2:23 PM, HyperQuantum <hyperquantum at gmail.com> wrote: > > At least I got llvm-gcc running again. > > > Something is still wrong because I cannot get Pi_Calc to run after > compiling it with this semi-cross-compiler, and it worked with the > regular llvm-gcc. I configured the cross compiler with target > mips-unknown-linux-gnu. Should I use another triple or do I need to > hack the llvm-gcc sources some more? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Bruno Cardoso Lopes http://www.brunocardoso.org "Morte: Mas não para você pistoleiro"
On Fri, Mar 7, 2008 at 8:28 PM, Bruno Cardoso Lopes <bruno.cardoso at gmail.com> wrote:> When using mips-unknown-linux-gnu as a cross-compiler, the llvm Mips > backend is called by cc1 and with that you get llvm bytecode defined > relative to the Mips ABI.That was my intention. The PSP has a 32-bit MIPS (derived) CPU. What I don't know is if that triple is the right one to pick. I looked through the patch that turns gcc into psp-gcc and it defines a special triple called simply "psp": diff -burN gcc-4.1.0/config.sub gcc-psp/config.sub --- gcc-4.1.0/config.sub 2005-12-16 12:57:40.000000000 +0000 +++ gcc-psp/config.sub 2006-05-07 13:27:40.000000000 +0100 @@ -264,6 +264,7 @@ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ + | mipsallegrex | mipsallegrexel \ | mn10200 | mn10300 \ | mt \ | msp430 \ @@ -346,6 +347,7 @@ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ + | mipsallegrex-* | mipsallegrexel-* \ | mmix-* \ | mt-* \ | msp430-* \ @@ -689,6 +691,10 @@ basic_machine=m68k-atari os=-mint ;; + psp) + basic_machine=mipsallegrexel-psp + os=-elf + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; I did not see any changes in the rest of the diff that did something to the ABI; as far as I understand it it's only adding some extra instructions. So I assume that the PSP uses a standard MIPS ABI. And yet something is still wrong, even more than with a native "i686-pc-linux-gnu" llvm-gcc.> This can be messing up somehow your > generated C code.Supposed that you knew my approach was intentional (correct me if I'm wrong), what problem did you see here? Regards, Kevin André
Hi Kevin,> Supposed that you knew my approach was intentional (correct me if I'm > wrong), what problem did you see here?Yes, i'm trying to help raising possible problems. For example, there are Mips machines with different endianess, the llvm Mips default (Big) is different from the psp toochain default one (correct me if I'm wrong - Little), maybe this is messing up... Cheers, -- Bruno Cardoso Lopes http://www.brunocardoso.org "Morte: Mas não para você pistoleiro"
Apparently Analagous Threads
- [LLVMdev] llvm-gcc and mips
- [PATCH] ./configure fails to recognize alphapca56 (R-1.1.0)
- [PATCH] ./configure fails to recognize alphapca56 (PR#572)
- [LLVMdev] Running all the backends over test/CodeGen/Generic
- update config.guess and config.sub to support aarch64