I suspect that my llvm-gcc cross compiler is using the wrong assembler because it does not recognize "-mcpu=cortex-a8". I was trying to build a cross compiler for a Mac host. Now I am trying to build on x86_64 Linux. I am targeting a Beagle board with an ARM Cortex-A8 and Angstrom Linux. TRIED: to use the script in llvm/utils/crosstool/ARM/build-install-linux.sh I used the recommended version of CodeSourcery and the same SVN revision. RESULT: llvm-gcc builds but when I try to use it I get "as: unrecognized option `-meabi=4'" TRIED: using the latest CodeSourcery 2009q1 and latest LLVM REV 74564 RESULT: llvm-gcc failed to build with this error: /tmp/ccVSwC0h.s:535: Error: selected processor does not support `strd r2,[r6]' make[3]: *** [libgcc/./_udivmoddi4.o] Error 1 TRIED: adding --with-cpu=cortex-a8 to configuration for llvm-gcc RESULT: llvm-gcc now builds but when I try to use it I get "as: unrecognized option `-mcpu=cortex-a8'" I suspect it is using the wrong assembler. But when I do llvm-gcc -v I can see it has: --with-gnu-as=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-as If I use that assembler directly I get an executable but printf, fflush and others are UNDefined. I can compile programs using the CodeSourcery gcc toolchain just fine. I did not even have to install the runtime code on the Beagle Board. it just worked. Any suggestions? Has anyone recently built an LLVM cross compiler for ARM Linux? Thanks, Neel
On Jul 2, 2009, at 6:24 PM, Neel Nagar wrote:> I suspect that my llvm-gcc cross compiler is using the wrong > assembler because it does not recognize "-mcpu=cortex-a8".This is a known problem. We've only added support for ARMv7 (including cortex-a8) in llvm in the last week or so, and the associated changes for llvm-gcc are still pending. Unless you need specific features of your cortex-a8 processor, you should be able to make progress getting things to work by specifying an older ARMv6 processor.> > I was trying to build a cross compiler for a Mac host. Now I am trying > to build on x86_64 Linux. I am targeting a Beagle board with an ARM > Cortex-A8 and Angstrom Linux. > > TRIED: to use the script in llvm/utils/crosstool/ARM/build-install- > linux.sh > I used the recommended version of CodeSourcery and the same SVN > revision. > > RESULT: llvm-gcc builds but when I try to use it I get "as: > unrecognized option `-meabi=4'" > > TRIED: using the latest CodeSourcery 2009q1 and latest LLVM REV 74564 > > RESULT: llvm-gcc failed to build with this error: > > /tmp/ccVSwC0h.s:535: Error: selected processor does not support > `strd r2,[r6]' > make[3]: *** [libgcc/./_udivmoddi4.o] Error 1 > > TRIED: adding --with-cpu=cortex-a8 to configuration for llvm-gcc > > RESULT: llvm-gcc now builds but when I try to use it I get "as: > unrecognized option `-mcpu=cortex-a8'" > > I suspect it is using the wrong assembler. But when I do llvm-gcc -v I > can see it has: > > --with-gnu-as=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm- > none-linux-gnueabi-as > > If I use that assembler directly I get an executable but printf, > fflush and others are UNDefined. > > I can compile programs using the CodeSourcery gcc toolchain just fine. > I did not even have to install the runtime code on the Beagle Board. > it just worked. > > Any suggestions? > > Has anyone recently built an LLVM cross compiler for ARM Linux? > > Thanks, > Neel > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Anton Korobeynikov
2009-Jul-03 05:39 UTC
[LLVMdev] llvm-gcc cross compiler for ARM Linux failing
Hi, Bob> This is a known problem. We've only added support for ARMv7 > (including cortex-a8) in llvm in the last week or so, and the > associated changes for llvm-gcc are still pending.The processor support part itself was committed ~month ago. I built llvm-gcc for cortex-a8 / a9 and arch armv7-a without any problems. I have no idea, however, whether codesourcery tools in question support these targets - I built binutils by myself. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Anton Korobeynikov
2009-Jul-03 05:40 UTC
[LLVMdev] llvm-gcc cross compiler for ARM Linux failing
Hi, Neel> I suspect it is using the wrong assembler. But when I do llvm-gcc -v I > can see it has: > > --with-gnu-as=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-asBut how's assembler actually called? Just try to compile something with extra -v option added -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Hello Anton, Thanks for replying. The message "as: unrecognized option `-mcpu=cortex-a8'" is the same message I get when I just enter: as -mcpu=cortex-a8 So I think I llvm-gcc is using the Linux i386 assembler to assemble ARM code. Not good. What assembler is it supposed to use? The one in CodeSourcery?> But how's assembler actually called? Just try to compile something > with extra -v option addedDid: llvm-gcc -v simple.c ------------------------------------------- Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /home/neel/xllvm/build-xl/src/llvm-gcc-4.2/configure --enable-languages=c,c++ --enable-llvm=/home/neel/xllvm/install-xl/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm --prefix=/home/neel/xllvm/install-xl/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2 --program-prefix=llvm- --target=arm-none-linux-gnueabi --with-cpu=cortex-a8 --with-gnu-as=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-as --with-gnu-ld=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-ld --with-sysroot=/home/neel/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5646) (LLVM build) /home/neel/xllvm/install-xl/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2/libexec/gcc/arm-none-linux-gnueabi/4.2.1/cc1 -quiet -v simple.c -quiet -dumpbase simple.c -mcpu=cortex-a8 -auxbase simple -version -o /tmp/ccWsERFx.s ignoring nonexistent directory "/home/neel/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/usr/local/include" #include "..." search starts here: #include <...> search starts here: /home/neel/xllvm/install-xl/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2/lib/gcc/arm-none-linux-gnueabi/4.2.1/include /home/neel/xllvm/install-xl/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2/lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/include /home/neel/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/usr/include End of search list. GNU C version 4.2.1 (Based on Apple Inc. build 5646) (LLVM build) (arm-none-linux-gnueabi) compiled by GNU C version 4.1.2 20071124 (Red Hat 4.1.2-42). GGC heuristics: --param ggc-min-expand=96 --param ggc-min-heapsize=131072 Compiler executable checksum: f4d5e7abe212ada5d54f7df3985c1fb4 as -mcpu=cortex-a8 -meabi=4 -o /tmp/ccsbmdt5.o /tmp/ccWsERFx.s as: unrecognized option `-mcpu=cortex-a8' ------------------------------------------ Thanks, Neel On Fri, Jul 3, 2009 at 5:40 AM, Anton Korobeynikov<anton at korobeynikov.info> wrote:> Hi, Neel > >> I suspect it is using the wrong assembler. But when I do llvm-gcc -v I >> can see it has: >> >> --with-gnu-as=/home/neel/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-as > But how's assembler actually called? Just try to compile something > with extra -v option added > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Reasonably Related Threads
- [LLVMdev] llvm-gcc cross compiler for ARM Linux failing
- [LLVMdev] llvm-gcc cross compiler for ARM Linux failing
- [LLVMdev] configuring cross compiler for Mac to Linux on ARM
- [LLVMdev] llvm-gcc cross compiler for ARM Linux failing
- [LLVMdev] Setting up a cross-compiler for cortex-m3