All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain
@ 2018-07-19  9:10 陈小刚
  2018-07-19 13:32 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: 陈小刚 @ 2018-07-19  9:10 UTC (permalink / raw)
  To: buildroot

The attachment is a patch that fixes a Realtek toolchain that has a sysroot path of ?mips-linux-uclibc?, this causes the buildroot recognizes the sysroot as ?mips-linux-uc? by the sed operation, and then the external toolchain setup is failed. Adding a ?/? in the sed re expression avoids the wrong substitution, other toolchains like linaro arm toolchain are tested ok to ensure no side effect is induced, please help review and apply this patch, thanks.

Regards
Shawn Chen
Realtek Semiconductor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180719/5b0e5652/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-wrong-sysroot-path-when-given-rsdk-toolchain.patch
Type: application/octet-stream
Size: 1129 bytes
Desc: 0001-fix-wrong-sysroot-path-when-given-rsdk-toolchain.patch
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180719/5b0e5652/attachment.obj>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain
  2018-07-19  9:10 [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain 陈小刚
@ 2018-07-19 13:32 ` Thomas Petazzoni
  2018-07-20  8:21   ` [Buildroot] 答复: " 陈小刚
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2018-07-19 13:32 UTC (permalink / raw)
  To: buildroot

Hello Shawn,

Thanks for your patch, and for contributing to Buildroot!

On Thu, 19 Jul 2018 09:10:03 +0000, ??? wrote:

> The attachment is a patch that fixes a Realtek toolchain that has a
> sysroot path of ?mips-linux-uclibc?, this causes the buildroot
> recognizes the sysroot as ?mips-linux-uc? by the sed operation, and
> then the external toolchain setup is failed. Adding a ?/? in the sed
> re expression avoids the wrong substitution, other toolchains like
> linaro arm toolchain are tested ok to ensure no side effect is
> induced, please help review and apply this patch, thanks.

Would it be possible to get access to this Realtek toolchain? I'd like
to check the behavior, and understand a bit more the issue, because it
looks a bit suspicious/strange.

The sed expression is supposed to replace:

  /path/to/sysroot/usr/lib/libc.a

by:

  /path/to/sysroot/

So I don't quite see how the ending "libc" in mips-linux-uclibc can
affect this.

Also, for your next patches, could you send them with the patch
description in the commit log (currently your commit log is just
"IPCSDK-6460", which is not very useful) ? Also, they should be sent
with "git send-email", so that the patch is inline.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] 答复:  patch: fix wrong sysroot path when given rsdk toolchain
  2018-07-19 13:32 ` Thomas Petazzoni
@ 2018-07-20  8:21   ` 陈小刚
  2018-07-22 21:24     ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: 陈小刚 @ 2018-07-20  8:21 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Thanks for reminding, I'm tweaking my work environment to use git-send-email, it takes a while.
I uploaded the toolchain to Google drive for your test, here is the link:
https://drive.google.com/open?id=1vkrGPUWbzIGMWMZb8DypyK1VIynnbqnn
And a defconfig for your reference:
https://drive.google.com/open?id=1J8ksyWcyXEBfEy0EKrMuH1Zyiif25HrR

In shell you can mimic the buildroot find toolchain sysroot as this:

$ readlink -f $(LANG=C ..../rsdk-6.4.1-5281-EL-4.9-u1.0-m32fut-180611/bin/rsdk-linux-gcc -print-file-name=libc.a)|sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'

Regards
Shawn Chen

-----????-----
???: Thomas Petazzoni [mailto:thomas.petazzoni at bootlin.com] 
????: 2018?7?19? 21:33
???: ???
??: buildroot at buildroot.org; Thomas De Schampheleire
??: Re: [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain

Hello Shawn,

Thanks for your patch, and for contributing to Buildroot!

On Thu, 19 Jul 2018 09:10:03 +0000, ??? wrote:

> The attachment is a patch that fixes a Realtek toolchain that has a
> sysroot path of ?mips-linux-uclibc?, this causes the buildroot
> recognizes the sysroot as ?mips-linux-uc? by the sed operation, and
> then the external toolchain setup is failed. Adding a ?/? in the sed
> re expression avoids the wrong substitution, other toolchains like
> linaro arm toolchain are tested ok to ensure no side effect is
> induced, please help review and apply this patch, thanks.

Would it be possible to get access to this Realtek toolchain? I'd like
to check the behavior, and understand a bit more the issue, because it
looks a bit suspicious/strange.

The sed expression is supposed to replace:

  /path/to/sysroot/usr/lib/libc.a

by:

  /path/to/sysroot/

So I don't quite see how the ending "libc" in mips-linux-uclibc can
affect this.

Also, for your next patches, could you send them with the patch
description in the commit log (currently your commit log is just
"IPCSDK-6460", which is not very useful) ? Also, they should be sent
with "git send-email", so that the patch is inline.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

------Please consider the environment before printing this e-mail.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot]  答复: patch: fix wrong sysroot path when given rsdk toolchain
  2018-07-20  8:21   ` [Buildroot] 答复: " 陈小刚
@ 2018-07-22 21:24     ` Arnout Vandecappelle
  2018-07-23  6:54       ` [Buildroot] 答复: " 陈小刚
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2018-07-22 21:24 UTC (permalink / raw)
  To: buildroot



On 20-07-18 10:21, ??? wrote:
> Hi Thomas,
> 
> Thanks for reminding, I'm tweaking my work environment to use git-send-email, it takes a while.
> I uploaded the toolchain to Google drive for your test, here is the link:
> https://drive.google.com/open?id=1vkrGPUWbzIGMWMZb8DypyK1VIynnbqnn
> And a defconfig for your reference:
> https://drive.google.com/open?id=1J8ksyWcyXEBfEy0EKrMuH1Zyiif25HrR
> 
> In shell you can mimic the buildroot find toolchain sysroot as this:
> 
> $ readlink -f $(LANG=C ..../rsdk-6.4.1-5281-EL-4.9-u1.0-m32fut-180611/bin/rsdk-linux-gcc -print-file-name=libc.a)|sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::'

 libc.a is in mips-linux-uclibc/lib/libc.a. The problem is that the libc.a is
allowed to reside in a subdirectory of lib (the ([^/]*/)? part of the regex).
Since the regex is greedy, it will match the 'libc/' part for the lib* bit, and
'lib/' for the additional subdirectory.

 Anchoring with a / sounds like a good idea to me. Especially since just below,
the toolchain_find_libdir macro *does* anchor at a /.

 Regards,
 Arnout

> 
> Regards
> Shawn Chen
> 
> -----????-----
> ???: Thomas Petazzoni [mailto:thomas.petazzoni at bootlin.com] 
> ????: 2018?7?19? 21:33
> ???: ???
> ??: buildroot at buildroot.org; Thomas De Schampheleire
> ??: Re: [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain
> 
> Hello Shawn,
> 
> Thanks for your patch, and for contributing to Buildroot!
> 
> On Thu, 19 Jul 2018 09:10:03 +0000, ??? wrote:
> 
>> The attachment is a patch that fixes a Realtek toolchain that has a
>> sysroot path of ?mips-linux-uclibc?, this causes the buildroot
>> recognizes the sysroot as ?mips-linux-uc? by the sed operation, and
>> then the external toolchain setup is failed. Adding a ?/? in the sed
>> re expression avoids the wrong substitution, other toolchains like
>> linaro arm toolchain are tested ok to ensure no side effect is
>> induced, please help review and apply this patch, thanks.
> 
> Would it be possible to get access to this Realtek toolchain? I'd like
> to check the behavior, and understand a bit more the issue, because it
> looks a bit suspicious/strange.
> 
> The sed expression is supposed to replace:
> 
>   /path/to/sysroot/usr/lib/libc.a
> 
> by:
> 
>   /path/to/sysroot/
> 
> So I don't quite see how the ending "libc" in mips-linux-uclibc can
> affect this.
> 
> Also, for your next patches, could you send them with the patch
> description in the commit log (currently your commit log is just
> "IPCSDK-6460", which is not very useful) ? Also, they should be sent
> with "git send-email", so that the patch is inline.
> 
> Thanks a lot!
> 
> Thomas
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] 答复:   答复: patch: fix wrong sysroot path when given rsdk toolchain
  2018-07-22 21:24     ` Arnout Vandecappelle
@ 2018-07-23  6:54       ` 陈小刚
  2019-08-01  8:21         ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: 陈小刚 @ 2018-07-23  6:54 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

Thanks for confirming the problem.
I pasted the patch with a refurbished commit msg as below.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot]  答复:  答复: patch: fix wrong sysroot path when given rsdk toolchain
  2018-07-23  6:54       ` [Buildroot] 答复: " 陈小刚
@ 2019-08-01  8:21         ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2019-08-01  8:21 UTC (permalink / raw)
  To: buildroot



On 23/07/2018 08:54, ??? wrote:
> Hi Arnout,
> 
> Thanks for confirming the problem.
> I pasted the patch with a refurbished commit msg as below.
> 
> From f884cb3ed9f920f8516fef0b3246b29751c25704 Mon Sep 17 00:00:00 2001
> From: Shawn Chen <shawn_chen@realsil.com.cn>
> Date: Mon, 23 Jul 2018 14:30:24 +0800
> Subject: [PATCH 1/1] toolchain: avoid unexpected regex substitution
> 
> Anchor the regex in toolchain_find_sysroot macro with a / to avoid
> unexpected substitution for Realtek mips toolchain, for which the libc.a
> path ends with 'mips-linux-uclibc/lib/libc.a'.
> 
> Signed-off-by: Shawn Chen <shawn_chen@realsil.com.cn>

 (Finally) applied to master, thanks.

 Regards,
 Arnout

> ---
>  toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index 8b2c283654..1ae099fd33 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -339,7 +339,7 @@ endef
>  #
>  # And variations on these.
>  define toolchain_find_sysroot
> -$$(printf $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::')
> +$$(printf $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:/(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::')
>  endef
>  
>  # Returns the lib subdirectory for the given compiler + flags (i.e
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-01  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19  9:10 [Buildroot] patch: fix wrong sysroot path when given rsdk toolchain 陈小刚
2018-07-19 13:32 ` Thomas Petazzoni
2018-07-20  8:21   ` [Buildroot] 答复: " 陈小刚
2018-07-22 21:24     ` Arnout Vandecappelle
2018-07-23  6:54       ` [Buildroot] 答复: " 陈小刚
2019-08-01  8:21         ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.