Michael McCracken
2005-Sep-16 03:38 UTC
[LLVMdev] Problems Cross Compiling for x86 and ia64
Hi, I'm having some problems cross-compiling from ppc (OS X) to x86 object files and to ia64, at all. I'd appreciate some advice as to whether or not I'm actually supposed to be able to do this, and what's wrong if so. Here's how I configured it: ../llvm-darcslocal/llvm/configure --with-llvmgccdir=$LLVMGCCDIR --prefix=$HOME/Documents/hpcl/LLVM/install The results work fine when building for ppc. Here's what I tried: LLVM/cfe-src/install/bin/gcc -o loopUnroll loopUnroll.c LLVM/obj-llvm-darcslocal/Debug/bin/llvmc -O3 -o loopUnroll-llvm loopUnroll.bc llvm-ld: warning: Cannot find library 'c' LLVM/obj-llvm-darcslocal/Debug/bin/llc -march=x86 -f -filetype=obj -o loopUnroll-x86 loopUnroll.bc LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/ELFWriter.cpp:63: failed assertion `0 && "unimp"' ^Cmake: *** [llvm-x86] Abort trap (core dumped) -- note that without -filetype=obj I get no problems and an apparently fine x86 asm file. LLVM/obj-llvm-darcslocal/Debug/bin//llc -march=ia64 -stats -f -o loopUnroll-ia64 loopUnroll.bc make: *** [llvm-ia64] Bus error (core dumped) -- note that this has no -filetype option at all. Any hints? Thanks, -mike -- Michael McCracken UCSD CSE PhD Candidate research: http://www.cse.ucsd.edu/~mmccrack/ misc: http://michael-mccracken.net/blog/
Michael McCracken
2005-Sep-17 01:55 UTC
[LLVMdev] Re: Problems Cross Compiling for x86 and ia64
OK, I noticed a few problems with my previous email, so I will boil the question down: What I want to do is compile for x86 and ia64 from darwin. I also want to load my own passes into opt and llc. Should I be using llvmc at all here, or should I be doing something like llvmgcc -> gccas -> opt -> llc ? I've given up on the filetype=obj argument, so now the problem is that llc is crashing when I use -march=ia64. I'd appreciate help tracking this down. I've included the backtrace here. Thanks, -mike (gdb) run -march=ia64 loopUnroll.bc -f Starting program: /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/Debug/bin/llc -march=ia64 loopUnroll.bc -f Reading symbols for shared libraries . done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000018 0x00513d50 in llvm::MachineInstr::getParent (this=0x0) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h:433 Line number 433 out of range; /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h has 336 lines. (gdb) bt #0 0x00513d50 in llvm::MachineInstr::getParent (this=0x0) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h:433 #1 0x001ca99c in (anonymous namespace)::RA::assignRegOrStackSlotAtInterval (this=0x8b010f0, cur=0x8b34114) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:567 #2 0x001cca64 in (anonymous namespace)::RA::linearScan (this=0x8b010f0) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:276 #3 0x001cd328 in (anonymous namespace)::RA::runOnMachineFunction (this=0x8b010f0, fn=@0x8b122c0) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:214 #4 0x005632e0 in llvm::MachineFunctionPass::runOnFunction (this=0x8b010f0, F=@0x8b05010) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/CodeGen/MachineFunctionPass.h:38 #5 0x007c3390 in llvm::PassManagerTraits<llvm::Function>::runPass (P=0x8b010f0, F=0x8b05010) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:706 #6 0x007e1fb0 in llvm::PassManagerT<llvm::Function>::runOnUnit (this=0x8b12cb0, M=0x8b05010) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:256 #7 0x007c3624 in llvm::PassManagerTraits<llvm::Function>::runOnFunction (this=0x8b12cb0, F=@0x8b05010) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:810 #8 0x00283384 in llvm::FunctionPass::runOnModule (this=0x8b12cb0, M=@0x8b02580) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/Pass.cpp:252 #9 0x007c3494 in llvm::PassManagerTraits<llvm::Module>::runPass (P=0x8b12cb0, M=0x8b02580) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:746 #10 0x007df4dc in llvm::PassManagerT<llvm::Module>::runOnUnit (this=0x8b0d770, M=0x8b02580) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:256 #11 0x007c3564 in llvm::PassManagerTraits<llvm::Module>::runOnModule (this=0x8b0d770, M=@0x8b02580) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:755 #12 0x00282128 in llvm::PassManager::run (this=0xbfffee94, M=@0x8b02580) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/Pass.cpp:88 #13 0x00003dc8 in main (argc=4, argv=0xbfffefc8) at /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/tools/llc/llc.cpp:221 (gdb) On 9/15/05, Michael McCracken <michael.mccracken at gmail.com> wrote:> Hi, I'm having some problems cross-compiling from ppc (OS X) to x86 > object files and to ia64, at all. I'd appreciate some advice as to > whether or not I'm actually supposed to be able to do this, and what's > wrong if so. > > Here's how I configured it: > > ../llvm-darcslocal/llvm/configure --with-llvmgccdir=$LLVMGCCDIR > --prefix=$HOME/Documents/hpcl/LLVM/install > > The results work fine when building for ppc. > > Here's what I tried: > > LLVM/cfe-src/install/bin/gcc -o loopUnroll loopUnroll.c > LLVM/obj-llvm-darcslocal/Debug/bin/llvmc -O3 -o loopUnroll-llvm loopUnroll.bc > llvm-ld: warning: Cannot find library 'c' > > LLVM/obj-llvm-darcslocal/Debug/bin/llc -march=x86 -f -filetype=obj -o > loopUnroll-x86 loopUnroll.bc > LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/ELFWriter.cpp:63: > failed assertion `0 && "unimp"' > ^Cmake: *** [llvm-x86] Abort trap (core dumped) > > -- note that without -filetype=obj I get no problems and an apparently > fine x86 asm file. > > LLVM/obj-llvm-darcslocal/Debug/bin//llc -march=ia64 -stats -f -o > loopUnroll-ia64 loopUnroll.bc > make: *** [llvm-ia64] Bus error (core dumped) > > -- note that this has no -filetype option at all. > > Any hints? > > Thanks, > -mike > > -- > Michael McCracken > UCSD CSE PhD Candidate > research: http://www.cse.ucsd.edu/~mmccrack/ > misc: http://michael-mccracken.net/blog/ >-- Michael McCracken UCSD CSE PhD Candidate research: http://www.cse.ucsd.edu/~mmccrack/ misc: http://michael-mccracken.net/blog/
Chris Lattner
2005-Sep-20 06:57 UTC
[LLVMdev] Re: Problems Cross Compiling for x86 and ia64
On Fri, 16 Sep 2005, Michael McCracken wrote:> OK, I noticed a few problems with my previous email, so I will boil > the question down: > > What I want to do is compile for x86 and ia64 from darwin. > I also want to load my own passes into opt and llc.Ok.> Should I be using llvmc at all here, or should I be doing something > like llvmgcc -> gccas -> opt -> llc ?No, llvmc is not finished yet. Using the pipeline above should work.> I've given up on the filetype=obj argument, so now the problem is that > llc is crashing when I use -march=ia64. I'd appreciate help tracking > this down. I've included the backtrace here.filetype=obj is not yet complete, and will only be supported on some targets. Just output .s files as normal and things shoudl work. IF you send me a bugpointed version of the ia64 crash, I (or duraid) can look into it. Just run this: bugpoint -run-llc loopUnroll.bc -tool-args -march=ia64 That should reduce loopUnroll to something smallish. Thanks! -Chris> Thanks, > -mike > > (gdb) run -march=ia64 loopUnroll.bc -f > Starting program: > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/Debug/bin/llc > -march=ia64 loopUnroll.bc -f > Reading symbols for shared libraries . done > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_PROTECTION_FAILURE at address: 0x00000018 > 0x00513d50 in llvm::MachineInstr::getParent (this=0x0) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h:433 > Line number 433 out of range; > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h > has 336 lines. > (gdb) bt > #0 0x00513d50 in llvm::MachineInstr::getParent (this=0x0) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/Analysis/LoopInfo.h:433 > #1 0x001ca99c in (anonymous > namespace)::RA::assignRegOrStackSlotAtInterval (this=0x8b010f0, > cur=0x8b34114) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:567 > #2 0x001cca64 in (anonymous namespace)::RA::linearScan > (this=0x8b010f0) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:276 > #3 0x001cd328 in (anonymous namespace)::RA::runOnMachineFunction > (this=0x8b010f0, fn=@0x8b122c0) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/RegAllocLinearScan.cpp:214 > #4 0x005632e0 in llvm::MachineFunctionPass::runOnFunction > (this=0x8b010f0, F=@0x8b05010) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/include/llvm/CodeGen/MachineFunctionPass.h:38 > #5 0x007c3390 in llvm::PassManagerTraits<llvm::Function>::runPass > (P=0x8b010f0, F=0x8b05010) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:706 > #6 0x007e1fb0 in llvm::PassManagerT<llvm::Function>::runOnUnit > (this=0x8b12cb0, M=0x8b05010) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:256 > #7 0x007c3624 in > llvm::PassManagerTraits<llvm::Function>::runOnFunction > (this=0x8b12cb0, F=@0x8b05010) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:810 > #8 0x00283384 in llvm::FunctionPass::runOnModule (this=0x8b12cb0, > M=@0x8b02580) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/Pass.cpp:252 > #9 0x007c3494 in llvm::PassManagerTraits<llvm::Module>::runPass > (P=0x8b12cb0, M=0x8b02580) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:746 > #10 0x007df4dc in llvm::PassManagerT<llvm::Module>::runOnUnit > (this=0x8b0d770, M=0x8b02580) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:256 > #11 0x007c3564 in llvm::PassManagerTraits<llvm::Module>::runOnModule > (this=0x8b0d770, M=@0x8b02580) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/PassManagerT.h:755 > #12 0x00282128 in llvm::PassManager::run (this=0xbfffee94, > M=@0x8b02580) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/VMCore/Pass.cpp:88 > #13 0x00003dc8 in main (argc=4, argv=0xbfffefc8) at > /Users/mike/Documents/hpcl/LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/tools/llc/llc.cpp:221 > (gdb) > > On 9/15/05, Michael McCracken <michael.mccracken at gmail.com> wrote: >> Hi, I'm having some problems cross-compiling from ppc (OS X) to x86 >> object files and to ia64, at all. I'd appreciate some advice as to >> whether or not I'm actually supposed to be able to do this, and what's >> wrong if so. >> >> Here's how I configured it: >> >> ../llvm-darcslocal/llvm/configure --with-llvmgccdir=$LLVMGCCDIR >> --prefix=$HOME/Documents/hpcl/LLVM/install >> >> The results work fine when building for ppc. >> >> Here's what I tried: >> >> LLVM/cfe-src/install/bin/gcc -o loopUnroll loopUnroll.c >> LLVM/obj-llvm-darcslocal/Debug/bin/llvmc -O3 -o loopUnroll-llvm loopUnroll.bc >> llvm-ld: warning: Cannot find library 'c' >> >> LLVM/obj-llvm-darcslocal/Debug/bin/llc -march=x86 -f -filetype=obj -o >> loopUnroll-x86 loopUnroll.bc >> LLVM/obj-llvm-darcslocal/../llvm-darcslocal/llvm/lib/CodeGen/ELFWriter.cpp:63: >> failed assertion `0 && "unimp"' >> ^Cmake: *** [llvm-x86] Abort trap (core dumped) >> >> -- note that without -filetype=obj I get no problems and an apparently >> fine x86 asm file. >> >> LLVM/obj-llvm-darcslocal/Debug/bin//llc -march=ia64 -stats -f -o >> loopUnroll-ia64 loopUnroll.bc >> make: *** [llvm-ia64] Bus error (core dumped) >> >> -- note that this has no -filetype option at all. >> >> Any hints? >> >> Thanks, >> -mike >> >> -- >> Michael McCracken >> UCSD CSE PhD Candidate >> research: http://www.cse.ucsd.edu/~mmccrack/ >> misc: http://michael-mccracken.net/blog/ >> > > >-Chris -- http://nondot.org/sabre/ http://llvm.org/
Reasonably Related Threads
- [LLVMdev] Re: Problems Cross Compiling for x86 and ia64
- [LLVMdev] Problems running dejagnu tests
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] problem loading analysis results from Inliner pass