Sign in Join
Wiki copytemporary

FPC AIX Port: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1+## Contents
2+
3+ * 1 Overview
4+ * 2 Snapshots
5+ * 3 Port information
6+ * 3.1 Required helper tools
7+ * 3.2 Debugger
8+ * 3.3 Line info unit for symbolicating backtraces
9+ * 3.4 Assembler/linker
10+ * 3.5 Cross-compiling
11+ * 3.6 Supported OS versions
12+ * 4 AIX quirks
13+ * 4.1 Reading from NULL pointers
14+ * 4.2 Unicode/code page support
15+ * 4.3 Maximum number of processes/threads
16+ * 4.4 Maximum amount of memory per process
17+ * 4.5 Shared library initialisation order
18+ * 5 Getting access to an AIX system
19+ * 5.1 Via the GCC compile farm
20+ * 5.2 Via IBM
21+
122# Overview
223
3-As of revision 20851, FPC svn trunk supports targeting the AIX operating system.
24+As of revision 20851, FPC svn trunk supports targeting the AIX operating system.
425
5-AIX is a UNIX platform and hence treated like one by FPC. As of revision 21053, FPC can create both AIX/PowerPC 32 bit and AIX/PowerPC64 applications and libraries. Note that gcc and xlc on AIX by default generate 32 bit code. The reason is that on PowerPC, 32 bit programs are usually faster and use less memory than 64 bit ones.
26+AIX is a UNIX platform and hence treated like one by FPC. As of revision 21053, FPC can create both AIX/PowerPC 32 bit and AIX/PowerPC64 applications and libraries. Note that gcc and xlc on AIX by default generate 32 bit code. The reason is that on PowerPC, 32 bit programs are usually faster and use less memory than 64 bit ones.
627
728# Snapshots
829
9-An initial snapshot is available in two flavours: a native AIX compiler, and a cross-compiler from Windows. Note that these are not compiled from the version that was committed to svn, but from a slightly older version. It is unlikely that future binary snapshots will be created (unless someone volunteers), but as of the next major release, (native) AIX compilers will be included;
30+An initial snapshot is available in two flavours: a native AIX compiler, and a cross-compiler from Windows. Note that these are not compiled from the version that was committed to svn, but from a slightly older version. It is unlikely that future binary snapshots will be created (unless someone volunteers), but as of the next major release, (native) AIX compilers will be included;
1031
11-- [Native AIX/PowerPC snapshot](ftp://ftp.freepascal.org/pub/fpc/contrib/aix/fpc-2.7.1.powerpc-aix-native-snapshot1.tbz)
12-- [Win32-\>AIX/PowerPC cross-snapshot](ftp://ftp.freepascal.org/pub/fpc/contrib/aix/fpc-2.7.1.powerpc-aix-win32.zip) (including cross-binutils -- **Warning**: FPC 3.0 and later require [newer binutils](ftp://ftp.freepascal.org/pub/fpc/contrib/aix/binutils%202.25.1-powerpc-aix-win32.zip))
32+ * [Native AIX/PowerPC snapshot](<ftp://ftp.freepascal.org/pub/fpc/contrib/aix/fpc-2.7.1.powerpc-aix-native-snapshot1.tbz>)
33+ * [Win32->AIX/PowerPC cross-snapshot](<ftp://ftp.freepascal.org/pub/fpc/contrib/aix/fpc-2.7.1.powerpc-aix-win32.zip>) (including cross-binutils -- **Warning** : FPC 3.0 and later require [newer binutils](<ftp://ftp.freepascal.org/pub/fpc/contrib/aix/binutils%202.25.1-powerpc-aix-win32.zip>))
1334
1435# Port information
1536
1637## Required helper tools
1738
18-To compile the compiler on AIX, you must have the AIX assembler and linker installed, as well as GNU diffutils and GNU make.
19-
20-To cross-compile from other platforms, you need the GNU BinUtils configured as follows:
39+To compile the compiler on AIX, you must have the AIX assembler and linker installed, as well as GNU diffutils and GNU make.
2140
22-` ./configure --target=powerpc-ibm-aix5.3 --with-sysroot`
41+To cross-compile from other platforms, you need the GNU BinUtils configured as follows:
42+```
43+./configure --target=powerpc-ibm-aix5.3 --with-sysroot
44+```
2345
24-Note that the extra "5.3" at the end is required. Afterwards, rename the generated binaries from *powerpc-ibm-aix5.3-as* etc to *powerpc-aix-as*, as those are the names that the compiler expects (*-XPpowerpc-ibm-aix5.3-* won't work, as the compiler currently does not support dots in prefixes).
46+Note that the extra "5.3" at the end is required. Afterwards, rename the generated binaries from _powerpc-ibm-aix5.3-as_ etc to _powerpc-aix-as_ , as those are the names that the compiler expects (_-XPpowerpc-ibm-aix5.3-_ won't work, as the compiler currently does not support dots in prefixes).
2547
2648## Debugger
2749
28-AIX uses its own debugging format, Stabx. As the name implies, this is a variant of the regular Stabs format, but it has some differences. GDB on AIX does not fully support the Stabx format, but instead supports a hybrid format between regular Stabs and Stabx, which is also generated by GCC. FPC generates this same hybrid information. The result is that FPC-generated binaries compiled with debug information can be debugged by GDB on AIX, but not (fully) by DBX, the native AIX debugger.
50+AIX uses its own debugging format, Stabx. As the name implies, this is a variant of the regular Stabs format, but it has some differences. GDB on AIX does not fully support the Stabx format, but instead supports a hybrid format between regular Stabs and Stabx, which is also generated by GCC. FPC generates this same hybrid information. The result is that FPC-generated binaries compiled with debug information can be debugged by GDB on AIX, but not (fully) by DBX, the native AIX debugger.
2951
30-The default GDB compiles without any problems on AIX. A compiled version of GDB 7.3.1 for AIX can also be downloaded from [our ftp site](ftp://ftp.freepascal.org/pub/fpc/contrib/aix/gdb-7.3.1-aix5.3.tar.bz2).
52+The default GDB compiles without any problems on AIX. A compiled version of GDB 7.3.1 for AIX can also be downloaded from [our ftp site](<ftp://ftp.freepascal.org/pub/fpc/contrib/aix/gdb-7.3.1-aix5.3.tar.bz2>).
3153
3254## Line info unit for symbolicating backtraces
3355
34-No support has been added (yet) for the AIX debugging format (Stabx) to the lineinfo unit. Instead, when compiling with -gl, the resulting binary will launch gdb to symbolicate backtraces. This can cause trouble if you are debugging a program compiled with -gl, since this newly launched will not be able to attach to the process in that case. The reason is that a process can only be debugged by one debugger at a time.
56+No support has been added (yet) for the AIX debugging format (Stabx) to the lineinfo unit. Instead, when compiling with -gl, the resulting binary will launch gdb to symbolicate backtraces. This can cause trouble if you are debugging a program compiled with -gl, since this newly launched will not be able to attach to the process in that case. The reason is that a process can only be debugged by one debugger at a time.
3557
3658## Assembler/linker
3759
38-When compiling/linking an AIX program/library on a platform other than AIX, FPC assumes that the used assembler and linker are from the GNU BinUtils. When compiling/linking an AIX program/library on AIX itself, only the native AIX assembler and linker are supported. The reason is that the native and GNU BinUtils linker require the object files to be specified in a different way, and we differentiate between the two based on the target OS on which the program has to be linked.
60+When compiling/linking an AIX program/library on a platform other than AIX, FPC assumes that the used assembler and linker are from the GNU BinUtils. When compiling/linking an AIX program/library on AIX itself, only the native AIX assembler and linker are supported. The reason is that the native and GNU BinUtils linker require the object files to be specified in a different way, and we differentiate between the two based on the target OS on which the program has to be linked.
3961
4062## Cross-compiling
4163
42-When cross-compiling, you not only need cross-BinUtils as explained above, but also a copy of the AIX libraries from the target system. These libraries are located in */usr/lib* on the AIX system. On your build system, create a directory hierarchy like this:
43-
44-` aixroot/`\
45-` aixroot/usr/`\
46-` aixroot/usr/lib/`
64+When cross-compiling, you not only need cross-BinUtils as explained above, but also a copy of the AIX libraries from the target system. These libraries are located in _/usr/lib_ on the AIX system. On your build system, create a directory hierarchy like this:
65+```
66+aixroot/
67+ aixroot/usr/
68+ aixroot/usr/lib/
69+```
4770
48-After copying the contents of */usr/lib* on the AIX system to *aixroot/usr/lib* to your build system, create a symbolic link called *lib* in the *aixroot* directory that points to *usr/lib*. If you are on a system that does not support symbolic links, you can simply create a directory called *lib* in *aixroot* and copy *usr/lib/*.o* into this *lib* directory.
71+After copying the contents of _/usr/lib_ on the AIX system to _aixroot/usr/lib_ to your build system, create a symbolic link called _lib_ in the _aixroot_ directory that points to _usr/lib_. If you are on a system that does not support symbolic links, you can simply create a directory called _lib_ in _aixroot_ and copy _usr/lib/*.o_ into this _lib_ directory.
4972
50-Finally, when compiling for AIX always specify the full path to this *aixroot* directory via *-XR/full/path/to/aixroot* to the compiler.
73+Finally, when compiling for AIX always specify the full path to this _aixroot_ directory via _-XR/full/path/to/aixroot_ to the compiler.
5174
5275## Supported OS versions
5376
54-IBM supports backward compatibility as long as you only use the system libraries for OS interfacing, which is what FPC does. The compiler and test suite have been verified as working on AIX 5.3, and hence should work on AIX 5.3 and later.
77+IBM supports backward compatibility as long as you only use the system libraries for OS interfacing, which is what FPC does. The compiler and test suite have been verified as working on AIX 5.3, and hence should work on AIX 5.3 and later.
5578
5679# AIX quirks
5780
5881## Reading from NULL pointers
5982
60-AIX does **not** raise an exception when reading from NULL pointers and other low addresses (up to 16KB on a test system, but there is no documentation about the upper limit). The reason is that this allows compilers to speculatively dereference pointers while scheduling code before NULL pointer checks. Writing to NULL pointers or other low addresses will still result in segmentation faults like on other supported platforms.
83+AIX does **not** raise an exception when reading from NULL pointers and other low addresses (up to 16KB on a test system, but there is no documentation about the upper limit). The reason is that this allows compilers to speculatively dereference pointers while scheduling code before NULL pointer checks. Writing to NULL pointers or other low addresses will still result in segmentation faults like on other supported platforms.
6184
62-There is no system option to disable this behaviour. Since IBM's compiler makes extensive use of this property, doing so would result in many application crashes anyway since the system libraries have been compiled with this assumption.
85+There is no system option to disable this behaviour. Since IBM's compiler makes extensive use of this property, doing so would result in many application crashes anyway since the system libraries have been compiled with this assumption.
6386
64-FPC has added an extra code generation option titled -CN that instructs the compiler to add additional code to check that memory reads do not load data from such low addresses. If such an access is detected, a run time error 216 will be raised.
87+FPC has added an extra code generation option titled -CN that instructs the compiler to add additional code to check that memory reads do not load data from such low addresses. If such an access is detected, a run time error 216 will be raised.
6588
6689## Unicode/code page support
6790
68-Like on other UNIX and UNIX-like platforms, for unicodestring support FPC requires that libiconv functionality is available. On AIX, this library is not always installed by default. If it is not available, you can install it using the *bos.rte.iconv* package. Also install the *bos.iconv.ucs.pc* package if you want to support common Windows code pages.
91+Like on other UNIX and UNIX-like platforms, for unicodestring support FPC requires that libiconv functionality is available. On AIX, this library is not always installed by default. If it is not available, you can install it using the _bos.rte.iconv_ package. Also install the _bos.iconv.ucs.pc_ package if you want to support common Windows code pages.
6992
70-AIX' libiconv is somewhat more limited than libiconv on most other platforms. In particular, its libiconv supports code page 866 only when converting from or to ISO-8859-5. These code pages both support the same Cyrillic characters, but are different in terms of special characters. This means that converting from UTF-8/16/32 to code page 866 will be lossy as far as those special characters are concerned.
93+AIX' libiconv is somewhat more limited than libiconv on most other platforms. In particular, its libiconv supports code page 866 only when converting from or to ISO-8859-5. These code pages both support the same Cyrillic characters, but are different in terms of special characters. This means that converting from UTF-8/16/32 to code page 866 will be lossy as far as those special characters are concerned.
7194
7295## Maximum number of processes/threads
7396
74-By default, the maximum number of processes per user may be fairly limited (128 on a test system). Individual threads count as a process in this context. You can increase this limit by executing *smit chgsys* as superuser and then changing the *Maximum number of PROCESSES allowed per user* setting.
97+By default, the maximum number of processes per user may be fairly limited (128 on a test system). Individual threads count as a process in this context. You can increase this limit by executing _smit chgsys_ as superuser and then changing the _Maximum number of PROCESSES allowed per user_ setting.
7598
7699## Maximum amount of memory per process
77100
78-By default, the maximum amount of memory that a single process can allocate may be fairly limited (128MB on a test system). You can increase this amount by setting the *LDR_CNTRL* environment variable. E.g., *export LDR_CNTRL=MAXDATA=0x20000000* in a Bourne sh-compatible shell will increase this amount to 256MB. See [IBM's site](http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.user.aix32.60%2Fuser%2Faix_auto_ldr_cntrl.html) for more information.
101+By default, the maximum amount of memory that a single process can allocate may be fairly limited (128MB on a test system). You can increase this amount by setting the _LDR_CNTRL_ environment variable. E.g., _export LDR_CNTRL=MAXDATA=0x20000000_ in a Bourne sh-compatible shell will increase this amount to 256MB. See [IBM's site](<http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.user.aix32.60%2Fuser%2Faix_auto_ldr_cntrl.html>) for more information.
79102
80103## Shared library initialisation order
81104
82-AIX does not guarantee the order in which dynamic libraries are loaded and initialised. In particular, its dynamic linker/loader does not follow library dependency chains and will not automatically initialise dependent libraries before others. AIX does however allow you to manually [define priorities](http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=%2Fcom.ibm.xlcpp111.aix.doc%2Fproguide%2Finit_module.html) for each library to influence this initialization order. Getting this to work properly is however not easy.
105+AIX does not guarantee the order in which dynamic libraries are loaded and initialised. In particular, its dynamic linker/loader does not follow library dependency chains and will not automatically initialise dependent libraries before others. AIX does however allow you to manually [define priorities](<http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=%2Fcom.ibm.xlcpp111.aix.doc%2Fproguide%2Finit_module.html>) for each library to influence this initialization order. Getting this to work properly is however not easy.
83106
84107# Getting access to an AIX system
85108
86109## Via the GCC compile farm
87110
88-The [GCC compile farm](http://gcc.gnu.org/wiki/CompileFarm) offers free accounts to all developers of free and open source software packages for testing. Recently they added an AIX server to the pool of available machines. Note that many of the GNU utilities required to build and test FPC are not installed on that machine. You can work around that by adding */home/muller/bin* to your path :)
111+The [GCC compile farm](<http://gcc.gnu.org/wiki/CompileFarm>) offers free accounts to all developers of free and open source software packages for testing. Recently they added an AIX server to the pool of available machines. Note that many of the GNU utilities required to build and test FPC are not installed on that machine. You can work around that by adding _/home/muller/bin_ to your path :)
89112
90113## Via IBM
91114
92-Companies can register (for free) to become a member of the [IBM PartnerWorld program](http://www.ibm.com/partnerworld). The only downside is that you cannot disable getting their (regular) commercial emails on your primary contact address.
115+Companies can register (for free) to become a member of the [IBM PartnerWorld program](<http://www.ibm.com/partnerworld>). The only downside is that you cannot disable getting their (regular) commercial emails on your primary contact address.
93116
94-Once you are a PartnerWorld member, you can (for free) make use of their [Power Development Program](http://www.ibm.com/partnerworld/wps/pub/systems/vlp). This program provides you with remote access via VPN to virtual machines running various versions of or Linux and AIX on various kinds of POWER processors (POWER 5, 6, 7 and 8). You have full root access to these VMs, and they can run continuously for up to 14 days at a time. You can however (automatically) save the contents of your virtual disk image on IBM's servers for use during subsequent reservations.
117+Once you are a PartnerWorld member, you can (for free) make use of their [Power Development Program](<http://www.ibm.com/partnerworld/wps/pub/systems/vlp>). This program provides you with remote access via VPN to virtual machines running various versions of or Linux and AIX on various kinds of POWER processors (POWER 5, 6, 7 and 8). You have full root access to these VMs, and they can run continuously for up to 14 days at a time. You can however (automatically) save the contents of your virtual disk image on IBM's servers for use during subsequent reservations.
95118
96119---
97-*From the Free Pascal wiki, page "FPC AIX Port", as it stood on 2016-01-21 after a change by Jonas, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
98-Category: AIX
99-Category: FPC
120+*From the Free Pascal wiki, page "FPC AIX Port", as the Internet Archive kept it on 2024-06-02. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history