Striping the library on iOS

15 views
Skip to first unread message

pdoh...@cipherloc.net

unread,
Mar 13, 2017, 3:20:40 PM3/13/17
to Crypto++ Users
I have my library, which is static, linked with a static cryptopp library.  I have cryptopp set to build lean and have the flags for -ffunctions and -fdata-sections in my make file as well.  However, when I call strip on the final product nothing is actually stripped and the cryptopp library has not shrunk.  Am I missing a step or is it not possible to strip a static linked library on iOS?

Jeffrey Walton

unread,
Mar 13, 2017, 3:50:40 PM3/13/17
to pdoh...@cipherloc.net, Crypto++ Users
Please show the command you are using to strip. Maybe better, please
provide the entire build log for the executable. Put it on PasteBin
since its probably very large.

Jeff

pdoh...@cipherloc.net

unread,
Mar 13, 2017, 4:16:34 PM3/13/17
to Crypto++ Users, pdoh...@cipherloc.net, nolo...@gmail.com
Here is the build script we use to build our library with the arguments of static: http://pastebin.com/yeH8xBNs

and we are using the cryptopp GNUmakefile-cross with static lean as the arguments.  

Patrick

Jeffrey Walton

unread,
Mar 13, 2017, 4:57:25 PM3/13/17
to pdoh...@cipherloc.net, Crypto++ Users
On Mon, Mar 13, 2017 at 4:16 PM, <pdoh...@cipherloc.net> wrote:
> Here is the build script we use to build our library with the arguments of
> static: http://pastebin.com/yeH8xBNs
>
> and we are using the cryptopp GNUmakefile-cross with static lean as the
> arguments.

I need to see the build log.

Jeff

pdoh...@cipherloc.net

unread,
Mar 13, 2017, 5:53:29 PM3/13/17
to Crypto++ Users, pdoh...@cipherloc.net, nolo...@gmail.com
Here is the build log from our library: http://pastebin.com/srRGzy2D

We have not modified the cryptopp script in anyway so the output would look the same as if you called it with static lean.

The interesting thing here is that it says -dynamic not specified and -dead_strip is ignored.

Patrick

Jeffrey Walton

unread,
Mar 13, 2017, 6:40:12 PM3/13/17
to pdoh...@cipherloc.net, Crypto++ Users
On Mon, Mar 13, 2017 at 5:53 PM, <pdoh...@cipherloc.net> wrote:
> Here is the build log from our library: http://pastebin.com/srRGzy2D
>
> We have not modified the cryptopp script in anyway so the output would look
> the same as if you called it with static lean.
>
> The interesting thing here is that it says -dynamic not specified and
> -dead_strip is ignored.

All the source files being compiled lack -ffunction-sections and
-fdata-sections.

You can only dead-strip a final executable (dylib or exe). You cannot
strip a static archive. A static archive is just a collection of
object files (*.o). The archive needs to be linked with an executable
(dylib or exe), then the final executable can be stripped.

Jeff
Reply all
Reply to author
Forward
0 new messages