CMAKE cross compiler failing.
Build setup cmake 3.5.1 **uname : **4.4.0-130-generic #156 (closed)-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux **linux native compiler : **gcc version 4.9.4 (Ubuntu 4.9.4-2ubuntu1~16.04) cross compiler : gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977] (GNU Tools for ARM Embedded Processors)
I've two build setup, both generating executable one for linux desktop and other on target board. 1 ) LINUX 32 bit (gcc /g++) 2 ) Cross compiler ( arm-none-eabi-gcc/g++ ) 3 ) Static lib eclipse project & Executable eclipse project.
In my project I've multiple static libraries and an executable generated after linking with those static libs.
CMAKE for Linux executable static libraries created and executable also generated.
CMAKE for cross compile arm target executable While creating the static library,cmake compiler test throws _exit() function undefined. I'm not able to resolve from there.( stuck )
I've googled quite a lot and not able to move further. Attached the toolchain.cmake.
Following queries,
- When creating the static lib for cross compiler , why creating the executable ? ( Is that cmake check whether executable can be created ) 2)In the ToolChain.cmake already provided where to look for all the Target libraries. 3)Using --debug-trycompile looked into the CMakeList.txt file created "CMakeFiles/CMakeTmp/CMakeList.txt" and found link_directories(${LINK_DIRECTORIES}) and tried searching for "LINK_DIRECTORIES", but not result.
So, not sure how to proceed.
//////// (Not able to attach as a file , network slowToolChain.cmake)
# this one is important
SET(CMAKE_SYSTEM_NAME Generic)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_CROSSCOMPILING 1)
set(triple arm-none-eabi)
# specify the cross compiler
SET(CMAKE_C_COMPILER /home/jithin/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc)
SET(CMAKE_C_COMPILER_TARGET ${triple})
SET(CMAKE_CXX_COMPILER /home/jithin/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-g++)
SET(CMAKE_CXX_COMPILER_TARGET ${triple})
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /home/jithin/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3 /home/jithin/Documents/NBR/NBR_BSW/NBR/DEV/framework/lib)
# 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(CMAKE_TRY_COMPILE_NO_LINK 1)