Skip to content
🎉 Free Pascal v3.2.4 is out! See Release Notes
FAQ
UNIX Related

UNIX Related

This section also applies to most UNIX variants, such as Linux, FreeBSD and Mac OS X.

1 - Releasing software generated by the UNIX compilers
  • There is no stack space usage limit.
  • Stack checking is simulated.
  • Minimal operating system versions :
OS Minimal Version
Linux Kernel v2.4.x or later
FreeBSD version 5.x or later. (4.x can be made to work with minor work)
NetBSD version 1.5 or later
Solaris version 5.7 of SunOS or later (should work with earlier versions, but untested)
Mac OS X version 10.4 or later (Intel), or 10.3.9 or later (PowerPC)
2 - Debugging

The GNU debugger v6.5 and later have been tested, and generally work as they should. Because the GNU debugger is C oriented, some pascal types might not be represented as they should.

3 - Dynamic libraries

Creating dynamic libraries under UNIX-like operating systems is supported.

Importing code from shared libraries does work as expected though, since it does not require usage of position independent code.

4 - Profiling

Profiling is supported using gprof under linux, FreeBSD and NetBSD, the latter two only since 1.0.8. On other other UNIX-like operating systems, profiling is currently not supported.

5 - Libc is missing on platforms other than Linux/i386

Libc is a Kylix compatibility unit. Because it contains many i386 specific code and features structures from legacy kernels, it has not been made available on other platforms.

To access UNIX functionality, please use units like baseunix and unix.

6 - Why can’t the linker find vga?

This error typically looks like this:

  Free Pascal Compiler version 3.0.x [xxxx/yy/zz] for i386
  Copyright (c) 1993-2008 by Florian Klaempfl
  Target OS: Linux for i386
  Compiling test.pp
  Assembling test
  Linking test
  /usr/bin/ld: cannot find -lvga
  test.pp(6,4) Warning: Error while linking Closing script ppas.sh 5 Lines
  compiled, 0.2 sec

This error is not an error in the installation of FPC or FPC itself, but a missing Svgalib library in your UNIX install. Please install the required library using your favorite package manager tool.

7 - Compiler indicates missing as and ld

Normally UNIX systems have the assembler (as) and linker (ld) pre-installed and already in the search path. That is the reason why these tools are not supplied with the compiler.

If the compiler cannot find these tools, either they are not in your search path, or they are not installed. You should either add the path where the tools are located to your search path, and / or you should install these tools.

8 - link.res syntax error, or ‘did you forget -T’?

There was a bug in GNU LD 2.19 that caused it to crash when processing FPC-generated linker scripts. This bug has been fixed in GNU LD 2.19.1.

At the same time, LD has been modified to emit a warning of the form

/usr/bin/ld: warning: link.res contains output sections; did you forget -T?

FPC 3.1.1 and later by default generate a different kind of linker script that no longer triggers this warning. Unfortunately, this is only possible by making use of functionality that is unavailable before GNU LD 2.19. Earlier versions therefore now complain about a syntax error in link.res. The new -X9 compiler command line parameter can, however, be used to generate linker scripts that are compatible with pre-2.19 linker versions.

Their is no way to remove the -T warning with earlier FPC versions, but it should not result in any problems.