How to strip binary?
Hi,
when releasing the app to harbour you have to pass the rpm validator. When i run the rpm validator i always get a warning about the not stripped binary. How can i strip the binary in the build process? Could not find any information about that in the docs.
Thanks in advance, Cheers, Andreas
See e.g.
olf ( 2020-03-18 22:30:04 +0200 )editstrip --help
or http://manpages.org/stripHi, yes i know that but when i run the build like this (as seen in documentation) :
mb2 --no-snapshot -t SailfishOS-3.2.1.20-armv7hl build
i get a rpm that contains the binary. Is it possible to tell the mb2 build to also strip the binary?
AndyWuest ( 2020-03-18 22:41:35 +0200 )editshouldn't it be strippe dby default? if no, strip in spec
coderus ( 2020-03-18 23:51:23 +0200 )editLook at the build process in the source. Normally it should strip in the 'make install' phase. Perhaps there is an option to switch from a "debug" to a "release" type build?
For example, if the build tool is cmake, you can use something like this in the CMakeFile:
or pass
-DCMAKE_C_FLAGS_RELEASE="-s"
or-DCMAKE_C_FLAGS="-s"
to the call to make.If not, you can in the
nephros ( 2020-03-20 09:46:19 +0200 )edit%install
section of an RPM spec file, useinstall(1)
with the --strip option (e.g.install -s -p -D -m 755 foo.bin $RPM_BUILD_ROOT/%{_bindir}/foo
) to place the binaries in the destdir and strip in the process. (Make sure you don't strip .so files though! ;) )