ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.pod
(Generate patch)

Comparing App-Staticperl/staticperl.pod (file contents):
Revision 1.40 by root, Sun May 1 09:29:47 2011 UTC vs.
Revision 1.45 by root, Mon Jun 27 21:56:51 2011 UTC

39file that contains perl interpreter, libc, all the modules you need, all 39file that contains perl interpreter, libc, all the modules you need, all
40the libraries you need and of course your actual program. 40the libraries you need and of course your actual program.
41 41
42With F<uClibc> and F<upx> on x86, you can create a single 500kb binary 42With F<uClibc> and F<upx> on x86, you can create a single 500kb binary
43that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, 43that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO,
44Coro and so on. Or any other choice of modules. 44Coro and so on. Or any other choice of modules (and some other size :).
45 45
46To see how this turns out, you can try out smallperl and bigperl, two 46To see how this turns out, you can try out smallperl and bigperl, two
47pre-built static and compressed perl binaries with many and even more 47pre-built static and compressed perl binaries with many and even more
48modules: just follow the links at L<http://staticperl.schmorp.de/>. 48modules: just follow the links at L<http://staticperl.schmorp.de/>.
49 49
882=item C<STATICPERL> 882=item C<STATICPERL>
883 883
884The directory where staticperl stores all its files 884The directory where staticperl stores all its files
885(default: F<~/.staticperl>). 885(default: F<~/.staticperl>).
886 886
887=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... 887=item C<DLCACHE>
888 888
889Usually set to C<1> to make modules "less inquisitive" during their 889The path to a directory (will be created if it doesn't exist) where
890installation, you can set any environment variable you want - some modules 890downloaded perl sources are being cached, to avoid downloading them
891(such as L<Coro> or L<EV>) use environment variables for further tweaking. 891again. The default is empty, which means there is no cache.
892 892
893=item C<PERL_VERSION> 893=item C<PERL_VERSION>
894 894
895The perl version to install - default is currently C<5.12.3>, but C<5.8.9> 895The perl version to install - default is currently C<5.12.3>, but C<5.8.9>
896is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is 896is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is
897about as big as 5.12.3). 897about as big as 5.12.3).
898
899=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ...
900
901Usually set to C<1> to make modules "less inquisitive" during their
902installation. You can set (and export!) any environment variable you want
903- some modules (such as L<Coro> or L<EV>) use environment variables for
904further tweaking.
898 905
899=item C<PERL_PREFIX> 906=item C<PERL_PREFIX>
900 907
901The prefix where perl gets installed (default: F<$STATICPERL/perl>), 908The prefix where perl gets installed (default: F<$STATICPERL/perl>),
902i.e. where the F<bin> and F<lib> subdirectories will end up. 909i.e. where the F<bin> and F<lib> subdirectories will end up.
1155good experiences with GCC 4.4.x but not GCC 4.5. 1162good experiences with GCC 4.4.x but not GCC 4.5.
1156 1163
1157To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections 1164To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections
1158-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386> 1165-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386>
1159doesn't decrease codesize much, but it makes the file much more 1166doesn't decrease codesize much, but it makes the file much more
1160compressible. 1167compressible (and the execution a lot slower...).
1161 1168
1162If you don't need Coro or threads, you can go with "linuxthreads.old" (or 1169If you don't need Coro or threads, you can go with "linuxthreads.old" (or
1163no thread support). For Coro, it is highly recommended to switch to a 1170no thread support). For Coro, it is highly recommended to switch to a
1164uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 1171uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201
1165snapshot) and enable NPTL, otherwise Coro needs to be configured with the 1172snapshot) and enable NPTL, otherwise Coro needs to be configured with the
1167twice the address space needed for stacks). 1174twice the address space needed for stacks).
1168 1175
1169If you use C<linuxthreads.old>, then you should also be aware that 1176If you use C<linuxthreads.old>, then you should also be aware that
1170uClibc shares C<errno> between all threads when statically linking. See 1177uClibc shares C<errno> between all threads when statically linking. See
1171L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a 1178L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a
1172workaround (And L<https://bugs.uclibc.org/2089> for discussion). 1179workaround (and L<https://bugs.uclibc.org/2089> for discussion).
1173 1180
1174C<ccache> support is also recommended, especially if you want 1181C<ccache> support is also recommended, especially if you want
1175to play around with buildroot options. Enabling the C<miniperl> 1182to play around with buildroot options. Enabling the C<miniperl>
1176package will probably enable all options required for a successful 1183package will probably enable all options required for a successful
1177perl build. F<staticperl> itself additionally needs either C<wget> 1184perl build. F<staticperl> itself additionally needs either C<wget>
1185it from working properly in a chroot - either use dash (and link it to 1192it from working properly in a chroot - either use dash (and link it to
1186F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's 1193F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's
1187built-in ash shell. 1194built-in ash shell.
1188 1195
1189Finally, you need F</dev/null> inside the chroot for many scripts to work 1196Finally, you need F</dev/null> inside the chroot for many scripts to work
1190- F<cp /dev/null output/target/dev> or bind-mounting your F</dev> will 1197- either F<cp /dev/null output/target/dev> or bind-mounting your F</dev>
1191both provide this. 1198will provide this.
1192 1199
1193After you have compiled and set up your buildroot target, you can copy 1200After you have compiled and set up your buildroot target, you can copy
1194F<staticperl> from the C<App::Staticperl> distribution or from your 1201F<staticperl> from the C<App::Staticperl> distribution or from your
1195perl f<bin> directory (if you installed it) into the F<output/target> 1202perl F<bin> directory (if you installed it) into the F<output/target>
1196filesystem, chroot inside and run it. 1203filesystem, chroot inside and run it.
1197 1204
1198=head1 RECIPES / SPECIFIC MODULES 1205=head1 RECIPES / SPECIFIC MODULES
1199 1206
1200This section contains some common(?) recipes and information about 1207This section contains some common(?) recipes and information about

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines