[cfe-dev] Build LLVM/Clang for Pandaboard

Justin Holewinski justin.holewinski at gmail.com
Wed Jun 6 10:11:22 PDT 2012


(please keep these discussions on-list for the benefit of others)

As long as you build the ARM back-end for LLVM and have an ARM sysroot on
your x86 machine, you can use Clang on the x86 machine to compile ARM
binaries.  I've only played around with this a few times, but I was able to
build hard-float ARM binaries on an x64 Linux host and run them on a Panda
Board running Arch Linux.

You can try something like:
$ clang -ccc-host-triple armv7l-unknown-linux-gnueabihf -mfloat-abi=hard
-integrated-as <file>.c

This worked for my simple cases.  If you need C++, you'll have to obtain an
ARM libstdc++ and probably use -sysroot to specify the system include/lib
paths.  This goes beyond my experience for this setup, however, so someone
else will have to chime in here.

On Wed, Jun 6, 2012 at 9:06 AM, Yuan-Yi Chang <changyy.csie at gmail.com>wrote:

> Yes.
>
> Building the ARM binaries from a x86 host is more convenient and fast. Is
> there any docs? It's interesting to build the LLVM for Android ICS on
> Pandaboard, too.
>
> Thanks,
> Yuan-Yi Chang
>
> 2012/6/6 Justin Holewinski <justin.holewinski at gmail.com>
>
>> On Tue, Jun 5, 2012 at 11:05 PM, Yuan-Yi Chang <changyy.csie at gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I'm new to LLVM World! I wanna build LLVM for Pandaboard Platform. Is
>>> there
>>> any better method without building on pandaboard?
>>>
>>> current status:
>>>
>>> Device: Pandaboard ES
>>> OS: ubuntu-12.04-preinstalled-server-armhf+omap4
>>> SD: Transcend SDHC Class10 8GB
>>>
>>> 1.Install Ubuntu 12.04 server on Pandaboard
>>> (ubuntu-12.04-preinstalled-server-armhf+omap4.img.gz)
>>> 2.Initial building enviroments
>>>  - $ sudp apt-get update && sudo apt-get upgrade
>>>  - $ sudo apt-get install subversion gcc g++ make cmake
>>> 3.Get LLVM/Clang source code
>>>  - $ svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final/
>>> llvm-src/<http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final/llvm-src/>
>>>  - $ cd ~/llvm-src/tools/
>>>  - $ svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final/
>>> clang
>>>  - $ cd ~/llvm-src/projects/
>>>  - $ svn co
>>> http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_31/final/
>>> compiler-rt<http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_31/final/compiler-rt>
>>> 4. Build it
>>>  - $ mkdir ~/bulid && cd ~/build && cmake
>>> -DCMAKE_INSTALL_PREFIX:PATH=$HOME/out ../llvm-src
>>>  - $ make -j2 (about 120 mins)
>>>  - $ make install
>>> 5. Testing
>>>  - $ ~/out/bin/llvm-config
>>>   llvm-config --version
>>>   3.1svn
>>>  - $ ~/out/bin/clang --version
>>>   clang version 3.1 (tags/RELEASE_31/final 158045)
>>>   Target: armv7l-unknown-linux-gnueabihf
>>>   Thread model: posix
>>>
>>
>> I'm not really sure what you're asking.  You seem to have it built and
>> running on the PandaBoard.  Are you wanting to build ARM binaries from an
>> x86 host?
>>
>>
>>>
>>> Best Regards,
>>> Yuan-Yi Chang
>>>
>>> --
>>> View this message in context:
>>> http://clang-developers.42468.n3.nabble.com/Build-LLVM-Clang-for-Pandaboard-tp4024304.html
>>> Sent from the Clang Developers mailing list archive at Nabble.com.
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>
>>
>>
>> --
>>
>> Thanks,
>>
>> Justin Holewinski
>>
>>
>


-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120606/e14c3b19/attachment.html>


More information about the cfe-dev mailing list