Ubuntu – unstripped binary or object creating debian package

debdebiandpkg

I'm new to package creation and I'm trying to create a .deb package and keep getting 'unstripped-binary-or-object' on all my libraries and executables.

I have everything setup in the directory tree where I want them to end up (and a DEBIAN folder with the control file) and then do

fakeroot dpkg-deb --build ./mypackage

when I lint with
lintian mypackage.deb

I get that error.

Any ideas or suggestions?

Thanks

Best Answer

Use objcopy or strip from binutils to strip debug symbols from the binaries that you are building. I would, however, suggest that you either keep an unstripped copy of the binaries or - in case of using objcopy - simply split off the debug symbols into a separate file that can later be used with a debugger.

Often the *-devel packages come with symbols of the corresponding * package, by the way. So you may want to consider creating one of those in addition, if this is something you release to the general public.

For strip a common use is to only strip the debugging symbols:

strip -S -o [stripped-file] [input-file]

The switch corresponding to strip -S for is objcopy -g or simply use the long form that works for both (but not on all platforms on which I had to use strip): --strip-debug.

For the described use of splitting the debug symbols using objcopy, check out the option --only-keep-debug in man objcopy.

Related Question