Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Crosscompiling to ARM

  1. #11

    Crosscompiling to ARM

    pthreads works fine on GP2X. In fact, the SDL libraries for GP2X require it.

  2. #12

    Crosscompiling to ARM

    In the next three months I should have a lot of spare time (my gf will fly to Germany until June )
    Unfortunately I don't have a gp2x and, AFAIK, there isn't any emulator available. Of course I can take a look at it and I could help in the porting development
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #13

    Crosscompiling to ARM

    Quote Originally Posted by WILL
    Hey, keep at it Paul! GP2X will be a really nice addition to the list of game platforms for FPC.

    I can't exactly speak for him, but I think that after Legolas is done with getting the major stuff for GBA and NDS working he'll be interested in helping our add support for GP2X in FPC too.
    Thanks for the encouragement Will

    To Legolas: I would be willing to be a gp2x fpc crosscompiler tester if this helps.
    I just have to figure out how to use it properly <G>

    I have almost no ARM assembly skills but I could learn if you need a hand in creating RTLs for the gp2x.

    cheers,
    Paul.

  4. #14

    Crosscompiling to ARM

    Also, if it helps I already have the devkitGP2X downloaded which is what I am using currently to make c/c++ programs for the gp2x.

    cheers,
    Paul.

  5. #15

    Crosscompiling to ARM

    To see if I could create my own win32 arm-linux cross compiler from the fpc source, I downloaded the fpcbuild.zip source code (2.1.x version I think) and the win32crossbinutils2005.zip from the ftp site.

    I ran the script below that I placed in the root folder of the fpcbuild

    Code:
    set path=G&#58;\fpc\2.0.4\bin\i386-win32
    make distclean
    
    make all install CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=G&#58;\fpc-crossbinutils\arm-linux BINUTILSPREFIX=arm-linux- INSTALL_PREFIX=G&#58;\fpc\win32_arm-linux COMPILER_OPTIONS="cpufpemu"
    
    pause
    G:\fpc\2.0.4\bin\i386-win32 pointed to the native 2.0.4 folder containing the make.exe file
    G:\fpc-crossbinutils\arm-linux pointed to the win32 crossbin utils that I unzipped
    G:\fpc\win32_arm-linux pointed to where I wanted to install the new version of the compiler that would be built.

    Sometime later after the build finished I had a look in the win32_arm-linux install folder and found that there are no .exe files created. Is this correct?

    How do I use the new install to cross compile arm-linux stuff if there are no .exe files?

    Did I do the procedure correctly?

    Edit: I did just notice that in the G:\fpcbuild\fpcsrc\compiler folder there is a newly created file ppcrossarm.exe...

    do I use this ppcrossarm.exe and the new units in the install folder G:\fpc\win32_arm-linux\units\arm-linux\rtl to compile pascal programs for the arm?

    If needed I could use the units here as well I assume? G:\fpc\win32_arm-linux\units\arm-linux

    cheers,
    Pau.

  6. #16

    Crosscompiling to ARM

    Quote Originally Posted by paul_nicholls
    To see if I could create my own win32 arm-linux cross compiler from the fpc source, I downloaded the fpcbuild.zip source code (2.1.x version I think) and the win32crossbinutils2005.zip from the ftp site.

    I ran the script below that I placed in the root folder of the fpcbuild

    Code:
    set path=G&#58;\fpc\2.0.4\bin\i386-win32
    make distclean
    
    make all install CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=G&#58;\fpc-crossbinutils\arm-linux BINUTILSPREFIX=arm-linux- INSTALL_PREFIX=G&#58;\fpc\win32_arm-linux COMPILER_OPTIONS="cpufpemu"
    
    pause
    G:\fpc\2.0.4\bin\i386-win32 pointed to the native 2.0.4 folder containing the make.exe file
    G:\fpc-crossbinutils\arm-linux pointed to the win32 crossbin utils that I unzipped
    G:\fpc\win32_arm-linux pointed to where I wanted to install the new version of the compiler that would be built.

    Sometime later after the build finished I had a look in the win32_arm-linux install folder and found that there are no .exe files created. Is this correct?

    How do I use the new install to cross compile arm-linux stuff if there are no .exe files?

    Did I do the procedure correctly?

    Edit: I did just notice that in the G:\fpcbuild\fpcsrc\compiler folder there is a newly created file ppcrossarm.exe...

    do I use this ppcrossarm.exe and the new units in the install folder G:\fpc\win32_arm-linux\units\arm-linux\rtl to compile pascal programs for the arm?

    If needed I could use the units here as well I assume? G:\fpc\win32_arm-linux\units\arm-linux
    Ok, I tried using the ppcrossarm.exe and the G:\fpc\win32_arm-linux\units\arm-linux\* path to compile my simple almost blank pas file using SDL.

    [pascal]Program Test;
    Uses
    SDL;
    Begin
    End.
    [/pascal]
    It now finds the pthreads unit ok, but it instead complains that it couldn't find the internal as.exe assembler, now switching to external assembler.

    It then stops with that 1 error.

    Paul.

  7. #17

    Crosscompiling to ARM

    Did you install cross binutils?

  8. #18

    Crosscompiling to ARM

    Excellent news!! I have gotten my first simple sdl program working for the GP2X using freepascal, compiled under Win32!!

    Someone was able to give me advice

    The process requires the fpcbuild source files and the normal freepascal binaries installed, for example v 2.0.4 so you can use the make.exe file included in the fpc\2.0.4\bin\i386-win32 folder to compile the source code.

    It also requires the devkitGP2X (http://archive.gp2x.de/cgi-bin/cfile...,0,0,0,14,1362) downloaded and extracted to the rootfolder of a drive (c:\ in my case)

    SDL.pas also needs to be slightly modified.

    There are lots of instructions so instead of placing them here I will upload the files needed to a server so people can download them and have a play

    to wet your appitite though here are some of the script batch files I have used.

    I put all the scripts into the project folder and update the CompileProject to point to the files to compile

    InitFiles.bat
    Code:
    Del *.s
    Del *.o
    Del *.ppu
    Del *.gpe
    CompileProject.bat
    Code:
    @echo off
    set path=C&#58;\FPC_win32_arm-linux\bin\arm-linux
    
    call InitFiles.bat
    
    rem compile all needed units to allow compiling of main file
    call CompileAux.bat SDL.pas
    
    rem compile main file
    call CompileMain.bat gp2x_test
    
    call CleanupFiles.bat
    
    pause
    CompileAux.bat
    Code:
    echo compiling %1...
    ppcrossarm -dgp2x %1
    CompileMain.bat
    Code:
    echo Compiling %1.dpr
    ppcrossarm -s -dgp2x %1.dpr
    echo Assembling %1 
    arm-linux-as.exe -mcpu=arm920 -o %1.o %1.s
    if errorlevel 1 goto asmend
    echo Linking %1
    arm-linux-ld.exe -static --no-warn-mismatch -s -L. -o%1.gpe link.res -lm -lstdc++ -lgcc_eh -lpthread -lvorbisidec -lmikmod -lpng -lpng12 -lz -lSDL -ljpeg -lfreetype -lc -lgcc
    if errorlevel 1 goto linkend
    goto end
    &#58;asmend
    echo An error occured while assembling %1
    goto end
    &#58;linkend
    echo An error occured while linking %1
    &#58;end
    CleanupFiles.bat
    Code:
    Del *.s
    Del link.res
    Del ppas.bat
    Del *.o
    Del *.ppu

    cheers,
    Paul.

  9. #19
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Crosscompiling to ARM

    Very nice Paul! Awesome work. :thumbup:

    Between you and Francesco (Legolas) FreePascal might just be THE handheld game console development tool of choice for Pascal game developers.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  10. #20

    Crosscompiling to ARM

    Quote Originally Posted by WILL
    Very nice Paul! Awesome work. :thumbup:

    Between you and Francesco (Legolas) FreePascal might just be THE handheld game console development tool of choice for Pascal game developers.
    <G> I did get a big start from a Eugene Proshkin who lurks in the gp32x formums

    He created a program for the GP2X called blocks (http://www.gp32x.com/board/lofiversi...hp/t34048.html)

    He sent me an email as a starting point containing an example fpc.cfg file, the batch file to compile the FPC source code, what devkitGP2X file paths were needed, what devkitGP2X files .so files needed modifying.

    He also sent me a batch file to compile the project files to create the .gpe file.

    I did have to make changes to various batch files and paths to make it work + fix a small error (i think), but it was a huge help

    It took me a while to get all the stuff working, but it seems to be working now :-)

    He sent me the new SDL.pas file that was modified as well.

    cheers,
    Paul.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •