[Buildroot] [PATCH v2] toolchain: add a harmless link when sysroot detection is not accurate

Romain Naour romain.naour at gmail.com
Sat Apr 30 19:27:33 UTC 2016


Hi Thomas,

Le 02/02/2016 à 16:30, Romain Naour a écrit :
> Hi Vicente,
> 
> Le 02/02/2016 16:14, Vicente Olivert Riera a écrit :
>> Hello Romain,
>>
>> On 02/02/16 15:21, Romain Naour wrote:
>>> Hi Vicente,
>>>
>>> Le 02/02/2016 11:57, Vicente Olivert Riera a écrit :
>>>> ping
>>>>
>>>> Currently Codescape MIPS toolchains are broken for big-endian. This patch fixes
>>>> the problem.
>>>>
>>>> On 22/01/16 16:05, Vicente Olivert Riera wrote:
>>>>> Sometimes is not possible to detect if the sysroots are nested or side
>>>>> by side. For instance this happens for MIPS big endian, where the
>>>>> sysroot and the arch-sysroot directories are the same. Examples:
>>>
>>> By sometime, you mean toolchains generated by Crosstool-ng and Buildroot which
>>> doesn't support multi-lib.
>>
>> Only toolchains generated by Crosstool-ng and Buildroot? Are you sure about
>> that? I think the Codescape toolchains are not generated by Crosstool-ng and
>> they do support multi-lib.
> 
> Well, I checked with two of the autobuilder toolchains:
> 
> http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2015.11-rc1-71-g90d1299.tar.bz2
> 
> http://autobuild.buildroot.org/toolchains/tarballs/i686-ctng-linux-gnu.tar.xz
> 
> And I get this:
> 
> SYSROOT_DIR_CANON:
> /home/naourr/git/buildroot/test/musl/host/opt/ext-toolchain/arm-buildroot-linux-musleabihf/sysroot
> ARCH_SYSROOT_DIR_CANON:
> /home/naourr/git/buildroot/test/musl/host/opt/ext-toolchain/arm-buildroot-linux-musleabihf/sysroot
> 
> Unable to detect if sysroots are nested or side by side.
> Creating a harmless symlink necessary for certain toolchains.
> Symlinking
> /home/naourr/git/buildroot/test/musl/host/usr/arm-buildroot-linux-musleabihf/sysroot/sysroot
> -> ./
> 
> 
>>
>>>>>
>>>>> === Mentor Sourcery CodeBench toolchain
>>>>>
>>>>> $ readlink -f $(LANG=C mips-linux-gnu-gcc -print-file-name=libc.a) | sed
>>>>> -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'
>>>>> /toolchains/mips-2015.11/mips-linux-gnu/libc/
>>>>>
>>>>> $ readlink -f $(LANG=C mips-linux-gnu-gcc -EB -print-file-name=libc.a) |
>>>>> sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'
>>>>> /toolchains/mips-2015.11/mips-linux-gnu/libc/
>>>>>
>>>>> === Codescape toolchain
>>>>>
>>>>> $ readlink -f $(LANG=C mips-img-linux-gnu-gcc -print-file-name=libc.a) |
>>>>> sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'
>>>>> /toolchains/mips-img-linux-gnu/2015.06-05/sysroot/mips-r6-hard/
>>>>>
>>>>> $ readlink -f $(LANG=C mips-img-linux-gnu-gcc -EB
>>>>> -print-file-name=libc.a) | sed -r -e
>>>>> 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'
>>>>> /toolchains/mips-img-linux-gnu/2015.06-05/sysroot/mips-r6-hard/
>>>>>
>>>>> For those cases where the sysroot detection is not accurate we add a
>>>>> harmless symlink necessary for certain toolchains such as Codescape for
>>>>> MIPS. The other toolchains in this situation (unknown sysroot layout)
>>>>> don't need this symlink to work, but as stated before, this symlink is
>>>>> harmless.
>>>
>>> Since Codescape are supported in Buildroot as external toolchain and the issue
>>> appear only with it for BE, you can probability use a
>>> TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS like for some Linaro toolchains
>>> instead ?
>>>
>>> Thoughts ?
>>
>> Well, the whole point for this patch [1] was to get rid of that hook (which was
>> the first approach when I sent the patches to add the Codescape toolchains) and
>> add that functionality in the toolchain infra just in case more toolchains with
>> this problem were added in the future.
> 
> I understand, let see what maintainers says.

Like for CodeSourcery AArch64 toolchain recently [1], what about adding a
post-install hook instead ?

[1]
https://git.busybox.net/buildroot/commit/?id=4d39ca1c2ab19766abf0430abe9b65ba0e16602b

Best regards,
Romain

> 
> Best regards,
> Romain
> 
>>
>> 1:
>> https://git.busybox.net/buildroot/commit/?id=9a1e9efe2618ebbf12ed2567bcd6e8cca5619547
>>
>>
>> Maintainers, thoughts?
>>
>>>>>
>>>>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera at imgtec.com>
>>>>> ---
>>>>> Changes v1 -> v2:
>>>>>    - Update the comment above the copy_toolchain_sysroot function.
>>>>>    - Explain in the commit log which toolchains are affected and provide
>>>>>      some outputs of -print-file-name to explain the problem.
>>>>>      (Both changes requested by Thomas Petazzoni)
>>>>>




More information about the buildroot mailing list