Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for cross compiling with linaro toolchain #188

Open
michael-ring opened this issue Apr 9, 2015 · 1 comment
Open

Support for cross compiling with linaro toolchain #188

michael-ring opened this issue Apr 9, 2015 · 1 comment

Comments

@michael-ring
Copy link

I today discovered the directory cmake/Toolchains, a nice place to put my cmake toolchain file for crosscompiling the arm targets.

I am not a cmake guru, perhaps you guys can have a look on how to better optimize the file so that it works for as much platforms as possible:

One easy thing to do is to remove the absolute paths to gcc and g++,
I am not sure how to handle

SET(CMAKE_FIND_ROOT_PATH /usr/local/linaro/arm-linux-gnueabihf/)
or
SET(SYSTEM_USR_DIR /usr/local/linaro/arm-linux-gnueabihf/)
in an (if possible) system independant way.

Michael


# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER   /usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  /usr/local/linaro/arm-linux-gnueabihf/)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(SYSTEM_USR_DIR /usr/local/linaro/arm-linux-gnueabihf/)
@michael-ring michael-ring changed the title Support for cross compiling with linareo toolchain Apr 9, 2015
@arfoll
Copy link
Contributor

arfoll commented Apr 9, 2015

Looks ok tbh, the cool thing about the oe/yocto toolchain is that it comes with it's own 'env' file so that compiler paths etc don't have to be hard set. Does the linaro toolchain not come with something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants