Hello everyone,
I have built an fsl-image-qt5 image for MACHINE=imx6ulevk (the evaluation kit board). Then, I used 'bitbake –c populate_sdk fsl-image-qt5 ' option to create the '.sh' file to deply the toolchain for the system, installed under '/opt/fsl-imx-x11/4.1.15-1.2.0/'
Afterwards, in Eclipse Luna I installed the Yocto ADT plugin and built a Hello World application with Autotools without problem. However, when creating a new Hello World C++ application with 'Yocto Project ADT CMake' I have not been able to build the component, obtaining the following output in CMakeError.log (among other messages):
Determining if the C compiler works failed with the following output:
Change Dir: /home/user/wstest/HelloCmake/Debug/CMakeFiles/CMakeTmpRun Build Command:/usr/bin/make "cmTryCompileExec1629254916/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1629254916.dir/build.make CMakeFiles/cmTryCompileExec1629254916.dir/build
make[1]: se ingresa al directorio «/home/user/wstest/HelloCmake/Debug/CMakeFiles/CMakeTmp»
/usr/bin/cmake -E cmake_progress_report /home/user/wstest/HelloCmake/Debug/CMakeFiles/CMakeTmp/CMakeFiles 1Building C object CMakeFiles/cmTryCompileExec1629254916.dir/testCCompiler.c.o
/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/user/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -o CMakeFiles/cmTryCompileExec1629254916.dir/testCCompiler.c.o -c /home/user/wstest/HelloCmake/Debug/CMakeFiles/CMakeTmp/testCCompiler.cLinking C executable cmTryCompileExec1629254916
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1629254916.dir/link.txt --verbose=1
/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/user/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk --sysroot=/home/user/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk CMakeFiles/cmTryCompileExec1629254916.dir/testCCompiler.c.o -o cmTryCompileExec1629254916 -rdynamic/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: error: cmTryCompileExec1629254916 uses VFP register arguments, CMakeFiles/cmTryCompileExec1629254916.dir/testCCompiler.c.o does not
/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: failed to merge target specific data of file CMakeFiles/cmTryCompileExec1629254916.dir/testCCompiler.c.o
collect2: error: ld returned 1 exit status
make[1]: se sale del directorio «/home/user/wstest/HelloCmake/Debug/CMakeFiles/CMakeTmp»
make[1]: *** [cmTryCompileExec1629254916] Error 1
make: *** [cmTryCompileExec1629254916/fast] Error 2
It seems an internal CMake test is failing...but I do not know why :S
I ran:
source /opt/fsl-imx-x11/4.1.15-1.2.0/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
before starting Eclipse.
What is going on? Thanks in advance.
Solved! Go to Solution.
The solution is to set correctly the flags for the compiler in the toolchain.cmake file (note the -march, -mfpu, -mtune in the following lines):
# CMake system name must be something like "Linux".
# This is important for cross-compiling.
set(CMAKE_SYSTEM_PROCESSOR )
set(CMAKE_C_COMPILER arm-poky-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-poky-linux-gnueabi-g++)set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk" CACHE STRING "CFLAGS")
set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -fpermissive" CACHE STRING "CXXFLAGS")
set(CMAKE_C_FLAGS_RELEASE "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -DNDEBUG" CACHE STRING "CFLAGS for release")
set(CMAKE_CXX_FLAGS_RELEASE "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -DNDEBUG" CACHE STRING "CXXFLAGS for release")
set(CMAKE_C_LINK_FLAGS "" CACHE STRING "LDFLAGS")
set(CMAKE_CXX_LINK_FLAGS "" CACHE STRING "LDFLAGS")
The solution is to set correctly the flags for the compiler in the toolchain.cmake file (note the -march, -mfpu, -mtune in the following lines):
# CMake system name must be something like "Linux".
# This is important for cross-compiling.
set(CMAKE_SYSTEM_PROCESSOR )
set(CMAKE_C_COMPILER arm-poky-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-poky-linux-gnueabi-g++)set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk" CACHE STRING "CFLAGS")
set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -fpermissive" CACHE STRING "CXXFLAGS")
set(CMAKE_C_FLAGS_RELEASE "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -DNDEBUG" CACHE STRING "CFLAGS for release")
set(CMAKE_CXX_FLAGS_RELEASE "-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/moviloc/fsl-release-bsp/build_qt5/tmp/sysroots/imx6ulevk -DNDEBUG" CACHE STRING "CXXFLAGS for release")
set(CMAKE_C_LINK_FLAGS "" CACHE STRING "LDFLAGS")
set(CMAKE_CXX_LINK_FLAGS "" CACHE STRING "LDFLAGS")
Hi Alvaro,
thank you for sharing your solution.
Regards,
Carlos