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 com‐
11 pile 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 with‐
17 out MiNT) you may want to accept some advice from somebody who already
18 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 stan‐
35 dard envariables like $PATH, $HOME, ... are set, there is a POSIX com‐
36 pliant 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 envi‐
49 ronment instead.
50
51 A problem has been reported with sed. Sed is used to create some con‐
52 figuration files based on the answers you have given to the Configure
53 script. Unfortunately the Perl Configure script shows sed on MiNT its
54 limits. I have sed 2.05 with a stacksize of 64k and I have encountered
55 no problems. If sed crashes during your configuration process you
56 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 sys‐
118 tem:
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 seri‐
137 ous: The sign of the results is reversed. I would say that this is due
138 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 out‐
147 put no matter what the setting of $UNIXMODE is. This is quite annoying
148 since many library modules for perl take the output of pwd, chop off
149 the trailing newline character and then expect to see a valid path in
150 that. But the carriage return (last but second character!) isn't
151 chopped off. You can either try to patch all library modules (at the
152 price of performance for the extra transformation) or you can use my
153 version of pwd that doesn't suffer from this deficiency.
154
155 The fixed implementation is in the mint subdirectory. Running "Config‐
156 ure" will attempt to build and install it if necessary (hints/mint.sh
157 will do this work) but you can build and install it explicitly by:
158
159 cd mint
160 make install
161
162 This is the fastest solution.
163
164 Just in case you want to go the hard way: perl won't even build with a
165 broken pwd! You will have to fix the library modules
166 (ext/POSIX/POSIX.pm, lib/Cwd.pm, lib/pwd.pl) at last after building
167 miniperl.
168
169 A major nuisance of current MiNTLib versions is the implementation of
170 system() which is far from being POSIX compliant. A real system()
171 should fork and then exec /bin/sh with its argument as a command line
172 to the shell. The MiNTLib system() however doesn't expect that every
173 user has a POSIX shell in /bin/sh. It tries to work around the problem
174 by forking and exec'ing the first token in its argument string. To get
175 a little bit of compliance to POSIX system() it tries to handle at
176 least redirection ("<" or ">") on its own behalf.
177
178 This isn't a good idea since many programs expect that they can pass a
179 command line to system() that exploits all features of a POSIX shell.
180 If you use the MiNTLib version of system() with perl the Perl function
181 system() will suffer from the same deficiencies.
182
183 You will find a fixed version of system() in the mint subdirectory.
184 You can easily insert this version into your system libc:
185
186 cd mint
187 make system.o
188 ar r /usr/lib/libc.a
189 ranlib /usr/lib/libc.a
190
191 If you are suspicious you should either back up your libc before or
192 extract the original system.o from your libc with "ar x /usr/lib/libc.a
193 system.o". You can then backup the system.o module somewhere before
194 you succeed.
195
196 Anything missing? Yep, I've almost forgotten... No file in this dis‐
197 tribution without a fine saying. Take this one:
198
199 "From a thief you should learn: (1) to work at night;
200 (2) if one cannot gain what one wants in one night to
201 try again the next night; (3) to love one's coworkers
202 just as thieves love each other; (4) to be willing to
203 risk one's life even for a little thing; (5) not to
204 attach too much value to things even though one has
205 risked one's life for them - just as a thief will resell
206 a stolen article for a fraction of its real value;
207 (6) to withstand all kinds of beatings and tortures
208 but to remain what you are; and (7) to believe your
209 work is worthwhile and not be willing to change it."
210
211 -- Rabbi Dov Baer, Maggid of Mezeritch
212
213 OK, this was my motto while working on Perl for MiNT, especially rule
214 (1)...
215
216 Have fun with Perl!
217
219 Guido Flohr
220
221 mailto:guido@FreeMiNT.de
222
223
224
225perl v5.8.8 2006-01-07 PERLMINT(1)