Build LLVM/Clang for Pandaboard

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/
- $ 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
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

Best Regards,
Yuan-Yi Chang

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

  1. Build it
  • $ mkdir ~/bulid && cd ~/build && cmake
    -DCMAKE_INSTALL_PREFIX:PATH=$HOME/out …/llvm-src
  • $ make -j2 (about 120 mins)
  • $ make install
  1. 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?

(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 .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.