Debian Bug report logs - #221700
debhelper: dh_strip when cross-compiling

version graph

Package: debhelper; Maintainer for debhelper is Debhelper Maintainers <debhelper-devel@lists.alioth.debian.org>; Source for debhelper is src:debhelper.

Reported by: Philippe De Swert <philippe.deswert@student.denayer.wenk.be>

Date: Wed, 19 Nov 2003 17:18:04 UTC

Severity: normal

Found in version 4.1.80

Done: Joey Hess <joeyh@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#221700; Package debhelper. Full text and rfc822 format available.

Acknowledgement sent to Philippe De Swert <philippe.deswert@student.denayer.wenk.be>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Philippe De Swert <philippe.deswert@student.denayer.wenk.be>
To: submit@bugs.debian.org
Subject: debhelper: dh_strip when cross-compiling
Date: Wed, 19 Nov 2003 18:07:48 +0100
Package: debhelper 
Version: 4.1.80 
 
Hello,  
  
When cross-compiling I discovered that dh_strip still has problems with  
finding the correct strip utility. (see http://bugs.debian.org/cgi-bin/ 
bugreport.cgi?bug=217222 )  
When using a toolchain with an exotic name not compliant to the debian policy  
(generated by Dan Kegel's crosstool in this case, but also with some vendor  
supplied toolchains) I get the following type of error when doing 
dpkg-buildpackage -am68k -rfakeroot (with dpkg-cross 1.14 installed and 
configured):  
  
dh_strip  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
strip: Warning: Output file cannot represent architecture UNKNOWN!  
dh_compress  
  
the $(DEB_HOST_GNU_TYPE) is set to m68k-unknown-linux-gnu in this case.  
  
I made a workaround and put everything in a different script that I called  
dh_stripcross. It is based on dh_strip so here is the diff between those 2.  
  
--- dh_strip    2003-11-02 21:26:36.000000000 +0100  
+++ dh_stripcross       2003-11-19 16:57:04.000000000 +0100  
@@ -2,7 +2,8 @@  
  
 =head1 NAME  
  
-dh_strip - strip executables, shared libraries, and some static libraries  
+dh_stripcross - strip executables, shared libraries, and some static  
libraries  
+when cross-compiling. It detects the correct toolchain strip to use.  
  
 =cut  
  
@@ -12,7 +13,7 @@  
  
 =head1 SYNOPSIS  
  
-B<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>] [--dbg-package=package]  
[--keep-debug]  
+B<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>]  
  
 =head1 DESCRIPTION  
  
@@ -42,28 +43,6 @@  
 stripped. You may use this option multiple times to build up a list of  
 things to exclude.  
  
-=item B<--dbg-package=>I<package>  
-  
-This option tells dh_strip that the given package has an associated "-dbg"  
-package. dh_strip will, when stripping off the debug symbols of files in  
-the given package, save them to independent files in the package build  
-directory for the "-dbg" package.  
-  
-For example, you might have a package named libfoo, and want to include a  
-libfoo-dbg package that contains debugging symbols. The command "dh_strip  
---dbg-package=libfoo" will make dh_strip save the debugging symbols for  
-usr/lib/libfoo.so.0 into usr/lib/debug/usr/lib/libfoo.so.0 in the package  
-build directory for libfoo-dbg. If libfoo-dbg is installed, gdb will  
-automatically load up the debugging symbols from it when debugging libfoo.  
-  
-This option may be repeated to list more than one package.  
-  
-=item B<-k>, B<--keep-debug>  
-  
-Debug symbols will be retained, but split into an independant  
-file in usr/lib/debug/ in the package build directory. --dbg-package  
-is easier to use than this option, but this option is more flexible.  
-  
 =back  
  
 =head1 NOTES  
@@ -140,57 +119,22 @@  
        }  
 }  
  
-sub make_debug {  
-       my $file=shift;  
-       my $tmp=shift;  
-       my $desttmp=shift;  
-  
-       my ($base_file)=$file=~/^$tmp(.*)/;  
-       my $debug_path=$desttmp."/usr/lib/debug/".$base_file;  
-       my $debug_dir=dirname($debug_path);  
-       if (! -d $debug_dir) {  
-               doit("install", "-d", $debug_dir);  
-       }  
-       doit("objcopy", "--only-keep-debug", $file, $debug_path);  
-       # No reason for this to be executable.  
-       doit("chmod", 644, $debug_path);  
-       return $debug_path;  
-}  
-  
-sub attach_debug {  
-       my $file=shift;  
-       my $debug_path=shift;  
-       doit("objcopy", "--add-gnu-debuglink", $debug_path, $file);  
-}  
-  
 foreach my $package (@{$dh{DOPACKAGES}}) {  
        my $tmp=tmpdir($package);  
  
-       # Support for keeping the debugging symbols in a detached file.  
-       my $keep_debug=$dh{KEEP_DEBUG};  
-       my $debugtmp=$tmp;  
-       if (ref $dh{DEBUGPACKAGES} && grep { $_ eq $package }  
@{$dh{DEBUGPACKAGES}}) {  
-               $keep_debug=1;  
-               $debugtmp=tmpdir($package."-dbg");  
-       }  
-  
        @shared_libs=@executables=@static_libs=();  
        find(\&testfile,$tmp);  
  
        foreach (@shared_libs) {  
-               my $debug_path = make_debug($_, $tmp, $debugtmp) if  
$keep_debug;  
                # Note that all calls to strip on shared libs  
                # *must* inclde the --strip-unneeded.  
-               doit("strip","--remove-section=.comment",  
+                
doit("$ENV{DEB_HOST_GNU_TYPE}-strip","--remove-section=.comment",  
                        "--remove-section=.note","--strip-unneeded",$_);  
-               attach_debug($_, $debug_path) if $keep_debug;  
        }  
  
        foreach (@executables) {  
-               my $debug_path = make_debug($_, $tmp, $debugtmp) if  
$keep_debug;  
-               doit("strip","--remove-section=.comment",  
+                
doit("$ENV{DEB_HOST_GNU_TYPE}-strip","--remove-section=.comment",  
                        "--remove-section=.note",$_);  
-               attach_debug($_, $debug_path) if $keep_debug  
        }  
  
        foreach (@static_libs) {  
@@ -205,7 +149,6 @@  
 This program is a part of debhelper.  
  
 =head1 AUTHOR  
-  
-Joey Hess <joeyh@debian.org>  
+adapted from dh_strip (from Joey Hess <joeyh@debian.org>) by Philippe De  
Swert <philippe.deswert@hotmail.com>  
  
 =cut  
  
greets,  
  
Philippe  
  
| Philippe De Swert -GNU/linux - uClinux freak-      
|      
| "GNU is the way"       
|   
| Please do not send me documents in a closed format. (*.doc,*.xls,*.ppt)    
| Use the open alternatives. (*.pdf,*.ps,*.html,*.txt)    
| Why? http://pallieter.is-a-geek.org:7832/~johan/word/english/    
 
-------------------------------------------------------------------------- 
Gestuurd via het webmailsysteem van het De Nayer Instituut: www.denayer.be 
 
----- End forwarded message ----- 

--------------------------------------------------------------------------
Gestuurd via het webmailsysteem van het De Nayer Instituut: www.denayer.be




Reply sent to Joey Hess <joeyh@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Philippe De Swert <philippe.deswert@student.denayer.wenk.be>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #10 received at 221700-done@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Philippe De Swert <philippe.deswert@student.denayer.wenk.be>, 221700-done@bugs.debian.org
Subject: Re: Bug#221700: debhelper: dh_strip when cross-compiling
Date: Wed, 19 Nov 2003 13:20:54 -0500
[Message part 1 (text/plain, inline)]
Philippe De Swert wrote:
> When cross-compiling I discovered that dh_strip still has problems with  
> finding the correct strip utility. (see http://bugs.debian.org/cgi-bin/ 
> bugreport.cgi?bug=217222 )  

I realize that that bug report and the associated ones can be a little
bit hard to follow, but it all comes down to "install binutils-multiarch".
There is no reason for me to add new code to debhelper to deal with this
when /usr/bin/strip can be replaced with something that can handle
multiple architectures.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 03:59:56 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.