Right. I don't have a running RPi at the moment, which rules me out for practical experimentation.
CodeTyphon IDE. Additional compiler options -fPIC -Xc
Try it using either Lazarus or FPC with a makefile or properly-described command line. If you still have problems post the exported ("published") Lazarus project here, and then hands-off to hopefully gave somebody a chance to look at it.
I've definitely had separately-linked code (i.e. .so etc.) running on an RPi before now, but looking at some of my stuff: because of the way I generate it (from a .inc describing the interface using a utility I've not published) the way I've done it is to have
* A concise main unit declaring appropriate exports.
* The main unit imports what it needs from other units, which initialise etc. stuff without problems.
hence
(* FPC 2.6.4 on Linux or Solaris FPC 2.6.4 on Linux or Solaris FPC 2.6.4 on Lin *)
library Analyzer_Vcd;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads, (* <================ THIS IS REQUIRED!!!!! =============== *)
{$ENDIF}
Classes, Analyzer_VcdCode;
{ #todo -oMarkMLl -cLA : Issue with constant/variable export here. }
exports
MagicNumber, State, Trigger, Stop, Rearm, Running;
end.
with all the work done in the Analyzer_VcdCode unit.
Note that TODO I've got in there, from experience on x86_64 Debian Linux (i.e. I'd expect the linker etc. to be reasonably similar to what's on an RPi). However my recollection of that is that that was strictly related to *exporting* the MagicNumber variable rather than to initialising it.
However it looks as though you've hit something which is at least in part platform-specific, and it is by no means outside the bounds of possibility that the CodeTyphon project has applied unpublished patches to the way FPC interacts with the linker.
MarkMLl