Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] More external toolchain fixes
@ 2008-10-30  9:02 Thomas Petazzoni
  2008-10-31 13:18 ` Bernhard Reutner-Fischer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2008-10-30  9:02 UTC (permalink / raw)
  To: buildroot

Fix issues with binary external toolchains

Fix two problems encountered while using an external binary toolchain
generated by crosstool-ng:

 - Don't remove the ending / in LIB_DIR, otherwise find $LIB_DIR
   -maxdepth 1 doesn't find any file in the case LIB_DIR is a symbolic
   link and not a directory.

   For some reason, find -maxdepth 1 doesn't have the same behaviour
   on directories and symbolic links. Demonstration:

   $ mkdir foobar
   $ touch foobar/t1
   $ touch foobar/t2
   $ ln -s foobar barfoo
   $ find foobar -maxdepth 1 -name 't*'
   foobar/t1
   foobar/t2
   $ find barfoo -maxdepth 1 -name 't*'
   $ find barfoo/ -maxdepth 1 -name 't*'
   barfoo/t1
   barfoo/t2

 * Make sure the libraries are writable, otherwise the strip operation
   might fail. The library files may not be writable if the toolchain
   is not writable (which may happen if one wants to prevent anyone
   from overwriting the toolchain, which is done by crosstool-ng, for
   example).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: buildroot/toolchain/external-toolchain/ext-tool.mk
===================================================================
--- buildroot.orig/toolchain/external-toolchain/ext-tool.mk
+++ buildroot/toolchain/external-toolchain/ext-tool.mk
@@ -10,7 +10,7 @@
 	DST="$(strip $2)"; \
 	STRIP="$(strip $3)"; \
  \
-	LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,/$${LIB}\$$,,"`; \
+	LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \
  \
 	if test -z "$${LIB_DIR}"; then \
 		echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \
@@ -28,6 +28,7 @@
 				cp -d $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/; \
 			elif test -f $${LIB_DIR}/$${LIB}; then \
 				cp $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/$${LIB}; \
+				chmod u+w $(TARGET_DIR)$${DST}/$${LIB}; \
 				case "$${STRIP}" in \
 				(0 | n | no) \
 ;; \


-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] More external toolchain fixes
  2008-10-30  9:02 [Buildroot] [PATCH] More external toolchain fixes Thomas Petazzoni
@ 2008-10-31 13:18 ` Bernhard Reutner-Fischer
  2008-10-31 18:38 ` hartleys
  2008-11-03 10:33 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Bernhard Reutner-Fischer @ 2008-10-31 13:18 UTC (permalink / raw)
  To: buildroot

On Thu, Oct 30, 2008 at 10:02:47AM +0100, Thomas Petazzoni wrote:
>Fix issues with binary external toolchains
>
>Fix two problems encountered while using an external binary toolchain
>generated by crosstool-ng:
>
> - Don't remove the ending / in LIB_DIR, otherwise find $LIB_DIR
>   -maxdepth 1 doesn't find any file in the case LIB_DIR is a symbolic
>   link and not a directory.
>
>   For some reason, find -maxdepth 1 doesn't have the same behaviour
>   on directories and symbolic links. Demonstration:
>
>   $ mkdir foobar
>   $ touch foobar/t1
>   $ touch foobar/t2
>   $ ln -s foobar barfoo
>   $ find foobar -maxdepth 1 -name 't*'
>   foobar/t1
>   foobar/t2
>   $ find barfoo -maxdepth 1 -name 't*'
>   $ find barfoo/ -maxdepth 1 -name 't*'
>   barfoo/t1
>   barfoo/t2
>
> * Make sure the libraries are writable, otherwise the strip operation
>   might fail. The library files may not be writable if the toolchain
>   is not writable (which may happen if one wants to prevent anyone
>   from overwriting the toolchain, which is done by crosstool-ng, for
>   example).
>
>Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>---
> toolchain/external-toolchain/ext-tool.mk |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>Index: buildroot/toolchain/external-toolchain/ext-tool.mk
>===================================================================
>--- buildroot.orig/toolchain/external-toolchain/ext-tool.mk
>+++ buildroot/toolchain/external-toolchain/ext-tool.mk
>@@ -10,7 +10,7 @@
> 	DST="$(strip $2)"; \
> 	STRIP="$(strip $3)"; \
>  \
>-	LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,/$${LIB}\$$,,"`; \
>+	LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \

ok.
>  \
> 	if test -z "$${LIB_DIR}"; then \
> 		echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \
>@@ -28,6 +28,7 @@
> 				cp -d $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/; \
> 			elif test -f $${LIB_DIR}/$${LIB}; then \
> 				cp $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/$${LIB}; \
>+				chmod u+w $(TARGET_DIR)$${DST}/$${LIB}; \

just use $(INSTALL) -D -m0755 instead of those 2 commands.

> 				case "$${STRIP}" in \
> 				(0 | n | no) \
> ;; \

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

* [Buildroot] [PATCH] More external toolchain fixes
  2008-10-30  9:02 [Buildroot] [PATCH] More external toolchain fixes Thomas Petazzoni
  2008-10-31 13:18 ` Bernhard Reutner-Fischer
@ 2008-10-31 18:38 ` hartleys
  2008-11-03  8:27   ` Thomas Petazzoni
  2008-11-03 10:20   ` Peter Korsgaard
  2008-11-03 10:33 ` Peter Korsgaard
  2 siblings, 2 replies; 6+ messages in thread
From: hartleys @ 2008-10-31 18:38 UTC (permalink / raw)
  To: buildroot

On Thursday, October 30, 2008 2:03 AM, Thomas Petazzoni wrote:
> Fix issues with binary external toolchains

Again yah! 

I found the same issue back on 6/17/2008 and sent a patch on 7/7/2008
that never got a response.

Look forward to seeing any of your future external toolchain patches.

Again for what it's worth.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [Buildroot] [PATCH] More external toolchain fixes
  2008-10-31 18:38 ` hartleys
@ 2008-11-03  8:27   ` Thomas Petazzoni
  2008-11-03 10:20   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2008-11-03  8:27 UTC (permalink / raw)
  To: buildroot

Le Fri, 31 Oct 2008 14:38:51 -0400,
"hartleys" <hartleys@visionengravers.com> a ?crit :

> I found the same issue back on 6/17/2008 and sent a patch on 7/7/2008
> that never got a response.

Argh, it's a shame to discover that people already faced the same
issues, sent patches, but that others end up re-debugging the issue
because the patches didn't get attention.

> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] More external toolchain fixes
  2008-10-31 18:38 ` hartleys
  2008-11-03  8:27   ` Thomas Petazzoni
@ 2008-11-03 10:20   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2008-11-03 10:20 UTC (permalink / raw)
  To: buildroot

>>>>> "hartleys" == hartleys  <hartleys@visionengravers.com> writes:

Hi,

 hartleys> On Thursday, October 30, 2008 2:03 AM, Thomas Petazzoni wrote:
 >> Fix issues with binary external toolchains

 hartleys> Again yah! 

 hartleys> I found the same issue back on 6/17/2008 and sent a patch
 hartleys> on 7/7/2008 that never got a response.

Sorry about that, I have limited time to work on BR. Please be
persistent and resend if you don't get any reply.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] More external toolchain fixes
  2008-10-30  9:02 [Buildroot] [PATCH] More external toolchain fixes Thomas Petazzoni
  2008-10-31 13:18 ` Bernhard Reutner-Fischer
  2008-10-31 18:38 ` hartleys
@ 2008-11-03 10:33 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2008-11-03 10:33 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Fix issues with binary external toolchains
 Thomas> Fix two problems encountered while using an external binary toolchain
 Thomas> generated by crosstool-ng:

Committed as r23909 with the INSTALL -D change as suggested by
Bernhard.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2008-11-03 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30  9:02 [Buildroot] [PATCH] More external toolchain fixes Thomas Petazzoni
2008-10-31 13:18 ` Bernhard Reutner-Fischer
2008-10-31 18:38 ` hartleys
2008-11-03  8:27   ` Thomas Petazzoni
2008-11-03 10:20   ` Peter Korsgaard
2008-11-03 10:33 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox