[Buildroot] Relocatable internal toolchain

Wolfgang Grandegger wg at grandegger.com
Wed Feb 1 08:13:55 UTC 2017


Hello,

Am 30.01.2017 um 10:36 schrieb Wolfgang Grandegger:
> Hi Samuel,
>
> Am 30.01.2017 um 09:14 schrieb Samuel Martin:
>> Hi Wolfgang, all,
>>
>> On Mon, Jan 30, 2017 at 8:31 AM, Wolfgang Grandegger <wg at grandegger.com> wrote:
>>>
>>> Buildroot's build system is quite new too me. At a first glance it's rather
>>> heavy stuff! So I first tried the patches you mentioned to see what I get.
>>> After some tweaking due to "file permissions" and "file in use" issues with
>>> patchelf, the build did succeed. But subsequent builds then required setting
>>> LD_LIBRARY_PATH for the host tools. Then I moved the buildroot output
>>> directory to a different location to see if relocation, as I understand it,
>>> works. My test cases are some out-of-tree QT5 examples:
>>>
>>>   $ cd <a-path>/examples
>>>   $ <path-to-buildroot-output>/host/usr/bin/qmake
>>>   Could not find qmake configuration file devices/linux-buildroot-g++.
>>>   Error processing project file: /home/wolf/junk/examples/examples.pro
>>>
>>> How do I set the new path to the toolchain. Likely I have missed something.
>>
>> I have no clue about this, but a quick google search gives me a
>> possible way to fix/workaround this [5] (with no warranty at all).
>
> See below...
>
>>> Apart from the "rpath", the path to the build directory is also in many text
>>> (configuration scripts, etc.) files. What did work for me was replacing the
>>> path to the build directory ("<buildroot-output>/host/usr") with the new
>>> location in all text files.
>>>
>>> Not sure if we speak/think about the same "relocation" behaviour.
>>
>> Yes we are, I just forgot to give the main link to this task, which
>> details many things to fix/support for a complete relocatable SDK.
>> Note that the series I posted just dealt with the rpath point so far,
>> unstacking one point after the other.
>
> OK, I see! The script I mentioned does:
>
>   for FILE in $(grep -r  "${FINDSTR}"  . -l ) ; do
> 	if [ ! -h ${FILE} ] && [ -n  "$(file ${FILE} | cut -d: -f2 | grep text )" ]
> 		then
> 		echo ${FILE}
> 		sed -i s,"${FINDSTR}",${REPLACESTR},g ${FILE}
> 	fi 	
>   done
>
> Such a script is mentioned in [6]. Relocation works fine (for me) also
> without fixing "rpath", and for the qmake examples above.
>
>> [5] http://doc.qt.io/qt-5/qmake-environment-reference.html
>> [6] http://elinux.org/Buildroot#Core_Buildroot_infrastructure
>
> It's getting clearer what has do be done...

Digging deeper... Is there a simple way of re-triggering the population 
of the host, staging and target trees without doing a make clean?

Wolfgang.



More information about the buildroot mailing list