Rene Huber wrote:
> Using ptxdist-2010.01.0 I get the busybox build error shown below.
> 
> It looks like the binary does not get renamed by the new dummy-strip.
> In my case the target system is x86 and I don't use any cross compiler,
> perhaps the host strip does need to "leak" through here.

>   CC      util-linux/umount.o
>   AR      util-linux/lib.a
>   LINK    busybox_unstripped
> Trying libraries: crypt m
>  Library crypt is not needed, excluding it
>  Library m is not needed, excluding it
> Final link with: <none>
> ptxdist: Discarding 'strip -s --remove-section=.note -remove-section=.comment
> busybox_unstripped -o busybox'

the dummy strip does not support "-o" that's a bug, but why doesn't this show 
up here?

ahh...now I get it.....

you don't use any cross compiler so busybox will use "strip" which is dummy 
strip now. we use a cross compiler busybox is cross-aware and will use 
$CROSS_COMPILE-strip, which will work, of course.

> chmod: cannot access `busybox': No such file or directory
> make[1]: *** [busybox] Error 1
> make[1]: Leaving directory `/home/rhuber/test/build-target/busybox-1.15.2'
> make: *** [/home/rhuber/test/state/busybox.compile] Error 2

cheers, Marc

please try the attached patch:

---

From d90e885ac877b8a4037d7ab138cc4aaf8230072f Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <m...@pengutronix.de>
Date: Fri, 8 Jan 2010 15:27:28 +0100
Subject: [PATCH] [dummy-strip] add support for "-o" option

Compiling busybox without a CROSS_COMPILE defined, which is a valid use
case, busybox will use "strip" for stripping. Since commit
b0b990da3d10efe6368004408649bd3b35fd0b47 we have a dummy strip installed
to SYSROOT_CROSS. This command does nothing.

However busybox uses "strip <input> -o <output>" during strip, to create
the stripped variant. Our dummy strip doens't support the '-o' option.

This is why busybox fails withs:

ptxdist: Discarding 'strip -s --remove-section=.note
-remove-section=.comment busybox_unstripped -o busybox'

This patch add support for '-o' to strip.

Reported-by: Rene Huber <renehub...@netscape.net>
Signed-off-by: Marc Kleine-Budde <m...@pengutronix.de>
CC: Wolfram Sang <w.s...@pengutronix.de>
---
 scripts/dummy-strip.sh |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/scripts/dummy-strip.sh b/scripts/dummy-strip.sh
index 21d2eb6..05e58c8 100644
--- a/scripts/dummy-strip.sh
+++ b/scripts/dummy-strip.sh
@@ -1,11 +1,38 @@
-#! /bin/sh
-# dummy-strip.sh for PTXdist - Copyright (C) 2009 by Wolfram Sang
+#!/bin/bash
+#
+# dummy-strip.sh for ptxdist - Copyright (C) 2009 by Wolfram Sang
+#                                            2010 by Marc Kleine-Budde
 #
 # This scripts gets installed into the cross-environment as a 'dummy'-strip
 # program. As programs like 'install -s' just call 'strip', this prevents
 # leaking in of the host-version of strip. Also, it does intentionally
 # nothing as we want to strip at a later stage.
 #
+
 echo "ptxdist: Discarding 'strip $*'"
-exit 0
 
+unset output
+unset input
+
+while [ ${#} -ne 0 ]; do
+    arg="${1}"
+    shift
+
+    case "${arg}" in
+       -o)
+           output="${1}"
+           shift
+           ;;
+       -*)
+           ;;
+       *)
+           input="${arg}"
+           ;;
+    esac
+done
+
+if [ -n "${output}" ]; then
+    cp "${input}" "${output}" || exit
+fi
+
+exit 0
-- 
1.6.5.7



-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature

--
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to