Juan Carlos Martinez Santos
2009-Jul-01 19:01 UTC
[LLVMdev] Generatin code for an ARM-LINUX machine
Hello Misha, I used the snapshots for the latest stable version (70786), and I followed the instructions inside of README file (very clear!!!) However, when I ran the hello program, I get an unrecognized option message. Bellow are the details. ===========================================jcmartin78 at jcmartin78-laptop:~/LLVM/my-test$ llvmc hello.c as: unrecognized option '-meabi=4' =========================================== More details: ===========================================jcmartin78 at jcmartin78-laptop:~/LLVM/my-test$ llvm-gcc -v hello.c -o hello Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /tmp/llvm-project.jnnWEq/src/llvm-gcc-4.2/configure --enable-languages=c,c++ --enable-llvm=/home/jcmartin78/local/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm --prefix=/home/jcmartin78/local/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2 --program-prefix=llvm- --target=arm-none-linux-gnueabi --with-gnu-as=/home/jcmartin78/local/codesourcery/arm-2007q3/bin/arm-none-linux-gnueabi-as --with-gnu-ld=/home/jcmartin78/local/codesourcery/arm-2007q3/bin/arm-none-linux-gnueabi-ld --with-sysroot=/home/jcmartin78/local/codesourcery/arm-2007q3/arm-none-linux-gnueabi/libc Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5645) (LLVM build) /home/jcmartin78/local/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 hello.c -quiet -dumpbase hello.c -auxbase hello -version -o /tmp/ccy6iYri.s ignoring nonexistent directory "/home/jcmartin78/local/codesourcery/arm-2007q3/arm-none-linux-gnueabi/libc/usr/local/include" #include "..." search starts here: #include <...> search starts here: /home/jcmartin78/local/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/jcmartin78/local/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/jcmartin78/local/codesourcery/arm-2007q3/arm-none-linux-gnueabi/libc/usr/include End of search list. GNU C version 4.2.1 (Based on Apple Inc. build 5645) (LLVM build) (arm-none-linux-gnueabi) compiled by GNU C version 4.3.3. GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072 Compiler executable checksum: 41625b7e939f94061601f66e8d27b606 as -meabi=4 -o /tmp/ccYxnIEs.o /tmp/ccy6iYri.s as: unrecognized option '-meabi=4' =========================================== This is my PATH: ***************************************** PATH=$PATH:/home/jcmartin78/local/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm/bin:/home/jcmartin78/local/llvm-project/x86_64-unknown-linux-gnu/arm-none-linux-gnueabi/llvm-gcc-4.2/bin ***************************************** Any idea what could be wrong? Thanks in advance, Juan Carlos On Wed, Jul 1, 2009 at 9:53 AM, Misha Brukman <brukman at gmail.com> wrote:> 2009/6/30 Juan Carlos Martinez Santos <juanc.martinez.santos at gmail.com> > >> Thanks John, >> >> I just realized that I am not working on the same "branch" of LLVM. >> Looking the latest or the newest version I saw the folder with the script, >> but I did not see a README file. >> >> I ran the script, and I get: >> >> ********** >> chown: cannot access `/usr/local/codesourcery': No such file or directory >> ********** >> > > You should have an error prior to this one where the script first tried to > create the directory "/usr/local/codesourcery", after which it tries to > chown it. Can you post the entire output of the script rather than the last > line? > > >> Therefore my question is if the script depends on others folders (or >> files) that maybe are not in the 2.5 version. > > > The script does depend on files that are not distributed in LLVM. I just > added a README file to describe what needs to be done and how: > http://llvm.org/svn/llvm-project/llvm/trunk/utils/crosstool/ARM/README . > > Let me know if this helps or if it's not clear. > > Misha > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Juan Carlos Martínez Santos 242 Foster Drive Apt H Colonial Townhouse Apartments Willimantic, CT 06226-1538 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090701/4ef185ae/attachment.html>
On Wed, Jul 1, 2009 at 12:01 PM, Juan Carlos Martinez Santos<juanc.martinez.santos at gmail.com> wrote:> as -meabi=4 -o /tmp/ccYxnIEs.o /tmp/ccy6iYri.s > as: unrecognized option '-meabi=4'[snip]> Any idea what could be wrong?It's probably not finding the right assembler (i.e. using the x86-64 as instead of the arm as). -Eli
Juan Carlos Martinez Santos
2009-Jul-01 20:31 UTC
[LLVMdev] Generatin code for an ARM-LINUX machine
Hello Eli,> It's probably not finding the right assembler (i.e. using the x86-64 > as instead of the arm as).I found that using LLVM-GCC does not work directly; however, if I split the tasks (file.C --> LLVM-GCC --> file.BC --> LLC --> file.S --> ARM-NONE-LINUX-GNUEABI-GCC --> file.ARM) at the end I get my ARM-executable file (work so good in this way) However, now I am looking the source code to include my modifications (passes and my own driver), but I don't know where there are. My question now is how I can include my own modification? Thanks in advance. Juan Carlos On Wed, Jul 1, 2009 at 3:36 PM, Eli Friedman <eli.friedman at gmail.com> wrote:> On Wed, Jul 1, 2009 at 12:01 PM, Juan Carlos Martinez > Santos<juanc.martinez.santos at gmail.com> wrote: > > as -meabi=4 -o /tmp/ccYxnIEs.o /tmp/ccy6iYri.s > > as: unrecognized option '-meabi=4' > [snip] > > Any idea what could be wrong? > > It's probably not finding the right assembler (i.e. using the x86-64 > as instead of the arm as). > > -Eli > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Juan Carlos Martínez Santos 242 Foster Drive Apt H Colonial Townhouse Apartments Willimantic, CT 06226-1538 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090701/e4a0799a/attachment.html>
2009/7/1 Juan Carlos Martinez Santos <juanc.martinez.santos at gmail.com>> I used the snapshots for the latest stable version (70786), and I followed > the instructions inside of README file (very clear!!!) > > However, when I ran the hello program, I get an unrecognized option > message. Bellow are the details. > > ===========================================> jcmartin78 at jcmartin78-laptop:~/LLVM/my-test$ llvmc hello.c > as: unrecognized option '-meabi=4' > ===========================================Sorry, this was my fault. I used the flags --with-gnu-{as,ld} instead of --with-{as,ld} to specify paths to the cross assembler and linker, but it turns out that the former pair of flags are boolean (i.e., telling GCC whether the tools are GNU or not), and the latter are the ones that accept a path. So, llvm-gcc wasn't finding the correct cross-tool assembler and was using /usr/bin/as instead, which doesn't support ARM, and hence doesn't accept "-meabi=4". I've fixed this in SVN. The reason I didn't come across this issue is that I was using llvm-gcc phase-by-phase (as you've found it works), instead of generating binaries directly from llvm-gcc. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090706/80291060/attachment.html>