Quote Originally Posted by dmantione
You can add this code to system.pas for the gba, put this in system.pp:

[pascal]
{$DEFINE FPC_SYSTEM_HAS_MOD_LONGINT}
function fpc_mod_longint(n,z : longint) : longint;[public,alias:'FPC_MOD_LONGINT'];compilerproc;assembler
asm
swi #0x060000
mov r0, r1
bx lr
end;
[/pascal]

... and the compiler should use it.
If I try to add your code, i get
Code:
E:\fpc\fpc-2.0.x.source\rtl\gba>make CPU_TARGET=arm OS_TARGET=gba PP=ppcarm OPT="-Tgba"
ppcarm.exe -Tgba -XParm-gba- -Xc -Xr -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU../../rtl/units/arm-gba -Tgba -darm  -Us -Sg system.pp
..\..\rtl\units\arm-gba\system.s: Assembler messages:
..\..\rtl\units\arm-gba\system.s:49992: Error: symbol `fpc_mod_longint' is already defined
..\..\rtl\units\arm-gba\system.s:49994: Error: symbol `FPC_MOD_LONGINT' is already defined
system.pp(124,3) Error: Error while assembling exitcode 1
system.pp(124,3) Fatal: There were 2 errors compiling module, stopping
system.pp(124,3) Fatal: Compilation aborted
make: *** [system.ppu] Error 1
I'm trying to modify linux rtl. Maybe I should start a rtl porting from scratch :?