DGL
https://delphigl.com/forum/

help to make FreePascal W32 for GP2X(arm-linux with soft FP)
https://delphigl.com/forum/viewtopic.php?f=19&t=5965
Seite 1 von 1

Autor:  Gast [ Mi Sep 20, 2006 21:51 ]
Betreff des Beitrags:  help to make FreePascal W32 for GP2X(arm-linux with soft FP)

help me to make FreePascal win32 for crosscompiling GP2X. I can`t make software floating point (there are errors with long number 200*** and linker say, that modules *.o with hard fp but need soft target)
I compile fpc 2.0.2 with make all install CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=c:\fpc\arm-linux BINUTILSPREFIX=arm-linux- INSTALL_PREFIX=d:\FPC\2.0.2 COMPILER_OPTIONS="cpufpemu" and comile my project with -Ce -CfSOFT, but this not work.
I can't compile fpc 2.1.2 dev version
second problem - during link there are undefined references "libSDL_gfx.so: undefined reference to `ceil@GLIBC_2.0'"
may be anyboby have cmpiled fpc for this target?

Autor:  TAK2004 [ Do Sep 21, 2006 13:11 ]
Betreff des Beitrags: 

The Last time who i code for GP2X there was only a linux package for arm(nov-dez 2005).
I installed the FPC for linux and copy the arm linux in the right folders.
After that i load the right *.so files from a beta programmer for gp2x.
Today you can load the SDK from the GP2X site and setup your fpc.cfg to the sdk lib folders.
If you compile now with arm toolchain it use the so files from the gp2x sdk and there is no error.
Its very usefull if you update your gp2x firmware to 2.0 because then you can use the usb interface for coding.
I mount on the sd card a dir to my developer dir on my pc an if i start the app it read it via smb from pc.
That is very fast and you must not copy your program to sdcard, start gp2x, start programm, shut off and code some lines till next test.

Autor:  Gast [ Do Sep 21, 2006 17:18 ]
Betreff des Beitrags: 

Yes, I use so files from SDK. I have too linux with fcp and can compile executable file for gp2x, but with hardware FP. There are some error with demo SDL. ttf fonts hav`nt color and program with sdl_gfx nothing display (may be it freeze on start). I know win32 beter and I wont to use fcp under win32, but now not successfuly :( And I`ll try samba. Thanks for tip.

Autor:  TAK2004 [ Do Sep 21, 2006 22:25 ]
Betreff des Beitrags: 

I test only the sdl.so and on the end i used no lib only devices like fb.
I worked on a OpenGL ES driver for FPC and GP2X but i froze the project because not much time and a other project with more coder.
The gp2x sdl_.. stuff ist not the same like win and linux, check the sdk and c code for right usage.
Look at your headers for the libs, it can be that the headers are wrong.
Use the SDL headers only on beginning because they slow down the speed of your app.

Autor:  Gast [ Fr Sep 22, 2006 18:27 ]
Betreff des Beitrags: 

Thanks. And stay single question - software FP. I can't now use math function like sin or cos

Autor:  TAK2004 [ Fr Sep 22, 2006 22:12 ]
Betreff des Beitrags: 

Try uses math; ^^
I used sin and some other math functions in my app so it must work.
http://tak2004.dyndns.org/share/3dengine.rar
This is a old code of my testapp but i dont know if it compile correct.

Autor:  Gast [ Fr Sep 29, 2006 06:50 ]
Betreff des Beitrags: 

I can't create working gpe. :( I try lot of variants, but now unsuccessfuly. Next three variants:

dynamic linking from command line - gpe after starting write that some functions not defined
in gp2x's libraries (__truncdfsd2)

static linking from command line
ld wrote for same functions from libgcc undefined - "undefined reference to `__divsi3'",
but in dynamic mode no these messages

ppcrossarm -dgp2x sdltest.dpr
ld wrote for each *.o
"arm-linux-ld.exe: ERROR: *.o uses hardware FP, whereas sdltest uses software FP"
and undefined some functions in same libraries (libgcc, libmikmod ...)

gpe from your samples I can make only with dynamic linking from command line. 3d.gpe work, but
in screen only two white line, and ortho.gpe put error in start.

And another question - with math I can use math function and float constant, but I can't compile code like next
var r: single;
n: integer;
...
n:=round(r / 200 * sin(pi/2));

Is there different beetveen libs in SDK gp2x for linux and windows? I think no. I use libs from windows SDK.

May be wont I many from freepascal? but Delphi compiled this project without error and work it fine with sdl dll-s

Autor:  TAK2004 [ Fr Sep 29, 2006 12:57 ]
Betreff des Beitrags: 

I think your fpc.cfg is not correct.

Add following stuff with correct paths to your /etc/fpc.cfg.
Code:
  1. ...
  2. # For a debug version compile with debuginfo and all codegeneration checks on
  3. #IFDEF DEBUG
  4.   -g
  5.   -Crtoi
  6.   #WRITE Compiling Debug Version
  7. #ENDIF
  8.  
  9. # set binutils prefix
  10. #IFDEF FPC_CROSSCOMPILING
  11.   -XP-
  12. #ENDIF
  13.  
  14. #IFDEF gp2x
  15.   -XParm-linux-
  16.   -Xd
  17.   -Fu/usr/local/lib/fpc/2.0.4/units/arm-linux/*
  18.   -Fl/usr/local/arm-dev/arm-linux/usr/lib/
  19.   -Fl/usr/local/arm-dev/arm-linux/lib/
  20. #ENDIF


If you will compile a programm you use
Code:
  1. ppcarm unitname -dgp2x
and it use the right libs.

Autor:  Gast [ Sa Sep 30, 2006 22:32 ]
Betreff des Beitrags: 

I did that fpc on windows compiled static gpe. I made batch file from ppas.bat

@echo off
ppcrossarm -s -dgp2x %1.dpr
SET THEFILE=sdltest
echo Assembling %THEFILE%
D:\FPC\2.0.2\bin\arm-linux\arm-linux-as.exe -mfpu=softfpa -o %1.o %1.s
if errorlevel 1 goto asmend
SET THEFILE=sdltest
echo Linking %THEFILE%
D:\FPC\2.0.2\bin\arm-linux\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
:asmend
echo An error occured while assembling %THEFILE%
goto end
:linkend
echo An error occured while linking %THEFILE%
:end
Del %1.s
Del link.res
Del ppas.bat
Del %1.o

But I can't get software FP. For line "str(cos(pi/4),stri);"
With option -Ce wrote "Fatal: Unknown compilerproc "fpc_single_div". Check if you use the correct run time library."
With -CfSOFT - Internal error 200308252
else - Error: selected processor does not support `ldfd f1,[r0]'

Autor:  TAK2004 [ Sa Sep 30, 2006 23:44 ]
Betreff des Beitrags: 

At the moment there is now way to compile gp2x under windows.
The only supported platform for arm ist linux.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/