Bug 6818 - toolchainfile.cmake has absolut path references
Summary: toolchainfile.cmake has absolut path references
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-31 15:31 UTC by u.strempel
Modified: 2014-02-13 14:56 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch for generating toolchainfile.cmake with relative-paths (2.43 KB, patch)
2014-02-01 11:27 UTC, u.strempel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description u.strempel 2014-01-31 15:31:38 UTC
On build process of buildroot the toolchainfile.cmake is created, but with wrong absolut path.
When shareing the toolchain or move the folder you get problems this path settings.
i.e. 
set(CMAKE_C_COMPILER /home/dev/Buildroot/../Toolchain/arm-toolchain//usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc)
set(CMAKE_CXX_COMPILER /home/dev/Buildroot/../Toolchain/arm-toolchain//usr/bin/arm-buildroot-linux-uclibcgnueabi-g++)

A workarround for cmake files is
- get the path of the toolchainfile.cmake
And set the the variables.

get_filename_component(CMAKE_TOOLCHAIN_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
set(CMAKE_C_COMPILER ${CMAKE_TOOLCHAIN_PATH}/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_TOOLCHAIN_PATH}/usr/bin/arm-buildroot-linux-uclibcgnueabi-g++)
Comment 1 Thomas Petazzoni 2014-02-01 08:39:04 UTC
That seems like a very good idea indeed! Do you mind sending a proper patch to the mailing list implementing this idea?
Comment 2 u.strempel 2014-02-01 11:27:50 UTC
Created attachment 5192 [details]
Patch for generating toolchainfile.cmake with relative-paths
Comment 3 Thomas De Schampheleire 2014-02-07 08:36:49 UTC
Hi u.strempel, 

Thanks for the patch. Would you mind sending it to the mailing list directly? This will facilitate review and discussion on the patch.
(you need to be subscribed to the list first).

For example, a comment on the patch is that there is now some duplication between e.g. TARGET_CROSS and TARGET_CROSS_WITHOUT_HOST_DIR. This could be fixed by changing the existing assignments to assign to the _WITHOUT_HOST_DIR version, and then have one:
TARGET_CROSS = $(HOST_DIR)/$(TARGET_CROSS_WITHOUT_HOST_DIR)

Thanks, 
Thomas
Comment 4 Thomas De Schampheleire 2014-02-13 14:56:44 UTC
Apparently, the submitter has sent the patch in the meantime:
http://patchwork.ozlabs.org/patch/316696/

I will therefore close this bug and let the patch follow standard patch submission and review process.