I tried to cross-compile llvm-gcc for mips, but it crashes somewhere in the build process: /home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/./gcc/xgcc -B/home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/./gcc/ -B/home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/../../install/llvmgcc-mips/mips-unknown-linux-gnu/bin/ -B/home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/../../install/llvmgcc-mips/mips-unknown-linux-gnu/lib/ -isystem /home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/../../install/llvmgcc-mips/mips-unknown-linux-gnu/include -isystem /home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/../../install/llvmgcc-mips/mips-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../../llvm-gcc4.2-2.2/gcc -I../../../llvm-gcc4.2-2.2/gcc/. -I../../../llvm-gcc4.2-2.2/gcc/../include -I../../../llvm-gcc4.2-2.2/gcc/../libcpp/include -I../../../llvm-gcc4.2-2.2/gcc/../libdecnumber -I../libdecnumber -I/home/kevin/Documents/School/2eLIC/Thesis/work/build/llvm-2.2/include -I/home/kevin/Documents/School/2eLIC/Thesis/work/build/llvmgcc-mips/../llvm-2.2/include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -Dinhibit_libc \ -c ../../../llvm-gcc4.2-2.2/gcc/crtstuff.c -DCRT_BEGIN \ -o crtbegin.o terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc ../../../llvm-gcc4.2-2.2/gcc/crtstuff.c:378: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[2]: *** [crtbegin.o] Error 1 I had to make this change for mips to be accepted: Index: ../../llvm-gcc4.2-2.2/gcc/Makefile.in ==================================================================--- ../../llvm-gcc4.2-2.2/gcc/Makefile.in (revision 140) +++ ../../llvm-gcc4.2-2.2/gcc/Makefile.in (working copy) @@ -1134,6 +1134,7 @@ ia64-*-*) echo ia64;; \ i[34567]86-*-*) echo x86;; \ x86_64-*-*) echo x86;; \ + mips-*-*) echo mips;; \ powerpc*-*-*) echo powerpc;; \ sparc-*-*) echo sparc;; \ sparcv9-*-*) echo sparc;; \ But now I'm stuck. I don't need a full cross-compiler, just generating LLVM code is sufficient for me. Anyone who can help me here? Regards, Kevin André
On Feb 27, 2008, at 8:38 AM, HyperQuantum wrote:> I tried to cross-compile llvm-gcc for mips, but it crashes> But now I'm stuck. I don't need a full cross-compiler, just generating > LLVM code is sufficient for me.make -k install will install a mips cross compiler for you, I believe. If you don't want to install it, you can run it as cd gcc && ./xgcc - B./ t.c.
On Wed, Feb 27, 2008 at 7:32 PM, Mike Stump <mrs at apple.com> wrote:> On Feb 27, 2008, at 8:38 AM, HyperQuantum wrote: > > I tried to cross-compile llvm-gcc for mips, but it crashes> > But now I'm stuck. I don't need a full cross-compiler, just generating > > LLVM code is sufficient for me. > > make -k install will install a mips cross compiler for you, I believe. > > If you don't want to install it, you can run it as cd gcc && ./xgcc - > B./ t.c.Thanks for your help. I tried your first suggestion, but it doesn't work: /home/kevin/Documents/School/Thesis/work/install/llvmgcc-mips/bin/llvm-gcc -nostdlib -nostdinc -I/home/kevin/Documents/School/Thesis/work/install/psptoolchain/psp/include -I/home/kevin/Documents/School/Thesis/work/install/psptoolchain/lib/gcc/psp/4.1.0/include -c -emit-llvm -Wall \ -D_PSP_FW_VERSION=150 -DPSP=1 -D__psp__=1 -D_PSP=1 -I/home/kevin/Documents/School/Thesis/work/install/psptoolchain/psp/sdk/include -O1 main.c -o main.o llvm-gcc: error trying to exec 'cc1': execvp: No such file or directory When I ran "make -k install" it looked like every invocation of xgcc died with an abort (after throwing std::bad_alloc). Something serious happening here? Regards, Kevin André