[Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable

Wolfgang Grandegger wg at grandegger.com
Thu Jun 29 08:02:15 UTC 2017


Hello Arnout,

about rpath sanitazion of patchelf and m4...

Am 29.06.2017 um 08:13 schrieb Wolfgang Grandegger:
> 
> 
> Am 28.06.2017 um 21:33 schrieb Arnout Vandecappelle:
>>
>>
>> On 28-06-17 14:36, Wolfgang Grandegger wrote:
>>>
>>>
>>> Am 28.06.2017 um 13:16 schrieb Arnout Vandecappelle:
>>>>
>>>>
>>>> On 28-06-17 12:57, Wolfgang Grandegger wrote:
>>>> [snip]
>>>>> The list is built with "comm -13 ...". While implementing that way, 
>>>>> I realized
>>>>> that I need patchelf for the host as very first package. Any idea 
>>>>> how that could
>>>>> achieved?
>>>>
>>>>    host-patchelf should be added to DEPENDENCIES_HOST_PREREQ so it 
>>>> gets built
>>>> before all the rest. In the instrumentation hook, you should also 
>>>> skip the
>>>> sanitization when the package is not in DEPENDENCIES_HOST_PREREQ.
>>>
>>> I thought all host binaries must have an rpath to <path>/usr/lib, 
>>> which should
>>> be replaced with "$ORIGIN/../../../usr/lib"
>>
>>   Only if they use a library in $HOST_DIR/usr/lib - otherwise 
>> sanitize-rpath will
>> remove the rpatch completely, no?
> 
> Makes sense.
> 
>>   DEPENDENCIES_HOST_PREREQ contains only a few packages, none of which 
>> are linked
>> with any library in $HOST_DIR/usr/lib. At least I think so.
> 
> In may case it only contains "patchelf", which needs rpath sanitation.
> 
>>>>    That means that those packages will not get sanitized - which 
>>>> shouldn't be
>>>> necessary since they anyway don't have an rpath. But perhaps it's a 
>>>> good idea
>>>> then to add a readelf-based check for them that verifies they don't 
>>>> have
>>>> DT_RUNPATH or DT_RPATH. The latter is just a nice-to-have, though, 
>>>> so don't
>>>> worry about it at first.
>>>
>>> See above.
>>>
>>> Even with setting DEPENDENCIES_HOST_PREREQ to patchelf at the first 
>>> place, some
>>> packages are required in advance to build patchelf :(.
>>
>>   Really? Which ones? patchelf has no dependencies.
> 
>    host-m4-1.4.18
>    host-libtool-2.4.6
>    host-autoconf-2.69
>    host-automake-1.15
>    host-patchelf-29c085fd9d3fc972f75b3961905d6b4ecce7eb2b
> 
> Here is the order in which the packages are built. Patchelf needs 
> automake and friends. The "host-m4" binary m4 has an rpath;
> 
> <buildroot-build-dir>/host/usr/lib
> 
> The others have perl scripts only. Hence, we need to sanitize the 
> "host-m4" package after patchelf is available. Not too bad.

Neither patchelf nor m4 uses libraries from /usr/lib and therefore the 
rpath is empty. A mistake in my scripts confused me... sorry for the noise.

Wolfgang.

> 
> Wolfgang.



More information about the buildroot mailing list