1PERLAIX(1) Perl Programmers Reference Guide PERLAIX(1)
2
3
4
6 README.aix - Perl version 5 on IBM Unix (AIX) systems
7
9 This document describes various features of IBM's Unix operating system
10 (AIX) that will affect how Perl version 5 (hereafter just Perl) is
11 compiled and/or runs.
12
13 Compiling Perl 5 on AIX
14 For information on compilers on older versions of AIX, see "Compiling
15 Perl 5 on older AIX versions up to 4.3.3".
16
17 When compiling Perl, you must use an ANSI C compiler. AIX does not ship
18 an ANSI compliant C-compiler with AIX by default, but binary builds of
19 gcc for AIX are widely available.
20
21 Supported Compilers
22 Currently all versions of IBM's "xlc", "xlc_r", "cc", "cc_r" or "vac"
23 ANSI/C compiler will work for building Perl if that compiler works on
24 your system.
25
26 If you plan to link Perl to any module that requires thread-support,
27 like DBD::Oracle, it is better to use the _r version of the compiler.
28 This will not build a threaded Perl, but a thread-enabled Perl. See
29 also "Threaded Perl" later on.
30
31 As of writing (2009-08) only the IBM XL C for AIX or XL C/C++ for AIX
32 compiler is supported by IBM on AIX 5L/6.1.
33
34 The following compiler versions are supported by IBM:
35
36 XL C and XL C/C++ V7, V8, V9, V10
37
38 The XL C for AIX is integrated in the XL C/C++ for AIX compiler.
39
40 If you choose XL C/C++ V9 you need APAR IZ35785 installed otherwise the
41 integrated SDBM_File do not compile correctly due to an optimization
42 bug. You can circumvent this problem by adding -qipa to the
43 optimization flags (-Doptimize='-O -qipa'). The PTF for APAR IZ35785
44 which solves this problem is available from IBM (April 2009 PTF for XL
45 C/C++ Enterprise Edition for AIX, V9.0).
46
47 Perl can be compiled with either IBM's ANSI C compiler or with gcc.
48 The former is recommended, as not only it can compile Perl with no
49 difficulty, but also can take advantage of features listed later that
50 require the use of IBM compiler-specific command-line flags.
51
52 If you decide to use gcc, make sure your installation is recent and
53 complete, and be sure to read the Perl INSTALL file for more gcc-
54 specific details. Please report any hoops you had to jump through to
55 the development team.
56
57 Incompatibility with AIX Toolbox lib gdbm
58 If the AIX Toolbox version of lib gdbm 1.8.x is installed on the system
59 then Perl will not work. This library contains a defect version of the
60 dbm_store() function. The lib gdbm will be automatically removed from
61 the wanted libraries.
62
63 Perl 5.10 was successfully compiled and tested on:
64 AIX Level | Compiler Level | w th | w/o th
65 --------------------------+-------------------------+------+-------
66 5.1 TL9 32 bit | XL C/C++ V7 | OK | OK
67 5.1 TL9 32 bit | gcc 3.2.2 | OK | OK
68 5.1 TL9 64 bit | XL C/C++ V7 | OK | OK
69 5.2 TL10 32 bit | XL C/C++ V8 | OK | OK
70 5.2 TL8 64 bit | VA C/C++ V6 | OK | OK
71 5.2 TL10 64 bit | XL C/C++ V8 | OK | OK
72 5.3 TL7 32 bit | XL C/C++ V9 + IZ35785 | OK | OK
73 5.3 TL7 32 bit | gcc 4.2.4 | OK | OK
74 5.3 TL7 64 bit | XL C/C++ V9 + IZ35785 | OK | OK
75 6.1 TL1 32 bit | XL C/C++ V10 | OK | OK
76 6.1 TL1 64 bit + IZ39077 | XL C/C++ V10 | OK | OK
77
78 w th = with thread
79 w/o th = without thread
80 OK = tested
81
82 Successfully tested means that all "make test" runs finish with an
83 result of 100% OK. All tests were conducted with -Duseshrplib set.
84
85 Building Dynamic Extensions on AIX
86 Starting from Perl 5.7.2 (and consequently 5.8.x / 5.10.x) and AIX 4.3
87 or newer Perl uses the AIX native dynamic loading interface in the so
88 called runtime linking mode instead of the emulated interface that was
89 used in Perl releases 5.6.1 and earlier or, for AIX releases 4.2 and
90 earlier. This change does break backward compatibility with compiled
91 modules from earlier Perl releases. The change was made to make Perl
92 more compliant with other applications like Apache/mod_perl which are
93 using the AIX native interface. This change also enables the use of C++
94 code with static constructors and destructors in Perl extensions, which
95 was not possible using the emulated interface.
96
97 It is highly recommended to use the new interface.
98
99 Using Large Files with Perl
100 Should yield no problems.
101
102 Threaded Perl
103 Should yield no problems with AIX 5.1 / 5.2 / 5.3 and 6.1.
104
105 IBM uses the AIX system Perl (V5.6.0 on AIX 5.1 and V5.8.2 on AIX 5.2 /
106 5.3 and 6.1) for some AIX system scripts. If you switch the links in
107 /usr/bin from the AIX system Perl (/usr/opt/perl5) to the newly build
108 Perl then you get the same features as with the IBM AIX system Perl if
109 the threaded options are used.
110
111 The threaded Perl build works also on AIX 5.1 but the IBM Perl build
112 (Perl v5.6.0) is not threaded on AIX 5.1.
113
114 64-bit Perl
115 If your AIX system is installed with 64-bit support, you can expect
116 64-bit configurations to work. If you want to use 64-bit Perl on AIX
117 6.1 you need a APAR for a libc.a bug which affects (n)dbm_XXX
118 functions. The APAR number for this problem is IZ39077.
119
120 If you need more memory (larger data segment) for your Perl programs
121 you can set:
122
123 /etc/security/limits
124 default: (or your user)
125 data = -1 (default is 262144 * 512 byte)
126
127 With the default setting the size is limited to 128MB. The -1 removes
128 this limit. If the "make test" fails please change your
129 /etc/security/limits as stated above.
130
131 Recommended Options AIX 5.1/5.2/5.3 and 6.1 (threaded/32-bit)
132 With the following options you get a threaded Perl version which passes
133 all make tests in threaded 32-bit mode, which is the default
134 configuration for the Perl builds that AIX ships with.
135
136 rm config.sh
137 ./Configure \
138 -d \
139 -Dcc=cc_r \
140 -Duseshrplib \
141 -Dusethreads \
142 -Dprefix=/usr/opt/perl5_32
143
144 The -Dprefix option will install Perl in a directory parallel to the
145 IBM AIX system Perl installation.
146
147 Recommended Options AIX 5.1/5.2/5.3 and 6.1 (32-bit)
148 With the following options you get a Perl version which passes all make
149 tests in 32-bit mode.
150
151 rm config.sh
152 ./Configure \
153 -d \
154 -Dcc=cc_r \
155 -Duseshrplib \
156 -Dprefix=/usr/opt/perl5_32
157
158 The -Dprefix option will install Perl in a directory parallel to the
159 IBM AIX system Perl installation.
160
161 Recommended Options AIX 5.1/5.2/5.3 and 6.1 (threaded/64-bit)
162 With the following options you get a threaded Perl version which passes
163 all make tests in 64-bit mode.
164
165 export OBJECT_MODE=64 / setenv OBJECT_MODE 64 (depending on your shell)
166
167 rm config.sh
168 ./Configure \
169 -d \
170 -Dcc=cc_r \
171 -Duseshrplib \
172 -Dusethreads \
173 -Duse64bitall \
174 -Dprefix=/usr/opt/perl5_64
175
176 Recommended Options AIX 5.1/5.2/5.3 and 6.1(64-bit)
177 With the following options you get a Perl version which passes all make
178 tests in 64-bit mode.
179
180 export OBJECT_MODE=64 / setenv OBJECT_MODE 64 (depending on your shell)
181
182 rm config.sh
183 ./Configure \
184 -d \
185 -Dcc=cc_r \
186 -Duseshrplib \
187 -Duse64bitall \
188 -Dprefix=/usr/opt/perl5_64
189
190 The -Dprefix option will install Perl in a directory parallel to the
191 IBM AIX system Perl installation.
192
193 If you choose gcc to compile 64-bit Perl then you need to add the
194 following option:
195
196 -Dcc='gcc -maix64'
197
198 Compiling Perl 5 on older AIX versions up to 4.3.3
199 Due to the fact that AIX 4.3.3 reached end-of-service in December 31,
200 2003 this information is provided as is. The Perl versions prior to
201 Perl 5.8.9 could be compiled on AIX up to 4.3.3 with the following
202 settings (your mileage may vary):
203
204 When compiling Perl, you must use an ANSI C compiler. AIX does not ship
205 an ANSI compliant C-compiler with AIX by default, but binary builds of
206 gcc for AIX are widely available.
207
208 At the moment of writing, AIX supports two different native C
209 compilers, for which you have to pay: xlC and vac. If you decide to use
210 either of these two (which is quite a lot easier than using gcc), be
211 sure to upgrade to the latest available patch level. Currently:
212
213 xlC.C 3.1.4.10 or 3.6.6.0 or 4.0.2.2 or 5.0.2.9 or 6.0.0.3
214 vac.C 4.4.0.3 or 5.0.2.6 or 6.0.0.1
215
216 note that xlC has the OS version in the name as of version 4.0.2.0, so
217 you will find xlC.C for AIX-5.0 as package
218
219 xlC.aix50.rte 5.0.2.0 or 6.0.0.3
220
221 subversions are not the same "latest" on all OS versions. For example,
222 the latest xlC-5 on aix41 is 5.0.2.9, while on aix43, it is 5.0.2.7.
223
224 Perl can be compiled with either IBM's ANSI C compiler or with gcc.
225 The former is recommended, as not only can it compile Perl with no
226 difficulty, but also can take advantage of features listed later that
227 require the use of IBM compiler-specific command-line flags.
228
229 The IBM's compiler patch levels 5.0.0.0 and 5.0.1.0 have compiler
230 optimization bugs that affect compiling perl.c and regcomp.c,
231 respectively. If Perl's configuration detects those compiler patch
232 levels, optimization is turned off for the said source code files.
233 Upgrading to at least 5.0.2.0 is recommended.
234
235 If you decide to use gcc, make sure your installation is recent and
236 complete, and be sure to read the Perl INSTALL file for more gcc-
237 specific details. Please report any hoops you had to jump through to
238 the development team.
239
240 OS level
241 Before installing the patches to the IBM C-compiler you need to know
242 the level of patching for the Operating System. IBM's command 'oslevel'
243 will show the base, but is not always complete (in this example oslevel
244 shows 4.3.NULL, whereas the system might run most of 4.3.THREE):
245
246 # oslevel
247 4.3.0.0
248 # lslpp -l | grep 'bos.rte '
249 bos.rte 4.3.3.75 COMMITTED Base Operating System Runtime
250 bos.rte 4.3.2.0 COMMITTED Base Operating System Runtime
251 #
252
253 The same might happen to AIX 5.1 or other OS levels. As a side note,
254 Perl cannot be built without bos.adt.syscalls and bos.adt.libm
255 installed
256
257 # lslpp -l | egrep "syscalls|libm"
258 bos.adt.libm 5.1.0.25 COMMITTED Base Application Development
259 bos.adt.syscalls 5.1.0.36 COMMITTED System Calls Application
260 #
261
262 Building Dynamic Extensions on AIX
263 AIX supports dynamically loadable objects as well as shared libraries.
264 Shared libraries by convention end with the suffix .a, which is a bit
265 misleading, as an archive can contain static as well as dynamic
266 members. For Perl dynamically loaded objects we use the .so suffix
267 also used on many other platforms.
268
269 Note that starting from Perl 5.7.2 (and consequently 5.8.0) and AIX 4.3
270 or newer Perl uses the AIX native dynamic loading interface in the so
271 called runtime linking mode instead of the emulated interface that was
272 used in Perl releases 5.6.1 and earlier or, for AIX releases 4.2 and
273 earlier. This change does break backward compatibility with compiled
274 modules from earlier Perl releases. The change was made to make Perl
275 more compliant with other applications like Apache/mod_perl which are
276 using the AIX native interface. This change also enables the use of C++
277 code with static constructors and destructors in Perl extensions, which
278 was not possible using the emulated interface.
279
280 The IBM ANSI C Compiler
281 All defaults for Configure can be used.
282
283 If you've chosen to use vac 4, be sure to run 4.4.0.3. Older versions
284 will turn up nasty later on. For vac 5 be sure to run at least 5.0.1.0,
285 but vac 5.0.2.6 or up is highly recommended. Note that since IBM has
286 removed vac 5.0.2.1 through 5.0.2.5 from the software depot, these
287 versions should be considered obsolete.
288
289 Here's a brief lead of how to upgrade the compiler to the latest level.
290 Of course this is subject to changes. You can only upgrade versions
291 from ftp-available updates if the first three digit groups are the same
292 (in where you can skip intermediate unlike the patches in the developer
293 snapshots of Perl), or to one version up where the "base" is available.
294 In other words, the AIX compiler patches are cumulative.
295
296 vac.C.4.4.0.1 => vac.C.4.4.0.3 is OK (vac.C.4.4.0.2 not needed)
297 xlC.C.3.1.3.3 => xlC.C.3.1.4.10 is NOT OK (xlC.C.3.1.4.0 is not available)
298
299 # ftp ftp.software.ibm.com
300 Connected to service.boulder.ibm.com.
301 : welcome message ...
302 Name (ftp.software.ibm.com:merijn): anonymous
303 331 Guest login ok, send your complete e-mail address as password.
304 Password:
305 ... accepted login stuff
306 ftp> cd /aix/fixes/v4/
307 ftp> dir other other.ll
308 output to local-file: other.ll? y
309 200 PORT command successful.
310 150 Opening ASCII mode data connection for /bin/ls.
311 226 Transfer complete.
312 ftp> dir xlc xlc.ll
313 output to local-file: xlc.ll? y
314 200 PORT command successful.
315 150 Opening ASCII mode data connection for /bin/ls.
316 226 Transfer complete.
317 ftp> bye
318 ... goodbye messages
319 # ls -l *.ll
320 -rw-rw-rw- 1 merijn system 1169432 Nov 2 17:29 other.ll
321 -rw-rw-rw- 1 merijn system 29170 Nov 2 17:29 xlc.ll
322
323 On AIX 4.2 using xlC, we continue:
324
325 # lslpp -l | fgrep 'xlC.C '
326 xlC.C 3.1.4.9 COMMITTED C for AIX Compiler
327 xlC.C 3.1.4.0 COMMITTED C for AIX Compiler
328 # grep 'xlC.C.3.1.4.*.bff' xlc.ll
329 -rw-r--r-- 1 45776101 1 6286336 Jul 22 1996 xlC.C.3.1.4.1.bff
330 -rw-rw-r-- 1 45776101 1 6173696 Aug 24 1998 xlC.C.3.1.4.10.bff
331 -rw-r--r-- 1 45776101 1 6319104 Aug 14 1996 xlC.C.3.1.4.2.bff
332 -rw-r--r-- 1 45776101 1 6316032 Oct 21 1996 xlC.C.3.1.4.3.bff
333 -rw-r--r-- 1 45776101 1 6315008 Dec 20 1996 xlC.C.3.1.4.4.bff
334 -rw-rw-r-- 1 45776101 1 6178816 Mar 28 1997 xlC.C.3.1.4.5.bff
335 -rw-rw-r-- 1 45776101 1 6188032 May 22 1997 xlC.C.3.1.4.6.bff
336 -rw-rw-r-- 1 45776101 1 6191104 Sep 5 1997 xlC.C.3.1.4.7.bff
337 -rw-rw-r-- 1 45776101 1 6185984 Jan 13 1998 xlC.C.3.1.4.8.bff
338 -rw-rw-r-- 1 45776101 1 6169600 May 27 1998 xlC.C.3.1.4.9.bff
339 # wget ftp://ftp.software.ibm.com/aix/fixes/v4/xlc/xlC.C.3.1.4.10.bff
340 #
341
342 On AIX 4.3 using vac, we continue:
343
344 # lslpp -l | grep 'vac.C '
345 vac.C 5.0.2.2 COMMITTED C for AIX Compiler
346 vac.C 5.0.2.0 COMMITTED C for AIX Compiler
347 # grep 'vac.C.5.0.2.*.bff' other.ll
348 -rw-rw-r-- 1 45776101 1 13592576 Apr 16 2001 vac.C.5.0.2.0.bff
349 -rw-rw-r-- 1 45776101 1 14133248 Apr 9 2002 vac.C.5.0.2.3.bff
350 -rw-rw-r-- 1 45776101 1 14173184 May 20 2002 vac.C.5.0.2.4.bff
351 -rw-rw-r-- 1 45776101 1 14192640 Nov 22 2002 vac.C.5.0.2.6.bff
352 # wget ftp://ftp.software.ibm.com/aix/fixes/v4/other/vac.C.5.0.2.6.bff
353 #
354
355 Likewise on all other OS levels. Then execute the following command,
356 and fill in its choices
357
358 # smit install_update
359 -> Install and Update from LATEST Available Software
360 * INPUT device / directory for software [ vac.C.5.0.2.6.bff ]
361 [ OK ]
362 [ OK ]
363
364 Follow the messages ... and you're done.
365
366 If you like a more web-like approach, a good start point can be
367 http://www14.software.ibm.com/webapp/download/downloadaz.jsp and click
368 "C for AIX", and follow the instructions.
369
370 The usenm option
371 If linking miniperl
372
373 cc -o miniperl ... miniperlmain.o opmini.o perl.o ... -lm -lc ...
374
375 causes error like this
376
377 ld: 0711-317 ERROR: Undefined symbol: .aintl
378 ld: 0711-317 ERROR: Undefined symbol: .copysignl
379 ld: 0711-317 ERROR: Undefined symbol: .syscall
380 ld: 0711-317 ERROR: Undefined symbol: .eaccess
381 ld: 0711-317 ERROR: Undefined symbol: .setresuid
382 ld: 0711-317 ERROR: Undefined symbol: .setresgid
383 ld: 0711-317 ERROR: Undefined symbol: .setproctitle
384 ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
385
386 you could retry with
387
388 make realclean
389 rm config.sh
390 ./Configure -Dusenm ...
391
392 which makes Configure to use the "nm" tool when scanning for library
393 symbols, which usually is not done in AIX.
394
395 Related to this, you probably should not use the "-r" option of
396 Configure in AIX, because that affects of how the "nm" tool is used.
397
398 Using GNU's gcc for building Perl
399 Using gcc-3.x (tested with 3.0.4, 3.1, and 3.2) now works out of the
400 box, as do recent gcc-2.9 builds available directly from IBM as part of
401 their Linux compatibility packages, available here:
402
403 http://www.ibm.com/servers/aix/products/aixos/linux/
404
405 Using Large Files with Perl
406 Should yield no problems.
407
408 Threaded Perl
409 Threads seem to work OK, though at the moment not all tests pass when
410 threads are used in combination with 64-bit configurations.
411
412 You may get a warning when doing a threaded build:
413
414 "pp_sys.c", line 4640.39: 1506-280 (W) Function argument assignment between types "unsigned char*" and "const void*" is not allowed.
415
416 The exact line number may vary, but if the warning (W) comes from a
417 line line this
418
419 hent = PerlSock_gethostbyaddr(addr, (Netdb_hlen_t) addrlen, addrtype);
420
421 in the "pp_ghostent" function, you may ignore it safely. The warning
422 is caused by the reentrant variant of gethostbyaddr() having a slightly
423 different prototype than its non-reentrant variant, but the difference
424 is not really significant here.
425
426 64-bit Perl
427 If your AIX is installed with 64-bit support, you can expect 64-bit
428 configurations to work. In combination with threads some tests might
429 still fail.
430
431 AIX 4.2 and extensions using C++ with statics
432 In AIX 4.2 Perl extensions that use C++ functions that use statics may
433 have problems in that the statics are not getting initialized. In
434 newer AIX releases this has been solved by linking Perl with the libC_r
435 library, but unfortunately in AIX 4.2 the said library has an obscure
436 bug where the various functions related to time (such as time() and
437 gettimeofday()) return broken values, and therefore in AIX 4.2 Perl is
438 not linked against the libC_r.
439
441 H.Merijn Brand <h.m.brand@xs4all.nl> Rainer Tammer <tammer@tammer.net>
442
444 Version 0.0.10: 07 Aug 2009
445
446
447
448perl v5.10.1 2009-08-22 PERLAIX(1)