Build LLVM/Clang for Pandaboard

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Build LLVM/Clang for Pandaboard

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
 - $ 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
Reply | Threaded
Open this post in threaded view
|

Re: Build LLVM/Clang for Pandaboard

Justin Holewinski
On Tue, Jun 5, 2012 at 11:05 PM, Yuan-Yi Chang <[hidden email]> 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 <a href="http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final/ llvm-src/" target="_blank">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
<a href="http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_31/final/ compiler-rt" target="_blank">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
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



--

Thanks,

Justin Holewinski


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Build LLVM/Clang for Pandaboard

Justin Holewinski
(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 <[hidden email]> 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 <[hidden email]>
On Tue, Jun 5, 2012 at 11:05 PM, Yuan-Yi Chang <[hidden email]> 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/

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

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
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



--

Thanks,

Justin Holewinski





--

Thanks,

Justin Holewinski


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev