Modify

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#9131 closed defect (fixed)

librpc (using cmake) breaks on external toolchain

Reported by: dev@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Trunk
Keywords: cmake, external toolchain Cc:

Description

I'm using the nearly current OpenWrt from git ( 5034ff8395447d72b427867fc3469b3601cd83f2 ) and librpc breaks when using an external (OpenWrt-) toolchain. I use this with Hudson to have 2 separate builds because when doing 'git clean -r -d -x' the toolchain would be lost and the build would take to long for small changes.

Here is how to reproduce:

  1. Compile a normal at91 OpenWrt project in directory 'tc'
  2. Add a second checkout in directory 'base' and set the toolchain path in make menuconfig to the 'tc/staging...' directory
  3. Now do a make in the 'base'

Everything compiles fine till 'librpc' which is using cmake. I found out that in include/cmake.mk the path to the toolchain is set using TOOLCHAIN_DIR. Setting this to TOOLCHAIN_ROOT_DIR as defined in rules.mk does the trick for me but I don't know if this is the right solution.

Bye,

Sven

Attachments (2)

0001-cmake-librpc-fix-for-using-external-toolchain.patch (968 bytes) - added by Sven Bachmann <dev@…> 5 years ago.
patch for cmake to work with external toolchain
0001-set-TOOLCHAIN_DIR-var-when-using-external-toolchain.patch (785 bytes) - added by Sven Bachmann <dev@…> 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Sven Bachmann <dev@…>

This is the output of make package/librpc/compile V=99. As you can see, the define CMAKE_C_COMPILER is set to the local compiler instead of Product_Toolchain.

make[1]: Entering directory `/var/lib/hudson/jobs/Product/workspace/openwrt'
make[2]: Entering directory `/var/lib/hudson/jobs/Product/workspace/openwrt/package/librpc'
(cd /var/lib/hudson/jobs/Product/workspace/openwrt/build_dir/target-arm-openwrt-linux-uclibcgnueabi/librpc-0.9.32-rc2; CFLAGS="-Os -pipe -march=armv5te -mtune=arm926ej-s -funit-at-a-time -fhonour-copts -msoft-float " CXXFLAGS="-Os -pipe -march=armv5te -mtune=arm926ej-s -funit-at-a-time -fhonour-copts -msoft-float " cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_C_COMPILER="/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc" -DCMAKE_C_COMPILER_ARG1="" -DCMAKE_CXX_COMPILER="/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-g++" -DCMAKE_CXX_COMPILER_ARG1="" -DCMAKE_EXE_LINKER_FLAGS="-L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/usr/lib -L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/lib -L/var/lib/hudson/jobs/Product_Toolchain/workspace/openwrt/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/lib" -DCMAKE_MODULE_LINKER_FLAGS="-L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/usr/lib -L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/lib -L/var/lib/hudson/jobs/Product_Toolchain/workspace/openwrt/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/lib" -DCMAKE_SHARED_LINKER_FLAGS="-L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/usr/lib -L/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi/lib -L/var/lib/hudson/jobs/Product_Toolchain/workspace/openwrt/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/lib" -DCMAKE_FIND_ROOT_PATH=/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/host -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/target-arm-openwrt-linux-uclibcgnueabi -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/usr  . )
-- The C compiler identification is unknown
-- Check for working C compiler: /var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc
CMake Error: your C compiler: "/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: /var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc -- broken
CMake Error at /var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/host/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler
  "/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc"
  is not able to compile a simple test program.

  It fails with the following output:


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: your C compiler: "/var/lib/hudson/jobs/Product/workspace/openwrt/staging_dir/toolchain-arm-openwrt-linux-uclibcgnueabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

Changed 5 years ago by Sven Bachmann <dev@…>

patch for cmake to work with external toolchain

Changed 5 years ago by Sven Bachmann <dev@…>

comment:2 Changed 5 years ago by Sven Bachmann <dev@…>

Correction: Using the first [1] patch breaks the build of the toolchain. The second [2] patch is compatible with the toolchain and the external build.

[1] 0001-cmake-librpc-fix-for-using-external-toolchain.patch
[2] 0001-set-TOOLCHAIN_DIR-var-when-using-external-toolchain.patch

comment:3 Changed 5 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

added in r26405

comment:4 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.