[LLVMdev] Consumer ARM platform suitable for LLVM development?

Dietmar Ebner ebner at complang.tuwien.ac.at
Mon Mar 16 07:22:36 PDT 2009


On Mar 12, 2009, at 4:30 PM, Misha Brukman wrote:
> I've been trying to build for the target arm-none-linux-gnueabi,  
> using the appropriate pre-built CodeSourcery toolchain, hence  
> avoiding building my own gcc crosstool prior to starting building  
> LLVM and LLVM-GCC.  LLVM builds just fine, it's building llvm-gcc  
> that gives me this error:
> [...]
> ../../../../src/llvm-gcc4.2-2.5.source/gcc/config/arm/arm.md:4788:  
> error: ‘MACHO_DYNAMIC_NO_PIC_P’ undeclared here (not in a function)
I think this error is a result of the switch to Appel's gcc 4.2. I  
cannot say if it's hard to fix these issues (I guess not), but if you  
need a quick solution, you might sill use the 4.0 based frontend. As  
far as I know, the bitcode format should be compatible to the current  
tools (somebody please correct me if I'm wrong).

> Building llvm-gcc was relatively painless. The only problem I've
> encountered was that my target had no hardware floating point support
> and the endianess for the softfloat implementation (libgcc) differed
> from integer endianess, which required some patches at the llvm side.
> I have not checked if this is still necessary. If you run into the
> same problems, I would be happy to share the patch (which I have
> updated to llvm 2.4 at some point).
>
> I would be interested in seeing your patch, if you wouldn't mind  
> sharing it.  Bonus points if you have a script similar to mine above  
> to simplify the entire process, or your notes/directions that I can  
> convert into an easy-to-run script.  :-)

Sorry, there's no such script. But here's how I configured llvm-gcc:
configure --prefix=<wherever> --program-prefix=llvm-arm- --enable- 
llvm=<path to llvm> --enable-checking --target=arm-softfloat-linux-gnu  
--disable-shared --disable-nls --disable-threads --with-float=soft -- 
enable-languages=c

You can find a tiny patch for llvm-gcc and the necessary changes for  
llvm 2.4 attached. The llvm patch should cleanly apply to llvm 2.4,  
but I had to pick the changes from a private repository with some  
modifications. Thus, the patch is untested and I cannot guarantee if I  
got all the necessary bits. Feel free to contact me if you run into  
troubles.

The patch allows to have different endianess for integer and floating  
point types. I'm not sure if this is the best way to handle this  
issue, but at least it seems to be working (I've used it to cross- 
compile SPECINT 2000). Note that you probably won't need all this if  
you have a hardware FPU.

Best,

-
Dietmar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc.patch
Type: application/octet-stream
Size: 2055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090316/c314203a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm2.4-softfloat.patch
Type: application/octet-stream
Size: 10648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090316/c314203a/attachment-0001.obj>
-------------- next part --------------


---------------------------------------------------------------------
Dietmar Ebner
CD Laboratory - Compilation Techniques for Embedded Processors
Institut fuer Computersprachen  E: ebner at complang.tuwien.ac.at
Technische Universitaet Wien    T: (+431) 58801-58521
Argentinierstrasse 8 / E1851    F: (+431) 58801-18598
1040 Wien, Austria              W: www.complang.tuwien.ac.at/cd/ebner







More information about the llvm-dev mailing list