Can we have a toolchain for the RPi? #2

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

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@popcornmix

popcornmix Oct 25, 2012

Contributor

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

Contributor

popcornmix commented Oct 25, 2012

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

@wittybear

This comment has been minimized.

Show comment
Hide comment
@wittybear

wittybear Oct 26, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@pilfs

pilfs 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

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

This comment has been minimized.

Show comment
Hide comment
@zanco

zanco Jul 18, 2013

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

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

popcornmix added a commit that referenced this issue Sep 7, 2013

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
@dmopalmer

This comment has been minimized.

Show comment
Hide comment
@dmopalmer

dmopalmer Sep 11, 2013

Contributor

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

Contributor

dmopalmer commented Sep 11, 2013

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 referenced this issue in JamesH65/userland Sep 25, 2013

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

JamesH65 referenced this issue in JamesH65/userland Sep 25, 2013

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

JamesH65 referenced this issue in JamesH65/userland Sep 26, 2013

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

jfmherokiller added a commit to jfmherokiller/userland that referenced this issue Oct 13, 2017

# This is a combination of 3 commits.
# This is the 1st commit message:

define handle and addr to long
# The commit message #2 will be skipped:

# remove khrn_int_hash_asm.s for aarch64, change 32-bit pointer to 64-bit

# The commit message #3 will be skipped:

# set builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment