Skip to content

Can we have a toolchain for the RPi? #2

Closed
wittybear opened this Issue Oct 25, 2012 · 5 comments

5 participants

@wittybear

At the moment the "buildme" defines "CMAKE_TOOLCHAIN_FILE" which is designed to use the cross compiler. Would it be possible to add a ".cmake" configuration for use on the RPi please?

@popcornmix

Never tried building it on the Pi, but should be trivial to create a .cmake configuration. Patches / Pull Requests welcome.

@wittybear

Ah! Not quite as straight forward as I first thought. You do need another .cmake config file, I copied the original one and changed the cmake compilers to the vanilla gcc and g++ ones. However this does not work, cmake document explains why here: (see: http://www.cmake.org/Wiki/CMake_Useful_Variables). So the next step is to copy the buildme script to build_on_pi and I added the settings of the cmake compiler vars onto the cmake command:

cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE=..

I'm still coming up to speed with 'git' as I am an 'svn' user :) ... so not sure if I can send a patch yet. But this should be enough info for a wiki or similar to help others out.

@pilfs
pilfs commented Nov 13, 2012

Here's a simple sed if all you want to do is compile userland natively on the Pi:
sed -i 's/if (DEFINED CMAKE_TOOLCHAIN_FILE)/if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)/g' makefiles/cmake/arm-linux.cmake

Now you can just build and ignore the toolchain stuff like so:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install

@zanco
zanco commented Jul 18, 2013

@pilfs
Thank you ! After hours of searching your solution was the easyiest to get the userland installed on my Pi.

@dmopalmer dmopalmer referenced this issue Sep 1, 2013
Closed

Build fails #79

@dmopalmer dmopalmer added a commit that referenced this issue Sep 7, 2013
@dmopalmer dmopalmer Native build
Changes to allow the Raspberry Pi to natively build the userland.
Assumes that any armv6l (as returned by the arch(1) command)
is a Raspberry Pi and changes the compile accordingly.
Fix for issues #2 and #79
a4dc68f
@popcornmix popcornmix added a commit that referenced this issue Sep 7, 2013
@dmopalmer dmopalmer Native build
Changes to allow the Raspberry Pi to natively build the userland.
Assumes that any armv6l (as returned by the arch(1) command)
is a Raspberry Pi and changes the compile accordingly.
Fix for issues #2 and #79
775cf0b
@dmopalmer

Pull request #81, now in the main branch, changes the buildme script so it compiles properly on the Pi.

@popcornmix popcornmix closed this Sep 11, 2013
@JamesH65 JamesH65 referenced this issue in JamesH65/userland Sep 25, 2013
@dmopalmer dmopalmer Native build
Changes to allow the Raspberry Pi to natively build the userland.
Assumes that any armv6l (as returned by the arch(1) command)
is a Raspberry Pi and changes the compile accordingly.
Fix for issues #2 and #79
8328b41
@JamesH65 JamesH65 referenced this issue in JamesH65/userland Sep 25, 2013
@dmopalmer dmopalmer Native build
Changes to allow the Raspberry Pi to natively build the userland.
Assumes that any armv6l (as returned by the arch(1) command)
is a Raspberry Pi and changes the compile accordingly.
Fix for issues #2 and #79
69681a3
@JamesH65 JamesH65 referenced this issue in JamesH65/userland Sep 26, 2013
@dmopalmer dmopalmer Native build
Changes to allow the Raspberry Pi to natively build the userland.
Assumes that any armv6l (as returned by the arch(1) command)
is a Raspberry Pi and changes the compile accordingly.
Fix for issues #2 and #79
ba38f5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.