Hi

Just wondering if someone could clear up a few queries? I was trying to get some documentation together about lazarus working with fp4nds - but in the mean time, a new release of devkitpro has been released - and the v27 is no longer of sourceforge. As a result, I've done some experimenting/digging and think the below info is correct.

The fp4nds 2.4.0 release ships with, compiled pascal import libaries for the various libnds libraries that we installed with devkitpro release 27 (ie those in the arm-nds\libndsfpc). According to http://www.devkitpro.org/category/devkitarm/ - release 27 shipped with :-
libnds 1.4.0
dswifi 0.3.11
libfat 1.0.6
default arm7 0.5.8
libfilesystem 0.9.4
(& gcc 4.4.2)

So obviuously we're tied to the above versions.


Now devkitarm is at release 30 - and sourceforge only seems to keep the past 3 realease - (30,29,2 - so 27 seems to have disspeared.

It appears that that the \fpc\2.4.0\bin\arm-nds folder is made up of :-
Most of the devkitarm (r27) C:\devkitPro\devkitARM\bin (including ndstool/mmutil etc),
Ppcarm.exe & fpc.exe

(Does ppcarm.exe invoke the fpc.exe (pascal->object code), then invokes the link (fpc\2.4.0\bin\arm-nds\arm-eabi-ld.exe) and then calls ndstool.exe)?

Anyway - what does appear to work is this.
1 Use the devkitpro installer - and get the latest devkitarm/libnds.
2 Get the prebuild libnds 1.4.0, dswifi 0.3.11, libfat 1.0.6, default arm7 0.5.8 and extract to a different folder (c:\nds\libnds)
3 Alter the fpc.cfg file to something like :-

-Tnds
-XParm-eabi-
-FuC:\lazarus\fpc\2.4.0/units/arm-nds
-FuC:\lazarus\fpc\2.4.0/units/arm-nds/libndsfpc
-FDC:\lazarus\fpc\2.4.0/bin/arm-nds
-Flc:\nds\libnds\lib
#IFDEF __THUMB__
-Flc:\devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/thumb
-Flc:\devkitpro/devkitARM/arm-eabi/lib/thumb
#ELSE
-Flc:\devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3
-Flc:\devkitpro/devkitARM/arm-eabi/lib
#ENDIF

invoking make OS_TARGET=nds CPU_TARGET=arm BINUTILSPREFIX=arm-eabi- PP=ppcarm.exe seems to build ok.

My real questions are :-

1 - The linker (arm-eabi-ld.exe) within the “fpc\2.4.0\bin\arm-nds” folder links to :-
libc.a ->C:\devkitPro\devkitARM\arm-eabi\lib
libgcc.a ->C:\devkitPro\devkitARM\lib\gcc\arm-eabi\4.4.3

Devkitarm (r27) was based on gcc 4.4.2 – later versions are 4.4.3. Does it matter if we’re using a 4.4.2 linker version to link against libraries (lib.a etc) built with 4.4.3?

Likeise, there are other files (eg crt.a) - I assume the fpc4nds compiler magic is in system.pas that needs to link with these libraries? If there is such a version dependency, was there any reason why the corrseponing library files weren't in the fpc4nds 2.4.0 binary release?

2 - Ndstool shipped with fpc4nds is 1.46. The current shipped with v30 is 1.47.
It appears that ndstool uses the default.arm/default.elf it finds from the %devkitpro%\libnds folder. Using the above setup means that ndstool 1.46 is using the latest default.* file from the offical devkit folder. (Is there a compiler/library dependency with these default.* files?)

I think that about covers my queries. (Once I get answers to the above - I'll post fuller instructions on getting lazarus setup).

Thanks

Andy


PS - Thanks to Legolas - I don't yet fully understand whats involved in this project but the amount of effort gone into this must be enormous!