… | |
… | |
39 | file that contains perl interpreter, libc, all the modules you need, all |
39 | file that contains perl interpreter, libc, all the modules you need, all |
40 | the libraries you need and of course your actual program. |
40 | the libraries you need and of course your actual program. |
41 | |
41 | |
42 | With F<uClibc> and F<upx> on x86, you can create a single 500kb binary |
42 | With F<uClibc> and F<upx> on x86, you can create a single 500kb binary |
43 | that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, |
43 | that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, |
44 | Coro and so on. Or any other choice of modules. |
44 | Coro and so on. Or any other choice of modules (and some other size :). |
45 | |
45 | |
46 | To see how this turns out, you can try out smallperl and bigperl, two |
46 | To see how this turns out, you can try out smallperl and bigperl, two |
47 | pre-built static and compressed perl binaries with many and even more |
47 | pre-built static and compressed perl binaries with many and even more |
48 | modules: just follow the links at L<http://staticperl.schmorp.de/>. |
48 | modules: just follow the links at L<http://staticperl.schmorp.de/>. |
49 | |
49 | |
… | |
… | |
923 | F<~/.staticperlrc> to override them. |
923 | F<~/.staticperlrc> to override them. |
924 | |
924 | |
925 | Most of the variables override (or modify) the corresponding F<Configure> |
925 | Most of the variables override (or modify) the corresponding F<Configure> |
926 | variable, except C<PERL_CCFLAGS>, which gets appended. |
926 | variable, except C<PERL_CCFLAGS>, which gets appended. |
927 | |
927 | |
|
|
928 | You should have a look near the beginning of the F<staticperl> script - |
|
|
929 | staticperl tries to default C<PERL_OPTIMIZE> to some psace-saving options |
|
|
930 | suitable for newer gcc versions. For other compilers or older versions you |
|
|
931 | need 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 |
… | |
… | |
1150 | good experiences with GCC 4.4.x but not GCC 4.5. |
1155 | good experiences with GCC 4.4.x but not GCC 4.5. |
1151 | |
1156 | |
1152 | To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections |
1157 | To 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> |
1154 | doesn't decrease codesize much, but it makes the file much more |
1159 | doesn't decrease codesize much, but it makes the file much more |
1155 | compressible. |
1160 | compressible (and the execution a lot slower...). |
1156 | |
1161 | |
1157 | If you don't need Coro or threads, you can go with "linuxthreads.old" (or |
1162 | If you don't need Coro or threads, you can go with "linuxthreads.old" (or |
1158 | no thread support). For Coro, it is highly recommended to switch to a |
1163 | no thread support). For Coro, it is highly recommended to switch to a |
1159 | uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 |
1164 | uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 |
1160 | snapshot) and enable NPTL, otherwise Coro needs to be configured with the |
1165 | snapshot) and enable NPTL, otherwise Coro needs to be configured with the |