How reduce biraries size.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 17 Jan 2010 21:01:32 +0200
changeset 279 061995ef35d2
parent 278 a58e223b692f
child 280 4739b9c54c18
How reduce biraries size.
code-size.rst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code-size.rst	Sun Jan 17 21:01:32 2010 +0200
@@ -0,0 +1,47 @@
+-*- mode: outline; coding: utf-8 -*-
+
+* Common.
+
+** Configuration.
+
+Configure build with disabling unused features e.g.:
+
+  $ ./configure --without-png
+
+** Link dynamically.
+
+Link dynamically instead statically (on your platform shared library may be
+already present).
+
+** Avoid debug build.
+
+Make release/final build instead debug.
+
+** Packer.
+
+Use packers. Packer compress binary so binary smaller. When program load
+decompress itself, so startup time increase.
+
+  http://upx.sourceforge.net
+                home page
+
+* GCC.
+
+Use -Os when produce *.o files.
+
+Use -s when produce executable.
+And "--remove-section=.comment and --remove-section=.note".
+
+Use:
+
+  $ strip --strip-all <executable>
+
+and
+
+  $ gcc -ffunction-sections -fdata-sections -c -o my.o my.c
+  $ gcc -Wl,--gc-sections -o my my.o
+
+* MSVC.
+
+Use /Os when produce *.obj files.
+