Libraries NOT stripped by new2dir make install
Posted: Wed 02 Oct 2019, 12:21
I quite like compiling and creating .pet packages but for years I have found that although the executable binaries get stripped, the shared libraries do not. I have to inspect these files and strip them manually before finally creating my .pet package.
So I am now testing the following possible fix and perhaps others would like to do the same.
In the file /usr/bin/new2dir
Look for the section:-
Change the argument --strip-debug to --strip-unneeded
(Same as the argument being used for executables)
So it looks like this:-
The shared (dynamic) libraries installed into your system, plus the copies which will be used to create the .pet or .sfs package should then be already stripped. Right-click and look at properties to verify.
So I am now testing the following possible fix and perhaps others would like to do the same.
In the file /usr/bin/new2dir
Look for the section:-
Code: Select all
#strip the file...
if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
[ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-debug "$ONEFILE"
[ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
fi
(Same as the argument being used for executables)
So it looks like this:-
Code: Select all
#strip the file...
if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
[ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-unneeded "$ONEFILE"
[ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
fi