1PERLMINT(1) Perl Programmers Reference Guide PERLMINT(1)
2
3
4
6 README.mint - Perl version 5 on Atari MiNT
7
9 There is a binary version of perl available from the FreeMiNT project
10 http://freemint.de/ You may wish to use this instead of trying to
11 compile yourself.
12
13 The following advice is from perl 5.004_02 and is probably rather out
14 of date.
15
16 If you want to build perl yourself on MiNT (or maybe on an Atari
17 without MiNT) you may want to accept some advice from somebody who
18 already did it...
19
20 There was a perl port for Atari ST done by ++jrb bammi@cadence.com.
21 This port tried very hard to build on non-MiNT-systems. For the sake
22 of efficiency I've left this way. Yet, I haven't removed bammi's
23 patches but left them intact. Unfortunately some of the files that
24 bammi contributed to the perl distribution seem to have vanished?
25
26 So, how can you distinguish my patches from bammi's patches? All of
27 bammi's stuff is embedded in "#ifdef atarist" preprocessor macros. My
28 MiNT port uses "#ifdef __MINT__" instead (and unconditionally undefines
29 "atarist". If you want to continue on bammi's port, all you have to do
30 is to swap the "-D" and "-U" switches for "__MINT__" and "atarist" in
31 the variable ccflags.
32
33 However, I think that my version will still run on non-MiNT-systems
34 provided that the user has a Eunuchs-like environment (i.e. the
35 standard envariables like $PATH, $HOME, ... are set, there is a POSIX
36 compliant shell in /bin/sh, and...)
37
39 The problems you may encounter when building perl on your machine are
40 most probably due to deficiencies in MiNT resp. the Atari platform in
41 general.
42
43 First of all, if you have less than 8 MB of RAM you shouldn't even try
44 to build Perl yourself. Better grab a binary pre-compiled version
45 somewhere. Even if you have more memory you should take some care.
46 Try to run in a fresh environment (without memory fragmented too much)
47 with as few daemons, accessories, xcontrol modules etc. as possible.
48 If you run some AES you should consider to start a console based
49 environment instead.
50
51 A problem has been reported with sed. Sed is used to create some
52 configuration files based on the answers you have given to the
53 Configure script. Unfortunately the Perl Configure script shows sed on
54 MiNT its limits. I have sed 2.05 with a stacksize of 64k and I have
55 encountered no problems. If sed crashes during your configuration
56 process you should first try to augment sed's stacksize:
57
58 fixstk 64k /usr/bin/sed
59
60 (or similar). If it still doesn't help you may have a look which other
61 versions of sed are installed on your system. If you have a KGMD 1.0
62 installation you will find three in /usr/bin. Have a look there.
63
64 Perl has some "mammut" C files. If gcc reports "internal compiler
65 error: program cc1 got fatal signal 10" this is very likely due to a
66 stack overflow in program cc1. Find cc1 and fix its stack. I have made
67 good experiences with
68
69 fixstk 2 cc1
70
71 This doesn't establish a stack of 2 Bytes only as you might think. It
72 really reserves one half of the available memory for cc1's stack. A
73 setting of 1 would reserve the entire memory for cc1, 3 would reserve
74 three fourths. You will have to find out the value that suits to your
75 system yourself.
76
77 To find out the location of the program "cc1" simply type `gcc
78 --print-prog-name cc1' at your shell prompt.
79
80 Now run make (maybe "make -k"). If you get a fatal signal 10 increase
81 cc1's stacksize, if you run out of memory you should either decrease
82 the stacksize or follow some more hints:
83
84 Perl's building process is very handy on machines with a lot of virtual
85 memory but may result in a disaster if you are short of memory. If gcc
86 fails to compile many source files you should reduce the optimization.
87 Grep for "optimize" in the file config.sh and change the flags.
88
89 If only several huge files cause problems (actually it is not a matter
90 of the file size resp. the amount of code but depends on the size of
91 the individual functions) it is useful to bypass the make program and
92 compile these files directly from the command line. For example if you
93 got something like the following from make:
94
95 CCCMD = gcc -DPERL_CORE ....
96 ...
97 ...: virtual memory exhausted
98
99 you should hack into the shell:
100
101 gcc -DPERL_CORE ... toke.c
102
103 Please note that you have to add the name of the source file (here
104 toke.c) at the end.
105
106 If none of this helps, you're helpless. Wait for a binary release. If
107 you have succeeded you may encounter another problem at the linking
108 process. If gcc complains that it can't find some libraries within the
109 perl distribution you probably have an old linker. If it complains for
110 example about "file not found for xxx.olb" you should cd into the
111 directory in question and
112
113 ln -s libxxx.a xxx.olb
114
115 This will fix the problem.
116
117 This version (5.00402) of perl has passed most of the tests on my
118 system:
119
120 Failed Test Status Wstat Total Fail Failed List of failed
121 ------------------------------------------------------------------------------
122 io/pipe.t 10 2 20.00% 7, 9
123 io/tell.t 13 1 7.69% 12
124 lib/complex.t 762 13 1.71% 84-85, 248-251, 257, 272-273,
125 371, 380, 419-420
126 lib/io_pipe.t 10 1 10.00% 9
127 lib/io_tell.t 13 1 7.69% 12
128 op/magic.t 30 2 6.67% 29-30
129 Failed 6/152 test scripts, 96.05% okay. 20/4359 subtests failed, 99.54% okay.
130
131 Pipes always cause problems with MiNT, it's actually a surprise that
132 most of the tests did work. I've got no idea why the "tell" test
133 failed, this shouldn't mean too big a problem however.
134
135 Most of the failures of lib/complex seem to be harmless, actually
136 errors far right to the decimal point... Two failures seem to be
137 serious: The sign of the results is reversed. I would say that this is
138 due to minor bugs in the portable math lib that I compiled perl with.
139
140 I haven't bothered very much to find the reason for the failures with
141 op/magic.t and op/stat.t. Maybe you'll find it out.
142
143 ##########################################################################
144
145 Another possible problem may arise from the implementation of the "pwd"
146 command. It happened to add a carriage return and newline to its
147 output no matter what the setting of $UNIXMODE is. This is quite
148 annoying since many library modules for perl take the output of pwd,
149 chop off the trailing newline character and then expect to see a valid
150 path in that. But the carriage return (last but second character!)
151 isn't chopped off. You can either try to patch all library modules (at
152 the price of performance for the extra transformation) or you can use
153 my version of pwd that doesn't suffer from this deficiency.
154
155 The fixed implementation is in the mint subdirectory. Running
156 "Configure" will attempt to build and install it if necessary
157 (hints/mint.sh will do this work) but you can build and install it
158 explicitly by:
159
160 cd mint
161 make install
162
163 This is the fastest solution.
164
165 Just in case you want to go the hard way: perl won't even build with a
166 broken pwd! You will have to fix the library modules
167 (ext/POSIX/POSIX.pm, lib/Cwd.pm, lib/pwd.pl) at last after building
168 miniperl.
169
170 A major nuisance of current MiNTLib versions is the implementation of
171 system() which is far from being POSIX compliant. A real system()
172 should fork and then exec /bin/sh with its argument as a command line
173 to the shell. The MiNTLib system() however doesn't expect that every
174 user has a POSIX shell in /bin/sh. It tries to work around the problem
175 by forking and exec'ing the first token in its argument string. To get
176 a little bit of compliance to POSIX system() it tries to handle at
177 least redirection ("<" or ">") on its own behalf.
178
179 This isn't a good idea since many programs expect that they can pass a
180 command line to system() that exploits all features of a POSIX shell.
181 If you use the MiNTLib version of system() with perl the Perl function
182 system() will suffer from the same deficiencies.
183
184 You will find a fixed version of system() in the mint subdirectory.
185 You can easily insert this version into your system libc:
186
187 cd mint
188 make system.o
189 ar r /usr/lib/libc.a
190 ranlib /usr/lib/libc.a
191
192 If you are suspicious you should either back up your libc before or
193 extract the original system.o from your libc with "ar x /usr/lib/libc.a
194 system.o". You can then backup the system.o module somewhere before
195 you succeed.
196
197 Anything missing? Yep, I've almost forgotten... No file in this
198 distribution without a fine saying. Take this one:
199
200 "From a thief you should learn: (1) to work at night;
201 (2) if one cannot gain what one wants in one night to
202 try again the next night; (3) to love one's coworkers
203 just as thieves love each other; (4) to be willing to
204 risk one's life even for a little thing; (5) not to
205 attach too much value to things even though one has
206 risked one's life for them - just as a thief will resell
207 a stolen article for a fraction of its real value;
208 (6) to withstand all kinds of beatings and tortures
209 but to remain what you are; and (7) to believe your
210 work is worthwhile and not be willing to change it."
211
212 -- Rabbi Dov Baer, Maggid of Mezeritch
213
214 OK, this was my motto while working on Perl for MiNT, especially rule
215 (1)...
216
217 Have fun with Perl!
218
220 Guido Flohr
221
222 mailto:guido@FreeMiNT.de
223
224
225
226perl v5.10.1 2009-02-12 PERLMINT(1)