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.39 by root, Sat Apr 2 11:00:34 2011 UTC vs.
Revision 1.42 by root, Fri Jun 24 18:26:08 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
923F<~/.staticperlrc> to override them. 923F<~/.staticperlrc> to override them.
924 924
925Most of the variables override (or modify) the corresponding F<Configure> 925Most of the variables override (or modify) the corresponding F<Configure>
926variable, except C<PERL_CCFLAGS>, which gets appended. 926variable, except C<PERL_CCFLAGS>, which gets appended.
927 927
928You should have a look near the beginning of the F<staticperl> script -
929staticperl tries to default C<PERL_OPTIMIZE> to some psace-saving options
930suitable for newer gcc versions. For other compilers or older versions you
931need to adjust these, for example, in your F<~/.staticperlrc>.
932
928=back 933=back
929 934
930=head4 Variables you probably I<do not want> to override 935=head4 Variables you probably I<do not want> to override
931 936
932=over 4 937=over 4
1150good experiences with GCC 4.4.x but not GCC 4.5. 1155good experiences with GCC 4.4.x but not GCC 4.5.
1151 1156
1152To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections 1157To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections
1153-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386> 1158-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386>
1154doesn't decrease codesize much, but it makes the file much more 1159doesn't decrease codesize much, but it makes the file much more
1155compressible. 1160compressible (and the execution a lot slower...).
1156 1161
1157If you don't need Coro or threads, you can go with "linuxthreads.old" (or 1162If you don't need Coro or threads, you can go with "linuxthreads.old" (or
1158no thread support). For Coro, it is highly recommended to switch to a 1163no thread support). For Coro, it is highly recommended to switch to a
1159uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 1164uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201
1160snapshot) and enable NPTL, otherwise Coro needs to be configured with the 1165snapshot) and enable NPTL, otherwise Coro needs to be configured with the
1162twice the address space needed for stacks). 1167twice the address space needed for stacks).
1163 1168
1164If you use C<linuxthreads.old>, then you should also be aware that 1169If you use C<linuxthreads.old>, then you should also be aware that
1165uClibc shares C<errno> between all threads when statically linking. See 1170uClibc shares C<errno> between all threads when statically linking. See
1166L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a 1171L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a
1167workaround (And L<https://bugs.uclibc.org/2089> for discussion). 1172workaround (and L<https://bugs.uclibc.org/2089> for discussion).
1168 1173
1169C<ccache> support is also recommended, especially if you want 1174C<ccache> support is also recommended, especially if you want
1170to play around with buildroot options. Enabling the C<miniperl> 1175to play around with buildroot options. Enabling the C<miniperl>
1171package will probably enable all options required for a successful 1176package will probably enable all options required for a successful
1172perl build. F<staticperl> itself additionally needs either C<wget> 1177perl build. F<staticperl> itself additionally needs either C<wget>
1180it from working properly in a chroot - either use dash (and link it to 1185it from working properly in a chroot - either use dash (and link it to
1181F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's 1186F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's
1182built-in ash shell. 1187built-in ash shell.
1183 1188
1184Finally, you need F</dev/null> inside the chroot for many scripts to work 1189Finally, you need F</dev/null> inside the chroot for many scripts to work
1185- F<cp /dev/null output/target/dev> or bind-mounting your F</dev> will 1190- either F<cp /dev/null output/target/dev> or bind-mounting your F</dev>
1186both provide this. 1191will provide this.
1187 1192
1188After you have compiled and set up your buildroot target, you can copy 1193After you have compiled and set up your buildroot target, you can copy
1189F<staticperl> from the C<App::Staticperl> distribution or from your 1194F<staticperl> from the C<App::Staticperl> distribution or from your
1190perl f<bin> directory (if you installed it) into the F<output/target> 1195perl F<bin> directory (if you installed it) into the F<output/target>
1191filesystem, chroot inside and run it. 1196filesystem, chroot inside and run it.
1192 1197
1193=head1 RECIPES / SPECIFIC MODULES 1198=head1 RECIPES / SPECIFIC MODULES
1194 1199
1195This section contains some common(?) recipes and information about 1200This section contains some common(?) recipes and information about

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines