[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

request for diversion + please help to determine default targets


I'm (de-facto) co-maintainer of dpkg-cross, the debian cross-compiling 
support package.

One of the problems with debian package cross-compilation comes from 
dh_strip, that just calls "strip" binary. It's ok for native compilation, 
but for cross-compilation will cause problems unless binutils-multiarch is 

A good way to deal with this is fixing dh_strip to use $STRIP environment 
variable (if set) to locate strip binary. However, I was told [1] that 
debhelper maintainers don't like this idea.

So I'm going to solve this issue by diverting dh_strip by a script, that 
- locate appropriate strip binary,
- if binary name is not "strip", create a temporary directory and a symlink
named "strip" there that will point to the strip binary,
- set PATH such that correct strip binary will be called
- execute original dh_strip
- remove temporary directory if one was created.

Debian policy requires to discuss any diversion in debian-devel.
It is OK to divert in this case?
Note that dpkg-cross already diverts dpkg-shlibdeps and dpkg-buildpackage.

One more question.
I'm going to detect strip binary that can deal with files for $(arch) by 
checking /usr/bin/strip and several common locations for cross-strip, and 
parsing the "supported targets" line of --help output of the found 

nikita@bliss:~> strip --help 2>&1 | grep 'supported targets'
strip: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 
elf32-little elf32-big elf64-x86-64 elf64-little elf64-big srec symbolsrec 
tekhex binary ihex trad-core

nikita@bliss:~> arm-linux-strip --help 2>&1 | grep 'supported targets'
arm-linux-strip: supported targets: elf32-littlearm elf32-bigarm 
elf32-little elf32-big srec symbolsrec tekhex binary ihex

To make this work on all archs, I need a table, what string to search in 
supported targets for each debian architecture?
First targets listed by my deb installation of cross-binutils for several 
linux targets are:
'elf32-i386' for x86-linux
'elf64-alpha' for alpha-linux
'elf32-littlearm' for arm-linux
'elf32-hppa' for hppa-linux
'elf64-ia64-little' for ia64-linux
'elf32-m68k' for m68k-linux
'elf32-tradbigmips' for mips-linux
'elf32-tradlittlemips' for mipsel-linux
'elf32-powerpc' for powerpc-linux
'elf32-s390' for s390-linux
'elf32-sparc' for sparc-linux
Is it ok to use those? What should be used for amd64 and hurd targets?


[1] http://lists.debian.org/debian-embedded/2004/06/msg00067.html

Reply to: