Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I disable the strip binary option in rpmbuild?

5,474 views
Skip to first unread message

debugg...@gmail.com

unread,
Jun 9, 2008, 4:13:58 AM6/9/08
to
Hi,


I have an interesting scenario here.
The md5sum of my binary before rpmbuild is XXX.

After "rpmbuild -bb filename.spec",
I went to the location of my binary.
The md5sum of my binary after rpmbuild is YYY.

Basically, the binary still works perfectly. It is only the md5sum is
different before and after rpmbuild.

----------------------------------------------------------------------------------------

I noticed that in rpmbuild, it automatically strips the binary.
Hence I believe that this causes my binaries md5sum to differ.

I tried to strip the binary before rpmbuild, it does not help.
I looked into options of rpmbuild, no available clue on disabling the
strip option.

Please take note that my spec is only copying the existing binary from
source to destination.
There is no make install.

------------------------------------------------------------------------------------------

My question is:
1. Is the strip option causing the md5sum to differ?
2. If so, how can I disable the strip binary option in rpmbuild?

Thanks for reading,
Have a great day ahead.

Gilles Allard

unread,
Jun 11, 2008, 11:51:04 AM6/11/08
to
debugg...@gmail.com wrote:

> My question is:
> 1. Is the strip option causing the md5sum to differ?

I think that md5sum is for the whole file, binary or not. Stripping remove
the symbol section ( I assume the format of your file is Elf ); so the
content of the file and its structure are modified. The md5sum will be
different.

> 2. If so, how can I disable the strip binary option in rpmbuild?

You should have a look at the result of "rpm --showrc"; may be you will find
a macro "__os_install_post". Usually this is the step where files are
stripped running a script ( this is my case ); the definition of this
macros may resides in "/usr/lib/rpm/macros" or in some more specific macro
files. You should try to run rpmbuild using --define='__os_install_post
<what_you_need>'. This is the way I usually handle that point.

So hope this will help.

debugg...@gmail.com

unread,
Jun 17, 2008, 2:52:17 AM6/17/08
to
On Jun 11, 11:51 pm, Gilles Allard <gilles.allar...@orange.fr> wrote:


Thanks
Managed to figure this out

in the define portion
add in
%define __os_install_post %{nil}

this will disable internal strip by rpmbuild.
However in the prompt out statements from rpmbuild, it still indicate
that stripping is done.

The other way I found out is that
in %install label
add in
export DONT_STRIP=1

This should helps too.
Thanks a million again.
: )

0 new messages