RPM Community Forums

Mailing List Message of <rpm-users>

Re: Question about brp-compress and brp-strip

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 05 Apr 2008 - 18:30:45 CEST
Message-Id: <B146671F-0709-43DF-BF94-0F5A1603E7FF@mac.com>

On Apr 4, 2008, at 6:46 PM, DB wrote:

> I'm brand-new to RPM and am researching a problem for someone  
> fairly new to RPM.
>
> We build software on several platforms (including 2 versions of  
> Linux and 2 versions of Solaris), and we use RPM 4.3.3 (from what I  
> can tell). In the Solaris 8 build, we're getting an error when the  
> RPM is put together. The compress/strip commands complain that 8  
> binary files are in an "unrecognizable format." It then puts the  
> binary plus an empty garbage file into the RPM.
>
> Here's two snippets from the log, the first showing the tar of the  
> binary, and the next showing the error where the empty garbage file  
> is created:
>
> + tar xf -
> + tar chf - BinaryName
>
> + /usr/lib/rpm/redhat/brp-compress
> + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
> /usr/bin/strip: Unable to recognise the format of the input file / 
> home/mydir/RPM/BinaryName
>
> I'll have to do a more exhaustive search of the system, but so far  
> this happens to just 8 binary files for this particular build.  
> These files have nonsense names, such as stXyzzy and are placed in  
> the same destination directory as the binary.
>
> Has anyone seen this type of problem before? Can you point me to  
> what I else I need to research, and whether there are rpm options  
> that might prevent this from happening?
>

The first step is to reproduce the problem outside of rpmbuild:

     /usr/bin/strip /home/mydir/RPM/BinaryName

The next step is to identify the format of BinaryName. One way is

     file /home/mydir/RPM/BinaryName

The file should be ELF format. This command will display what is in  
the ELF file:

     readelf -a /home/mydir/RPM/BinaryName

Additional information is needed to diagnose your problem and suggest  
best solution.

Meanwhile, if you simply edit /usr/lib/rpm/redhat/brp-strip, and add
     exit 0
at the top, then rpmbuild will not attempt stripping the file. One  
can also
achieve the same effect by changing a macro to not attempt running  
brp-strip.
But putting a band-aid, by not attempting stripping, to avoid the  
problem solves nothing.

There is also eu-strip that can be used instead of /usr/bin/strip. eu- 
strip (from elfutils) is often smarter
about ELF internals.

hth

73 de Jeff
Received on Sat Apr 5 18:30:51 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.